diff options
author | Jean Delvare <jdelvare@suse.de> | 2012-02-01 18:08:49 +0100 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2012-02-01 18:08:49 +0100 |
commit | c954eb0f9f52967a9d3abd7aa260108765347162 (patch) | |
tree | 3448e028fb58dc0d44b3444624d7a2cd8166e1dc /test | |
parent | 4aeec070f74344edcaaf5efb72f39749bd812961 (diff) | |
download | quilt-c954eb0f9f52967a9d3abd7aa260108765347162.tar.gz |
backup-files: New function for copy
We are abusing backup-files's "backup" function for quilt snapshot.
What we need is semantically different, and it works almost by
accident. We don't want linked copies of the files, we want real
copies, and the fact that "quilt snapshot" may touch the working
files is a little frightening IMHO.
So, implement a separate "copy" function which does what we need. Not
only it does the right thing, but it will also be somewhat faster
than "backup", as we can do straight copies of the files without
checking for their link count first.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Raphael Hertzog <hertzog@debian.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/backup-files.test | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/backup-files.test b/test/backup-files.test index b57374e..405341d 100644 --- a/test/backup-files.test +++ b/test/backup-files.test @@ -200,3 +200,32 @@ Unit test of the backup-files script. > Removing new > Restoring foo > Restoring space bar + $ rm "linked space" + + # Test copy (as used by quilt snapshot) + $ %{QUILT_DIR}/scripts/backup-files -B snapshot/ -c -f - + < new + < foo + < space bar + < dir with spaces/space file + > New file new + > Copying foo + > Copying space bar + > Copying dir with spaces/space file + $ ls -l foo | awk '{ print $2 }' + > 2 + $ ls -l "space bar" | awk '{ print $2 }' + > 1 + $ ls -l "dir with spaces/space file" | awk '{ print $2 }' + > 1 + $ [ ! -e new ] || echo "file new shouldn't exist" + $ ls -l snapshot/new | awk '{ print $2 }' + > 1 + $ ls -l snapshot/foo | awk '{ print $2 }' + > 1 + $ ls -l snapshot/"space bar" | awk '{ print $2 }' + > 1 + $ ls -l snapshot/"dir with spaces/space file" | awk '{ print $2 }' + > 1 + $ [ ! -s new ] || echo "file snapshot/new should be empty" + $ rm -rf snapshot |