[csw-devel] SF.net SVN: gar:[5732] csw/mgar/pkg/zsh/trunk/files

opk at users.sourceforge.net opk at users.sourceforge.net
Thu Jul 30 12:33:34 CEST 2009


Revision: 5732
          http://gar.svn.sourceforge.net/gar/?rev=5732&view=rev
Author:   opk
Date:     2009-07-30 10:33:34 +0000 (Thu, 30 Jul 2009)

Log Message:
-----------
fix updating of /etc/shells using PKG_INSTALL_ROOT and not BASEDIR

Modified Paths:
--------------
    csw/mgar/pkg/zsh/trunk/files/CSWzsh.postinstall
    csw/mgar/pkg/zsh/trunk/files/CSWzsh.postremove

Modified: csw/mgar/pkg/zsh/trunk/files/CSWzsh.postinstall
===================================================================
--- csw/mgar/pkg/zsh/trunk/files/CSWzsh.postinstall	2009-07-30 09:54:48 UTC (rev 5731)
+++ csw/mgar/pkg/zsh/trunk/files/CSWzsh.postinstall	2009-07-30 10:33:34 UTC (rev 5732)
@@ -2,10 +2,12 @@
 PATH=/usr/bin
 export PATH
 
-if [ -f ${BASEDIR}/etc/shells ]; then
-	echo "${BASEDIR}/etc/shells already exists."
+# $BASEDIR ignored because the package isn't relocatable
+
+if [ -f ${PKG_INSTALL_ROOT}/etc/shells ]; then
+	echo "${PKG_INSTALL_ROOT}/etc/shells already exists."
 else
-	cat > ${BASEDIR}/etc/shells <<EOF
+	cat > ${PKG_INSTALL_ROOT}/etc/shells <<EOF
 /bin/bash
 /bin/csh
 /bin/jsh
@@ -31,9 +33,9 @@
 EOF
 fi
 
-if /usr/bin/grep "^${BASEDIR}/opt/csw/bin/zsh$" ${BASEDIR}/etc/shells 2> /dev/null > /dev/null; then
-	echo "${BASEDIR}/etc/shells is UNCHANGED because entry ${BASEDIR}/opt/csw/bin/zsh does already exists."
+if /usr/bin/grep "^/opt/csw/bin/zsh$" ${PKG_INSTALL_ROOT}/etc/shells 2> /dev/null > /dev/null; then
+	echo "${PKG_INSTALL_ROOT}/etc/shells is UNCHANGED because entry /opt/csw/bin/zsh already exists."
 else
-	echo "${BASEDIR}/opt/csw/bin/zsh" >> ${BASEDIR}/etc/shells
-	echo "ADDED ${BASEDIR}/opt/csw/bin/zsh to ${BASEDIR}/etc/shells."
+	echo "/opt/csw/bin/zsh" >> ${PKG_INSTALL_ROOT}/etc/shells
+	echo "ADDED /opt/csw/bin/zsh to ${PKG_INSTALL_ROOT}/etc/shells."
 fi

Modified: csw/mgar/pkg/zsh/trunk/files/CSWzsh.postremove
===================================================================
--- csw/mgar/pkg/zsh/trunk/files/CSWzsh.postremove	2009-07-30 09:54:48 UTC (rev 5731)
+++ csw/mgar/pkg/zsh/trunk/files/CSWzsh.postremove	2009-07-30 10:33:34 UTC (rev 5732)
@@ -2,9 +2,9 @@
 PATH=/usr/bin
 export PATH
 
-if /usr/bin/grep "^${BASEDIR}/opt/csw/bin/zsh$" ${BASEDIR}/etc/shells 2> /dev/null > /dev/null; then
-	/usr/bin/perl -i -pwe '$_ = "" if /\/opt\/csw\/bin\/zsh$/' ${BASEDIR}/etc/shells
-	echo "REMOVED ${BASEDIR}/opt/csw/bin/zsh from ${BASEDIR}/etc/shells."
+if /usr/bin/grep "^/opt/csw/bin/zsh$" ${PKG_INSTALL_ROOT}/etc/shells >/dev/null 2>&1; then
+	/usr/bin/perl -i -pwe '$_ = "" if /\/opt\/csw\/bin\/zsh$/' ${PKG_INSTALL_ROOT}/etc/shells
+	echo "REMOVED /opt/csw/bin/zsh from ${PKG_INSTALL_ROOT}/etc/shells."
 else
-	echo "${BASEDIR}/etc/shells is UNCHANGED because entry ${BASEDIR}/opt/csw/bin/zsh was already wiped."
+	echo "${PKG_INSTALL_ROOT}/etc/shells is UNCHANGED because no entry for /opt/csw/bin/zsh was found."
 fi


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list