]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
pakfire: When there is an error copying the files...
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Jun 2009 00:06:45 +0000 (02:06 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Jun 2009 00:06:45 +0000 (02:06 +0200)
...we will quit.

src/pakfire/compressor

index 8750da18e92f14ea794ce010f10ec304db2dcb4d..6396b7c79ee71abd575a3eaacb7fbef9c04cd7f9 100755 (executable)
@@ -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 <<EOF >$INFO
 ### $NAME package