From 4ce858d7c59374fdbbf8ced1308894c7381dc0e6 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Sat, 3 Oct 2015 12:30:40 +0100 Subject: 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 --- obnamlib/plugins/show_plugin.py | 5 +++++ yarns/0300-kdirstat-integration.yarn | 10 ++++++++++ 2 files changed, 15 insertions(+) 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 ------------------------- -- cgit v1.2.1