summaryrefslogtreecommitdiffstats
path: root/quilt
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2012-02-01 18:08:49 +0100
committerJean Delvare <jdelvare@suse.de>2012-02-01 18:08:49 +0100
commitbbb8a93ad8b39ba2e4531abfc85c3f38a91865af (patch)
tree8d1c31e11b8148bf6fe790b06077dd2dc7c0d2fe /quilt
parent05747e24033d872cdef4db2ca0bdfdd72749329a (diff)
downloadquilt-bbb8a93ad8b39ba2e4531abfc85c3f38a91865af.tar.gz
backup-files: Simplify find loop
Let find report errors by itself. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
Diffstat (limited to 'quilt')
-rw-r--r--quilt/scripts/backup-files.in18
1 files changed, 6 insertions, 12 deletions
diff --git a/quilt/scripts/backup-files.in b/quilt/scripts/backup-files.in
index 00c8f96..72edf8a 100644
--- a/quilt/scripts/backup-files.in
+++ b/quilt/scripts/backup-files.in
@@ -193,21 +193,15 @@ while [ $I -lt ${#FILELIST[@]} ]; do
case "${FILELIST[$I]}" in
-)
- find "$OPT_PREFIX" -mindepth 1 \( -type f -o -type d \) -print 2>/dev/null \
+ # No backup directory? We're done
+ [ -d "$OPT_PREFIX" ] || exit 0
+
+ find "$OPT_PREFIX" -type f -print \
| while read
do
- if [ -d "$REPLY" ]
- then
- if ! [ -r "$REPLY" ] || ! [ -x "$REPLY" ]
- then
- echo "$REPLY: Permission denied"
- exit 1
- fi
- else
- process_file "${REPLY#$OPT_PREFIX}"
- fi
+ process_file "${REPLY#$OPT_PREFIX}"
done
- if [ $? != 0 ]; then
+ if [ ${PIPESTATUS[0]} != 0 ]; then
exit 1
fi
;;