chiark / gitweb /
make apt-in-chroot work with dash
authorStephen Gran <steve@lobefin.net>
Sun, 5 Jun 2011 19:14:53 +0000 (20:14 +0100)
committerStephen Gran <steve@lobefin.net>
Sun, 5 Jun 2011 19:14:53 +0000 (20:14 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
apt-in-chroot

index 4e0028a..21be495 100755 (executable)
@@ -57,11 +57,7 @@ install|remove|purge|build-dep)
        ;;
 esac
 
-grep -qFx $CHROOT <<< "$VALID_CHROOTS"
-
-RET=$?
-
-if [ "$RET" == "0" ]; then
+if echo "$VALID_CHROOTS" | grep -qFx "$CHROOT"
        # valid chroot
        echo "Will run '/usr/sbin/chroot $CHROOT_DIR/$CHROOT apt-get $APTCMD $PACKAGES'"
        /usr/sbin/chroot $CHROOT_DIR/$CHROOT apt-get $APTCMD $PACKAGES