From: Michael Tremer Date: Mon, 8 Jun 2009 00:06:45 +0000 (+0200) Subject: pakfire: When there is an error copying the files... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a7cde307a7bceac19196c189616ce7befc30750;p=ipfire-3.x.git pakfire: When there is an error copying the files... ...we will quit. --- diff --git a/src/pakfire/compressor b/src/pakfire/compressor index 8750da18e..6396b7c79 100755 --- a/src/pakfire/compressor +++ b/src/pakfire/compressor @@ -54,15 +54,21 @@ INFO=$(mktemp) TMP_DIR=$(mktemp -d) for rootfile in $ROOTFILES; do - cd / && grep -v "^#" < $rootfile | \ + ERROR=$(cd / && \ + grep -v "^#" < $rootfile | \ sed -e "s/KVER/$KVER/g" \ -e "s/IFS_TARGET/$IFS_TARGET/g" | \ - cpio -pdl --quiet $TMP_DIR + cpio -pdl --quiet $TMP_DIR 2>&1) + if [ -n "${ERROR}" ]; then + echo -e "When copying the files, an error occoured:\n\n${ERROR}" >&2 + rm -rf $ARCHIEVE $CONTROL $INFO $TMP_DIR + exit 1 + fi done cd $TMP_DIR -find . | cpio -o -H newc --quiet | lzma -czv - > $ARCHIEVE +find . | cpio -o -H newc --quiet | lzma -cz - > $ARCHIEVE cat <$INFO ### $NAME package