quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [PATCH 30/39] backup-files: Skip first mkdir on restore


From: Jean Delvare
Subject: [Quilt-dev] [PATCH 30/39] backup-files: Skip first mkdir on restore
Date: Sat, 19 Mar 2011 10:53:00 +0100
User-agent: quilt/0.48-17.1

The mass link/copy will create the required directories by itself if
it succeeds. As files being removed don't require the creation of a
directory, this means we can move the creation of the directories
to the case where non-empty files have to be processed individually.

Signed-off-by: Jean Delvare <address@hidden>
Reviewed-by: Raphael Hertzog <address@hidden>
---
 quilt/scripts/backup-files.in |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- a/quilt/scripts/backup-files.in
+++ b/quilt/scripts/backup-files.in
@@ -144,12 +144,6 @@ restore_all()
 {
        local EMPTY_FILES NONEMPTY_FILES
 
-       (cd "$OPT_PREFIX" && find . -type d -print0) \
-       | xargs -0 mkdir -p
-       if [ ${PIPESTATUS[0]} != 0 ]; then
-               return 1
-       fi
-
        # Store the list of files to process
        EMPTY_FILES=$(gen_tempfile)
        NONEMPTY_FILES=$(gen_tempfile)
@@ -185,6 +179,9 @@ restore_all()
                                $ECHO "Restoring ${REPLY#./}"
                        done < "$NONEMPTY_FILES"
                else
+                       (cd "$OPT_PREFIX" && find . -type d -print0) \
+                       | xargs -0 mkdir -p
+
                        xargs -0 rm -f < "$NONEMPTY_FILES"
 
                        while read -d $'\0' -r




reply via email to

[Prev in Thread] Current Thread [Next in Thread]