Skip to content

Commit

Permalink
Framework: sync with upstream
Browse files Browse the repository at this point in the history
Taken from: FreeBSD
  • Loading branch information
fichtner committed Oct 23, 2015
1 parent dfd59d6 commit 31c87da
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 12 deletions.
15 changes: 15 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ in the release notes and/or placed into UPDATING.

All ports committers are allowed to commit to this file.

20151022:
AUTHOR: [email protected]

Improved support for USES=shebangfix

- We now support multiple values for *_OLD_CMD
- We replace more variants by default (/bin/${lang}, /usr/bin/${lang},
/usr/bin/env ${lang}).
- shebangfix now also supports lua if USES=lua is specified
- Pattern matching has been improved: we now only match whole worlds,
e.g. "/usr/bin/perl5.005" is no longer erroneously replaced with
"${perl_CMD}5.005".

Note that *_OLD_CMD entries which contain spaces must now be quoted.

20150928:
AUTHOR: [email protected]

Expand Down
4 changes: 2 additions & 2 deletions Keywords/info.ucl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ post-install: <<EOD
/*) file="%@" ;;
*) file="%D/%@" ;;
esac
indexinfo ${file%/*}
indexinfo ${PKG_ROOTDIR}${file%/*}
EOD
post-deinstall: <<EOD
case "%@" in
/*) file="%@" ;;
*) file="%D/%@" ;;
esac
indexinfo ${file%/*}
indexinfo ${PKG_ROOTDIR}${file%/*}
EOD
12 changes: 10 additions & 2 deletions Mk/Uses/shebangfix.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
#
# SHEBANG_FILES= path1/file path2/*.pl
#
# To define custom shebangs to replace, use the following (note that
# shebangs with spaces should be quoted):
#
# perl_OLD_CMD= /usr/bin/perl5.005 "/usr/bin/setenv perl5.005"
#
# To define a new shebang scheme add the following to the port Makefile:
#
# SHEBANG_LANG= lua
Expand All @@ -36,8 +41,11 @@ SHEBANG_LANG+= lua
lua_CMD?= ${LOCALBASE}/bin/${LUA_CMD}
.endif

tcl_CMD?= ${TCLSH}
tk_CMD?= ${WISH}
tcl_OLD_CMD+= /usr/bin/tclsh
tcl_CMD?= ${TCLSH}

tk_OLD_CMD+= /usr/bin/wish
tk_CMD?= ${WISH}

.if ${USES:Mpython*}
python_CMD?= ${PYTHON_CMD}
Expand Down
30 changes: 22 additions & 8 deletions Mk/bsd.port.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3688,6 +3688,11 @@ create-users-groups:
@${RM} -f ${_UG_OUTPUT} || ${TRUE}
@${ECHO_MSG} "===> Creating users and/or groups."
@${ECHO_CMD} "echo \"===> Creating users and/or groups.\"" >> ${_UG_OUTPUT}
.if ${OPSYS} != FreeBSD || ${OSVERSION} < 1002000
@${ECHO_CMD} "PW=${PW}" >> ${_UG_OUTPUT}
.else
@${ECHO_CMD} -e "if [ -n \"\$${PKG_ROOTDIR}\" -a \"\$${PKG_ROOTDIR}\" != \"/\" ]; then PW=\"${PW} -R \$${PKG_ROOTDIR}\"; else PW=${PW}; fi" >> ${_UG_OUTPUT}
.endif
.for _group in ${GROUPS}
# _bgpd:*:130:
@if ! ${GREP} -h ^${_group}: ${GID_FILES} >/dev/null 2>&1; then \
Expand All @@ -3696,9 +3701,9 @@ create-users-groups:
fi
@IFS=":"; ${GREP} -h ^${_group}: ${GID_FILES} | head -n 1 | while read group foo gid members; do \
gid=$$(($$gid+${GID_OFFSET})); \
${ECHO_CMD} -e "if ! ${PW} groupshow $$group >/dev/null 2>&1; then \n \
${ECHO_CMD} -e "if ! \$${PW} groupshow $$group >/dev/null 2>&1; then \n \
echo \"Creating group '$$group' with gid '$$gid'.\" \n \
${PW} groupadd $$group -g $$gid; else echo \"Using existing group '$$group'.\"\nfi" >> ${_UG_OUTPUT}; \
\$${PW} groupadd $$group -g $$gid; else echo \"Using existing group '$$group'.\"\nfi" >> ${_UG_OUTPUT}; \
done
.endfor
.endif
Expand All @@ -3719,9 +3724,9 @@ create-users-groups:
gid=$$(($$gid+${GID_OFFSET})); \
class="$${class:+-L }$$class"; \
homedir=$$(echo $$homedir | sed "s|^/usr/local|${PREFIX}|"); \
${ECHO_CMD} -e "if ! ${PW} usershow $$login >/dev/null 2>&1; then \n \
${ECHO_CMD} -e "if ! \$${PW} usershow $$login >/dev/null 2>&1; then \n \
echo \"Creating user '$$login' with uid '$$uid'.\" \n \
${PW} useradd $$login -u $$uid -g $$gid $$class -c \"$$gecos\" -d $$homedir -s $$shell \n \
\$${PW} useradd $$login -u $$uid -g $$gid $$class -c \"$$gecos\" -d $$homedir -s $$shell \n \
else \necho \"Using existing user '$$login'.\" \nfi" >> ${_UG_OUTPUT}; \
case $$homedir in /|/nonexistent|/var/empty) ;; *) ${ECHO_CMD} "${INSTALL} -d -g $$gid -o $$uid $$homedir" >> ${_UG_OUTPUT};; esac; \
done
Expand All @@ -3734,9 +3739,9 @@ create-users-groups:
IFS=","; for _login in $$members; do \
for _user in ${USERS}; do \
if [ "x$${_user}" = "x$${_login}" ]; then \
${ECHO_CMD} -e "if ! ${PW} groupshow ${_group} | ${GREP} -qw $${_login}; then \n \
${ECHO_CMD} -e "if ! \$${PW} groupshow ${_group} | ${GREP} -qw $${_login}; then \n \
echo \"Adding user '$${_login}' to group '${_group}'.\" \n \
${PW} groupmod ${_group} -m $${_login} \nfi" >> ${_UG_OUTPUT}; \
\$${PW} groupmod ${_group} -m $${_login} \nfi" >> ${_UG_OUTPUT}; \
fi; \
done; \
done; \
Expand All @@ -3745,10 +3750,19 @@ create-users-groups:
.endif
.if defined(USERS)
.for _user in ${USERS}
.if ${OPSYS} != FreeBSD || ${OSVERSION} < 1002000
@if [ ! ${USERS_BLACKLIST:M${_user}} ]; then \
${ECHO_CMD} "@unexec PW=${PW}; \
if \$${PW} usershow ${_user} >/dev/null 2>&1; then \
echo \"==> You should manually remove the \\\"${_user}\\\" user. \"; fi" >> ${TMPPLIST}; \
fi
.else
@if [ ! ${USERS_BLACKLIST:M${_user}} ]; then \
${ECHO_CMD} "@unexec if ${PW} usershow ${_user} >/dev/null 2>&1; then \
echo \"==> You should manually remove the \\\"${_user}\\\" user. \"; fi" >> ${TMPPLIST}; \
${ECHO_CMD} "@unexec if [ -n \"\$${PKG_ROOTDIR}\" -a \"\$${PKG_ROOTDIR}\" != \"/\" ]; then PW=\"${PW} -R \$${PKG_ROOTDIR}\"; else PW=${PW}; fi; \
if \$${PW} usershow ${_user} >/dev/null 2>&1; then \
echo \"==> You should manually remove the \\\"${_user}\\\" user. \"; fi" >> ${TMPPLIST}; \
fi
.endif
.endfor
.endif
.endif
Expand Down

0 comments on commit 31c87da

Please sign in to comment.