From c138c335a5d867d81231fdca6f418a9cc11ca244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Piotrowski?= Date: Mon, 6 Jan 2014 13:08:55 +0100 Subject: [PATCH] mkimage-arch: use mktemp to create ROOTFS directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docker-DCO-1.1-Signed-off-by: Bartłomiej Piotrowski (github: Barthalion) --- contrib/mkimage-arch.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/mkimage-arch.sh b/contrib/mkimage-arch.sh index db14e8674e..d9e911474e 100755 --- a/contrib/mkimage-arch.sh +++ b/contrib/mkimage-arch.sh @@ -4,19 +4,19 @@ # requires root set -e -PACSTRAP=$(which pacstrap) +PACSTRAP=$(hash pacstrap &>/dev/null) [ "$PACSTRAP" ] || { echo "Could not find pacstrap. Run pacman -S arch-install-scripts" exit 1 } -EXPECT=$(which expect) -[ "$EXPECT" ] || { + +EXPECT=$(hash expect &>/dev/null) +[[ "$EXPECT" ]] || { echo "Could not find expect. Run pacman -S expect" exit 1 } -ROOTFS=~/rootfs-arch-$$-$RANDOM -mkdir $ROOTFS +ROOTFS=$(mktemp -d /tmp/rootfs-archlinux-XXXXXXXXXX) #packages to ignore for space savings PKGIGNORE=linux,jfsutils,lvm2,cryptsetup,groff,man-db,man-pages,mdadm,pciutils,pcmciautils,reiserfsprogs,s-nail,xfsprogs