diff options
author | jmmv <jmmv@pkgsrc.org> | 2010-05-07 14:29:36 +0000 |
---|---|---|
committer | jmmv <jmmv@pkgsrc.org> | 2010-05-07 14:29:36 +0000 |
commit | 41fddc8889f180084e91ee351fa03b05e39908de (patch) | |
tree | 7f5d86fff567059c6d29f2bb49e3ba3cc0ecf3c8 /mk | |
parent | 7b8b6b9a150569099392bb77fc08e2c347f5e007 (diff) | |
download | pkgsrc-41fddc8889f180084e91ee351fa03b05e39908de.tar.gz |
Previous change breaks platforms with need_ksh. Reported by joerg@.
Let's revert it for now and think about a way to proceed with this idea
later.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/pkginstall/bsd.pkginstall.mk | 7 | ||||
-rw-r--r-- | mk/pkginstall/shell | 30 |
2 files changed, 22 insertions, 15 deletions
diff --git a/mk/pkginstall/bsd.pkginstall.mk b/mk/pkginstall/bsd.pkginstall.mk index 7fd31a52c72..6070dca904e 100644 --- a/mk/pkginstall/bsd.pkginstall.mk +++ b/mk/pkginstall/bsd.pkginstall.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkginstall.mk,v 1.48 2010/05/07 12:00:36 jmmv Exp $ +# $NetBSD: bsd.pkginstall.mk,v 1.49 2010/05/07 14:29:36 jmmv Exp $ # # This Makefile fragment is included by bsd.pkg.mk and implements the # common INSTALL/DEINSTALL scripts framework. To use the pkginstall @@ -762,10 +762,6 @@ install-script-data-info-files: # PKG_SHELL?= # empty -.if !empty(PKG_SHELL) -DEPENDS+= etcutils>=0.1:../../sysutils/etcutils -FILES_SUBST+= SHELLS=${PREFIX:Q}/sbin/shells - _INSTALL_SHELL_FILE= ${_PKGINSTALL_DIR}/shell _INSTALL_SHELL_DATAFILE= ${_PKGINSTALL_DIR}/shell-data _INSTALL_UNPACK_TMPL+= ${_INSTALL_SHELL_FILE} @@ -792,7 +788,6 @@ ${_INSTALL_SHELL_FILE}: ../../mk/pkginstall/shell ${RM} -f ${.TARGET}; \ ${TOUCH} ${TOUCH_ARGS} ${.TARGET}; \ fi -.endif # SHLIB_TYPE # The type of shared library supported by the platform. diff --git a/mk/pkginstall/shell b/mk/pkginstall/shell index ba9fd79dd2b..ff4833a780b 100644 --- a/mk/pkginstall/shell +++ b/mk/pkginstall/shell @@ -1,4 +1,4 @@ -# $NetBSD: shell,v 1.5 2010/05/07 12:00:36 jmmv Exp $ +# $NetBSD: shell,v 1.6 2010/05/07 14:29:36 jmmv Exp $ # # Generate a +SHELL script that handles shell registration for the package. # @@ -29,12 +29,17 @@ UNPACK,|UNPACK,+SHELL) # # # SHELL: bin/pdksh # +CAT="@CAT@" +CP="@CP@" ECHO="@ECHO@" +GREP="@GREP@" PWD_CMD="@PWD_CMD@" +RM="@RM@" SED="@SED@" -SHELLS="@SHELLS@" SORT="@SORT@" TEST="@TEST@" +TRUE="@TRUE@" +TOUCH="@TOUCH@" SELF=$0 ACTION=$1 @@ -72,12 +77,16 @@ ADD) ${TEST} -f "$shell" || continue shelldb="/etc/shells" - if ${TEST} -f ${shelldb} && \ - ${SHELLS} -K ${shelldb} check ${shell}; then + ${TEST} -f "$shelldb" || continue + if ${TEST} -f "$shelldb" && \ + ${GREP} "^$shell" $shelldb >/dev/null; then : else ${ECHO} "${PKGNAME}: adding $shell to $shelldb" - ${SHELLS} -K ${shelldb} add ${shell} + ${TOUCH} $shelldb + ${CP} $shelldb $shelldb.pkgsrc."$$" + { ${CAT} $shelldb.pkgsrc."$$"; ${ECHO} "$shell"; } > $shelldb + ${RM} $shelldb.pkgsrc."$$" fi done ;; @@ -100,9 +109,12 @@ REMOVE) shelldb="/etc/shells" if ${TEST} -f "$shelldb" && \ - ${SHELLS} -K ${shelldb} check ${shell}; then + ${GREP} "^$shell" $shelldb >/dev/null; then ${ECHO} "${PKGNAME}: removing $shell from $shelldb" - ${SHELLS} -K ${shelldb} remove ${shell} + ${TOUCH} $shelldb + ${CP} $shelldb $shelldb.pkgsrc."$$" + { ${GREP} -v "^$shell" $shelldb.pkgsrc."$$" || ${TRUE}; } > $shelldb + ${RM} $shelldb.pkgsrc."$$" fi done ;; @@ -122,7 +134,7 @@ CHECK-ADD) shelldb="/etc/shells" if ${TEST} -f "$shelldb" && \ - ${SHELLS} -K ${shelldb} check ${shell}; then + ${GREP} "^$shell" $shelldb >/dev/null; then : else case "$printed_header" in @@ -160,7 +172,7 @@ CHECK-REMOVE) shelldb="/etc/shells" if ${TEST} -f "$shelldb" && \ - ${SHELLS} -K ${shelldb} check ${shell}; then + ${GREP} "^$shell" $shelldb >/dev/null; then case "$printed_header" in yes) ;; *) printed_header=yes |