summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Campbell <ijc@hellion.org.uk>2015-10-03 12:30:40 +0100
committerLars Wirzenius <liw@liw.fi>2015-10-11 14:35:03 +0300
commit4ce858d7c59374fdbbf8ced1308894c7381dc0e6 (patch)
tree8a14ba969014d36bd73ffbe4e73f6e8f217f779f
parent513f55e23e2479f2b37cba54cfb59a39a98fdac3 (diff)
downloadobnam-4ce858d7c59374fdbbf8ced1308894c7381dc0e6.tar.gz
kdirstat: Handled named pipes (fifos)
For some reason this was missing from the mode_str lookup, it is the only type listed on https://github.com/thomas-joiner/k4dirstat/blob/master/kdirstat/cache-file-format.txt which wasn't handled. For unknown file types emit a commented "#UNHANDLED ..." line rather than crashing with a backtrace. Add a yarn for this scenario, although I've not been able to run it due to "ASSUMING extended attributes are allowed for users". Real world use has been tested by Florian Geyer, http://listmaster.pepperfish.net/pipermail/obnam-support-obnam.org/2015-September/003836.html Cc: Florian Geyer <blueice@fobos.de>
-rw-r--r--obnamlib/plugins/show_plugin.py5
-rw-r--r--yarns/0300-kdirstat-integration.yarn10
2 files changed, 15 insertions, 0 deletions
diff --git a/obnamlib/plugins/show_plugin.py b/obnamlib/plugins/show_plugin.py
index 2e942f03..4b97ea82 100644
--- a/obnamlib/plugins/show_plugin.py
+++ b/obnamlib/plugins/show_plugin.py
@@ -287,8 +287,13 @@ class ShowPlugin(obnamlib.ObnamPlugin):
mode_str = "BlockDev\t"
elif stat.S_ISCHR(mode):
mode_str = "CharDev\t"
+ elif stat.S_ISFIFO(mode):
+ mode_str = "FIFO"
elif stat.S_ISSOCK(mode):
mode_str = "Socket\t"
+ else:
+ # Unhandled, make it look like a comment
+ mode_str = "#UNHANDLED\t"
enc_filename = filename.replace("%", "%25")
enc_filename = enc_filename.replace(" ", "%20")
diff --git a/yarns/0300-kdirstat-integration.yarn b/yarns/0300-kdirstat-integration.yarn
index a2ff8e69..695994fe 100644
--- a/yarns/0300-kdirstat-integration.yarn
+++ b/yarns/0300-kdirstat-integration.yarn
@@ -17,6 +17,16 @@ file.
THEN first line of C matches [kdirstat 4.0 cache file]
AND for each file in directory L a line in the kdircache C matches it
+Now a backup containing some interesting objects
+
+ SCENARIO create and do a check of a kdirstat cache of interesting objects
+ ASSUMING extended attributes are allowed for users
+ GIVEN directory L with interesting filesystem objects
+ WHEN user U backs up directory L to repository R
+ AND user U creates a kdirstat cache file C of repository R
+ THEN first line of C matches [kdirstat 4.0 cache file]
+ AND for each file in directory L a line in the kdircache C matches it
+
Validating the cache file
-------------------------