summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--quilt.changes9
-rw-r--r--quilt/scripts/backup-files.in27
2 files changed, 23 insertions, 13 deletions
diff --git a/quilt.changes b/quilt.changes
index a553490..f74a5e9 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,13 @@
-------------------------------------------------------------------
+Wed Feb 1 17:23:39 CET 2012 - jdelvare@suse.de
+
+- backup-files: 32 performance improvements, developed during Suse
+ Hack Week VI (February 2010.) This speeds up backup-files by a
+ factor 50, roughly, bringing it close enough to the original C
+ implementation. Many thanks to Raphael Hertzog for reviewing
+ most of the series.
+
+-------------------------------------------------------------------
Wed Feb 1 17:06:24 CET 2012 - jdelvare@suse.de
- Finally get rid of the old C implementation of backup-files,
diff --git a/quilt/scripts/backup-files.in b/quilt/scripts/backup-files.in
index b0151b5..07557e7 100644
--- a/quilt/scripts/backup-files.in
+++ b/quilt/scripts/backup-files.in
@@ -67,6 +67,17 @@ ensure_nolinks() {
fi
}
+notify_action()
+{
+ [ $ECHO != : ] || return 0
+ local action=$1 filename=$2
+
+ while read -d $'\0' -r
+ do
+ $ECHO "$action ${REPLY#./}"
+ done < "$filename"
+}
+
backup() {
local file=$1
local backup=$OPT_PREFIX$file
@@ -140,11 +151,7 @@ restore_all()
if [ -s "$EMPTY_FILES" ]; then
xargs -0 rm -f < "$EMPTY_FILES"
-
- while read -d $'\0' -r
- do
- $ECHO "Removing ${REPLY#./}"
- done < "$EMPTY_FILES"
+ notify_action Removing "$EMPTY_FILES"
fi
if [ -s "$NONEMPTY_FILES" ]; then
@@ -157,10 +164,7 @@ restore_all()
xargs -0 cp -l --parents --remove-destination \
--target-directory="$target_dir" \
< "$NONEMPTY_FILES" 2>&4); then
- while read -d $'\0' -r
- do
- $ECHO "Restoring ${REPLY#./}"
- done < "$NONEMPTY_FILES"
+ notify_action Restoring "$NONEMPTY_FILES"
else
(cd "$OPT_PREFIX" && find . -type d -print0) \
| xargs -0 mkdir -p
@@ -243,10 +247,7 @@ copy_many()
if xargs -0 cp -p --parents --target-directory="$OPT_PREFIX" \
< "$NONEMPTY_FILES" 2>&4; then
- while read -d $'\0' -r
- do
- $ECHO "Copying $REPLY"
- done < "$NONEMPTY_FILES"
+ notify_action Copying "$NONEMPTY_FILES"
else
while read -d $'\0' -r
do