diff options
author | obrien <obrien@FreeBSD.org> | 2007-06-29 09:06:38 +0800 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2007-06-29 09:06:38 +0800 |
commit | 99fb0e14197329aceb1358cb4c647368fbe3e86c (patch) | |
tree | d98de8397dbbbfc6b2f89b94d098dcb15e3f1f78 /shells | |
parent | 11d1367912de7c2a6582ed56e46036c3e2c5f969 (diff) | |
download | freebsd-ports-gnome-99fb0e14197329aceb1358cb4c647368fbe3e86c.tar.gz freebsd-ports-gnome-99fb0e14197329aceb1358cb4c647368fbe3e86c.tar.zst freebsd-ports-gnome-99fb0e14197329aceb1358cb4c647368fbe3e86c.zip |
Slightly cleaner PREFIX=/ handling.
Diffstat (limited to 'shells')
-rw-r--r-- | shells/bash/pkg-deinstall | 8 | ||||
-rw-r--r-- | shells/bash/pkg-install | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/shells/bash/pkg-deinstall b/shells/bash/pkg-deinstall index 3e19db4b1637..9552db126262 100644 --- a/shells/bash/pkg-deinstall +++ b/shells/bash/pkg-deinstall @@ -3,8 +3,8 @@ # $FreeBSD$ # -BASH="${PKG_PREFIX-/usr/local}/bin/bash" -RBASH="${PKG_PREFIX-/usr/local}/bin/rbash" +BASH="$(echo ${PKG_PREFIX-/usr/local}/bin/bash | /usr/bin/sed -e 's|//|/|g')" +RBASH="$(echo ${PKG_PREFIX-/usr/local}/bin/rbash | /usr/bin/sed -e 's|//|/|g')" SHELLS="${PKG_DESTDIR-}/etc/shells" case $2 in @@ -12,7 +12,7 @@ DEINSTALL) if grep -qs "^$BASH\$" "$SHELLS"; then if [ `id -u` -eq 0 ]; then TMPSHELLS=`mktemp -t shells` - grep -v "^$(echo "$BASH" | /usr/bin/sed -e 's|//|/|g')\$" "$SHELLS" > "$TMPSHELLS" + grep -v "^$BASH\$" "$SHELLS" > "$TMPSHELLS" cat "$TMPSHELLS" > "$SHELLS" rm "$TMPSHELLS" else @@ -22,7 +22,7 @@ DEINSTALL) if grep -qs "^$RBASH\$" "$SHELLS"; then if [ `id -u` -eq 0 ]; then TMPSHELLS=`mktemp -t shells` - grep -v "^$(echo "$RBASH" | /usr/bin/sed -e 's|//|/|g')\$" "$SHELLS" > "$TMPSHELLS" + grep -v "^$RBASH\$" "$SHELLS" > "$TMPSHELLS" cat "$TMPSHELLS" > "$SHELLS" rm "$TMPSHELLS" else diff --git a/shells/bash/pkg-install b/shells/bash/pkg-install index 8aa663d21621..37a63a755364 100644 --- a/shells/bash/pkg-install +++ b/shells/bash/pkg-install @@ -3,22 +3,22 @@ # $FreeBSD$ # -BASH="${PKG_PREFIX-/usr/local}/bin/bash" -RBASH="${PKG_PREFIX-/usr/local}/bin/rbash" +BASH="$(echo ${PKG_PREFIX-/usr/local}/bin/bash | /usr/bin/sed -e 's|//|/|g')" +RBASH="$(echo ${PKG_PREFIX-/usr/local}/bin/rbash | /usr/bin/sed -e 's|//|/|g')" SHELLS="${PKG_DESTDIR-}/etc/shells" case $2 in POST-INSTALL) if [ -d "${SHELLS%/*}" ] && ! grep -qs "^$BASH\$" "$SHELLS"; then if [ `id -u` -eq 0 ]; then - echo "$BASH" | /usr/bin/sed -e 's|//|/|g' >> "$SHELLS" + echo "$BASH" >> "$SHELLS" else echo "Not root, please add $BASH to $SHELLS manually" fi fi if [ -d "${SHELLS%/*}" ] && ! grep -qs "^$RBASH\$" "$SHELLS"; then if [ `id -u` -eq 0 ]; then - echo "$RBASH" | /usr/bin/sed -e 's|//|/|g' >> "$SHELLS" + echo "$RBASH" >> "$SHELLS" else echo "Not root, please add $RBASH to $SHELLS manually" fi |