From: Rob Browning Date: Sun, 23 Mar 2014 15:39:25 +0000 (-0500) Subject: test-ls.sh: don't check the symlink file size on NetBSD for now. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=af6d11434f38d70551a4842d8e3427193388ae2f;p=packages%2Fb%2Fbup.git 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 --- 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 $?