]> arthur.barton.de Git - bup.git/commitdiff
test-ls.sh: don't check the symlink file size on NetBSD for now.
authorRob Browning <rlb@defaultvalue.org>
Sun, 23 Mar 2014 15:39:25 +0000 (10:39 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 23 Mar 2014 15:39:25 +0000 (10:39 -0500)
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 <tk@giga.or.at> for reporting the problem
and to him and Greg Troxel <gdt@ir.bbn.com> for help with the
workaround.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
t/test-ls.sh

index c4f4a1a624d482e20d55208b0433d351fe4eac5f..ec4d22b36a89d26e44db196347bd9bb55d8ab81f 100755 (executable)
@@ -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 $?