]> git.michaelhowe.org Git - packages/b/bup.git/commitdiff
current-filesystem(): accommodate NetBSD and SunOS.
authorRob Browning <rlb@defaultvalue.org>
Thu, 7 Nov 2013 18:29:37 +0000 (12:29 -0600)
committerRob Browning <rlb@defaultvalue.org>
Thu, 7 Nov 2013 19:00:50 +0000 (13:00 -0600)
Thanks to Thomas Klausner <tk@giga.or.at> for reporting the problem,
and providing the alternate commands.

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

index c0a62783878c35523d6d2ac3ce424bf154206373..0ff33a57d5bee50ccae9f0a2c042a7fc37b59fd9 100644 (file)
--- a/t/lib.sh
+++ b/t/lib.sh
@@ -38,7 +38,17 @@ realpath()
 
 current-filesystem()
 {
-    df -T . | awk 'END{print $2}'
+    local kernel="$(uname -s)" || return $?
+    case "$kernel" in
+        NetBSD)
+            df -G . | sed -En 's/.* ([^ ]*) fstype.*/\1/p'
+            ;;
+        SunOS)
+            df -g . | sed -En 's/.* ([^ ]*) fstype.*/\1/p'
+            ;;
+        *)
+            df -T . | awk 'END{print $2}'
+    esac
 }
 
 path-filesystems()