summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2022-12-06 16:53:51 +0100
committerJean Delvare <jdelvare@suse.de>2022-12-06 16:53:51 +0100
commit0801a6426fed320b94cd77508427a3edac8f7de5 (patch)
tree5e8e17c460c5694fb7f7bb64f6e77f92c8bf4c4e
parentb73e4afa7e4c28a981430c5b80a95254f2ed6b77 (diff)
downloadquilt-0801a6426fed320b94cd77508427a3edac8f7de5.tar.gz
backup-files: Fix hard link creation on Solaris
The ln defaults can be slightly different depending on the platform. While on Linux 'ln' defaults to 'ln -P', on Solaris (and possibly other platforms) it defaults to 'ln -L'. This difference is best resolved by explicitly using the '-P' flag. This fixes bug #63451: https://savannah.nongnu.org/bugs/index.php?63451 Credits to the anonymous reporter. [JD: Propagate the fix to all occurrences of 'ln'.] Signed-off-by: Jean Delvare <jdelvare@suse.de>
-rw-r--r--quilt/fold.in2
-rw-r--r--quilt/scripts/backup-files.in6
2 files changed, 4 insertions, 4 deletions
diff --git a/quilt/fold.in b/quilt/fold.in
index 1f664ca..3a62fcf 100644
--- a/quilt/fold.in
+++ b/quilt/fold.in
@@ -109,7 +109,7 @@ then
if ! [ -e "$backup_file" ]
then
if ! mkdir -p "$(dirname "$backup_file")" ||
- ! ln "$workdir/$file" "$backup_file"
+ ! ln -P "$workdir/$file" "$backup_file"
then
failed=1
break
diff --git a/quilt/scripts/backup-files.in b/quilt/scripts/backup-files.in
index edf2b1f..f2bf380 100644
--- a/quilt/scripts/backup-files.in
+++ b/quilt/scripts/backup-files.in
@@ -94,7 +94,7 @@ backup()
if [ -n "$OPT_NOLINKS" -a "$(stat @STAT_HARDLINK@ "$file")" = 1 ]; then
cp -p "$file" "$backup"
else
- ln "$file" "$backup" 2>&4 || cp -p "$file" "$backup"
+ ln -P "$file" "$backup" 2>&4 || cp -p "$file" "$backup"
if [ -n "$OPT_NOLINKS" ]; then
ensure_nolinks "$file"
fi
@@ -123,7 +123,7 @@ restore()
if [ -L "$backup" ]; then
ln -s "$(readlink "$backup")" "$file"
else
- ln "$backup" "$file" 2>&4 || cp -p "$backup" "$file"
+ ln -P "$backup" "$file" 2>&4 || cp -p "$backup" "$file"
fi
if [ -n "$OPT_TOUCH" -a ! -L "$file" ]; then
@@ -186,7 +186,7 @@ restore_all()
local backup=$OPT_PREFIX$file
$ECHO "Restoring $file"
- ln "$backup" "$file" 2>&4 || cp -p "$backup" "$file"
+ ln -P "$backup" "$file" 2>&4 || cp -p "$backup" "$file"
done < "$NONEMPTY_FILES"
fi