summaryrefslogtreecommitdiff
path: root/yarns/obnam.sh
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-01-17 10:00:40 +0000
committerLars Wirzenius <liw@liw.fi>2014-01-17 10:00:40 +0000
commit2b72bc8a2174d6c80a86260a47719d1ebf6de8ce (patch)
tree39fd5b1b706e732abb50c1f35a1dc0d7f572d830 /yarns/obnam.sh
parent35c44b70524d0763fb517068a1e00c9ed3418e3e (diff)
downloadobnam-2b72bc8a2174d6c80a86260a47719d1ebf6de8ce.tar.gz
Normalise manifest times in test
Some filesystems don't store sub-second parts of mtime. Bleh.
Diffstat (limited to 'yarns/obnam.sh')
-rw-r--r--yarns/obnam.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/yarns/obnam.sh b/yarns/obnam.sh
index 75258415..f05393b2 100644
--- a/yarns/obnam.sh
+++ b/yarns/obnam.sh
@@ -112,10 +112,18 @@ attempt_exit_was()
}
+# Normalise time fields in a manifest that vary uncontrollably on
+# some filesystems.
+
+normalise_manifest_times()
+{
+ sed '/^Mtime:/s/\.[0-9]* / /' "$@"
+}
+
+
# Create a manifest with summain of a directory.
manifest()
{
- summain -r "$1" --exclude Ino --exclude Dev |
- sed '/^Mtime:/s/\.[0-9]* / /'
+ summain -r "$1" --exclude Ino --exclude Dev | normalise_manifest_times
}