From af6d11434f38d70551a4842d8e3427193388ae2f Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Sun, 23 Mar 2014 10:39:25 -0500 Subject: [PATCH] test-ls.sh: don't check the symlink file size on NetBSD for now. NetBSD appears to be returning varying file sizes for symlinks at the moment, so just ignore the size there for now. Thanks to Thomas Klausner for reporting the problem and to him and Greg Troxel for help with the workaround. Signed-off-by: Rob Browning --- t/test-ls.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/t/test-ls.sh b/t/test-ls.sh index c4f4a1a..ec4d22b 100755 --- a/t/test-ls.sh +++ b/t/test-ls.sh @@ -123,14 +123,22 @@ d--------- ?/? 0 1970-01-01 00:00 src/" symlink_mode="$(WVPASS ls -l src/symlink | cut -b -10)" || exit $? -symlink_size="$(WVPASS python -c "import os -print os.lstat('src/symlink').st_size")" || exit $? - -symlink_date="$(WVPASS bup ls -l src/latest"$tmpdir"/src | grep symlink)" || exit $? -symlink_date="$(WVPASS echo "$symlink_date" \ +symlink_bup_info="$(WVPASS bup ls -l src/latest"$tmpdir"/src | grep symlink)" \ + || exit $? +symlink_date="$(WVPASS echo "$symlink_bup_info" \ | WVPASS perl -ne 'm/.*? (\d+) (\d\d\d\d-\d\d-\d\d \d\d:\d\d)/ and print $2')" \ || exit $? +if test "$(uname -s)" != NetBSD; then + symlink_size="$(WVPASS python -c "import os +print os.lstat('src/symlink').st_size")" || exit $? +else + # NetBSD appears to return varying sizes, so for now, just ignore it. + symlink_size="$(WVPASS echo "$symlink_bup_info" \ + | WVPASS perl -ne 'm/.*? (\d+) (\d\d\d\d-\d\d-\d\d \d\d:\d\d)/ and print $1')" \ + || exit $? +fi + uid="$(id -u)" || exit $? gid="$(python -c 'import os; print os.stat("src").st_gid')" || exit $? user="$(id -un)" || exit $? -- 2.39.5