X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dsa-metapackages.git;a=blobdiff_plain;f=apt-in-chroot;h=45c119752a330338e8f83babdc9c3c170cfb1249;hp=279b95f9fc773b5fe93aba019ddc6216b2ab43d6;hb=a9e1c0a3bdf4fa727e1c38ee914363d6aa24fd4d;hpb=93cb66500f328580bbfd5cd9018020d1f7db7fbc diff --git a/apt-in-chroot b/apt-in-chroot index 279b95f..45c1197 100755 --- a/apt-in-chroot +++ b/apt-in-chroot @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # apt-in-chroot - runs apt in a specified chroot # @@ -53,14 +53,11 @@ install|remove|purge|build-dep) ;; *) echo "$APTCMD is not a valid apt sub-command" + exit 1 ;; esac -grep -qFx $CHROOT <<< "$VALID_CHROOTS" - -RET=$? - -if [ "$RET" == "0" ]; then +if echo "$VALID_CHROOTS" | grep -qFx "$CHROOT"; then # 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