diff options
author | Jean Delvare <jdelvare@suse.de> | 2020-12-09 11:39:56 +0100 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2020-12-09 11:39:56 +0100 |
commit | 26f7bc93d2bbe49a96d23f879b24e82651392497 (patch) | |
tree | 424fb4bff8274817fafae156904f66efea340868 /test/backup-files.test | |
parent | 6363f217b08b07cabbbe09d2d2ddc68596502e38 (diff) | |
download | quilt-26f7bc93d2bbe49a96d23f879b24e82651392497.tar.gz |
backup-files: Restore symbolic links
As "patch" originally did not handle symbolic links, backup-files
didn't have to care about them either. But now that git has
introduced an extended syntax which allows manipulating symbolic
links in patch files, "quilt push" may create or delete symbolic
links, which means that backup-files must support such operations
too.
Also extend the backup-files test case to cover these operations.
This fixes bug #59479:
https://savannah.nongnu.org/bugs/index.php?59479
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Diffstat (limited to 'test/backup-files.test')
-rw-r--r-- | test/backup-files.test | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/backup-files.test b/test/backup-files.test index 8cbfc1c..df27cef 100644 --- a/test/backup-files.test +++ b/test/backup-files.test @@ -229,3 +229,36 @@ Unit test of the backup-files script. > 1 $ [ ! -s new ] || echo "file snapshot/new should be empty" $ rm -rf snapshot + + # Test backup and restoration of a symbolic link + $ mkdir dir + $ ln -s foo dir/link + $ readlink dir/link + > foo + $ %{QUILT_DIR}/scripts/backup-files -B backup/ -b dir/link + > Copying dir/link + $ readlink backup/dir/link + > foo + $ rm -f dir/link + $ echo crap > dir/link + $ %{QUILT_DIR}/scripts/backup-files -B backup/ -r -k dir/link + > Restoring dir/link + $ readlink dir/link + > foo + + # Same but reading from a file + $ rm -f dir/link + $ echo crap > dir/link + $ %{QUILT_DIR}/scripts/backup-files -B backup/ -r -k -f - + < dir/link + > Restoring dir/link + $ readlink dir/link + > foo + + # Same but without specifying the file + $ rm -f dir/link + $ echo crap > dir/link + $ %{QUILT_DIR}/scripts/backup-files -B backup/ -r - + > Restoring dir/link + $ readlink dir/link + > foo |