summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--quilt/scripts/backup-files.in13
1 files changed, 10 insertions, 3 deletions
diff --git a/quilt/scripts/backup-files.in b/quilt/scripts/backup-files.in
index 5f01846..4e59de5 100644
--- a/quilt/scripts/backup-files.in
+++ b/quilt/scripts/backup-files.in
@@ -151,18 +151,17 @@ remove()
rmdir -p "${backup%/*}" 2> /dev/null || true
}
-noop()
+noop_nolinks()
{
local file=$1
- if [ -e "$file" ] && [ -n "$OPT_NOLINKS" ]; then
+ if [ -e "$file" ]; then
ensure_nolinks "$file"
fi
}
ECHO=echo
-OPT_WHAT=noop
while [ $# -gt 0 ]; do
case $1 in
-b) OPT_WHAT=backup
@@ -205,6 +204,14 @@ if [ "${OPT_PREFIX:(-1)}" != / ]; then
exit 1
fi
+if [ -z "$OPT_WHAT" ]; then
+ if [ -n "$OPT_NOLINKS" ]; then
+ OPT_WHAT=noop_nolinks
+ else
+ exit 0
+ fi
+fi
+
if [ -n "$OPT_FILE" ]; then
cat "$OPT_FILE" \
| while read nextfile; do