diff options
-rw-r--r-- | quilt.changes | 7 | ||||
-rw-r--r-- | quilt/scripts/backup-files.in | 27 |
2 files changed, 10 insertions, 24 deletions
diff --git a/quilt.changes b/quilt.changes index 4cc73cc..0b0b92f 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Feb 1 17:02:32 CET 2012 - jdelvare@suse.de + +- backup-files: Avoid relying on GNU-specific extensions of stat, + cp and rmdir. Otherwise it fails on BSD systems and probably + others. + +------------------------------------------------------------------- Wed Feb 1 16:58:22 CET 2012 - mquinson@debian.org - Make backup-files a shell script. This makes it possible to diff --git a/quilt/scripts/backup-files.in b/quilt/scripts/backup-files.in index 086d178..fcfc995 100644 --- a/quilt/scripts/backup-files.in +++ b/quilt/scripts/backup-files.in @@ -117,14 +117,7 @@ process_file() { $ECHO "Removing $file" if [ -z "$OPT_KEEP_BACKUP" ]; then rm "$backup" - while [ -d "${backup%/*}" ] && ! [ -L "${backup%/*}" ] - do - backup="${backup%/*}" - rmdir --ignore-fail-on-non-empty "$backup" 2>/dev/null - if [ -d "$backup" ]; then - break - fi - done + rmdir -p "${backup%/*}" 2> /dev/null || true fi else $ECHO "Restoring $file" @@ -142,14 +135,7 @@ process_file() { if [ -z "$OPT_KEEP_BACKUP" ]; then rm "$backup" - while [ -d "${backup%/*}" ] && ! [ -L "${backup%/*}" ] - do - backup="${backup%/*}" - rmdir --ignore-fail-on-non-empty "$backup" 2>/dev/null - if [ -d "$backup" ]; then - break - fi - done + rmdir -p "${backup%/*}" 2> /dev/null || true fi if [ -n "$OPT_TOUCH" ]; then touch "$file" @@ -159,14 +145,7 @@ process_file() { if [ -e "$backup" ]; then rm "$backup" fi - while [ -d "${backup%/*}" ] && ! [ -L "${backup%/*}" ] - do - backup="${backup%/*}" - rmdir --ignore-fail-on-non-empty "$backup" 2>/dev/null - if [ -d "$backup" ]; then - break - fi - done + rmdir -p "${backup%/*}" 2> /dev/null || true elif [ -z "$OPT_WHAT" ]; then if [ -e "$file" ] && [ -n "$OPT_NOLINKS" ]; then ensure_nolinks "$file" |