pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/pkginstall Previous change breaks platforms with ne...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ea34d8dc96dd
branches:  trunk
changeset: 575270:ea34d8dc96dd
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Fri May 07 14:29:36 2010 +0000

description:
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:

 mk/pkginstall/bsd.pkginstall.mk |   7 +------
 mk/pkginstall/shell             |  30 +++++++++++++++++++++---------
 2 files changed, 22 insertions(+), 15 deletions(-)

diffs (109 lines):

diff -r 572be38ac5fe -r ea34d8dc96dd mk/pkginstall/bsd.pkginstall.mk
--- a/mk/pkginstall/bsd.pkginstall.mk   Fri May 07 12:02:43 2010 +0000
+++ b/mk/pkginstall/bsd.pkginstall.mk   Fri May 07 14:29:36 2010 +0000
@@ -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 @@
 #
 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 @@
                ${RM} -f ${.TARGET};                                    \
                ${TOUCH} ${TOUCH_ARGS} ${.TARGET};                      \
        fi
-.endif
 
 # SHLIB_TYPE
 #      The type of shared library supported by the platform.
diff -r 572be38ac5fe -r ea34d8dc96dd mk/pkginstall/shell
--- a/mk/pkginstall/shell       Fri May 07 12:02:43 2010 +0000
+++ b/mk/pkginstall/shell       Fri May 07 14:29:36 2010 +0000
@@ -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 @@
 #
 #      # 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 @@
                ${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 @@
 
                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 @@
 
                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 @@
 
                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



Home | Main Index | Thread Index | Old Index