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 | 4f3f76658030a12be96332ad1c593b66684526de (patch) | |
tree | 7f5d86fff567059c6d29f2bb49e3ba3cc0ecf3c8 /mk/pkginstall/shell | |
parent | 86f9642690c1bd8138db1a027663039c33e27df6 (diff) | |
download | pkgsrc-4f3f76658030a12be96332ad1c593b66684526de.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/pkginstall/shell')
-rw-r--r-- | mk/pkginstall/shell | 30 |
1 files changed, 21 insertions, 9 deletions
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 |