diff options
author | Ian Campbell <ijc@hellion.org.uk> | 2014-12-07 15:22:27 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2014-12-08 20:53:31 +0200 |
commit | 44a578639ca864413bfb986e0c59cda9e567f743 (patch) | |
tree | 2f7000bf74b827ce7955bba681ff7d5ad384c6df /obnamlib/plugins/show_plugin.py | |
parent | d373c7f1bf17fc74b97d90605e0739d57aa777b8 (diff) | |
download | obnam-44a578639ca864413bfb986e0c59cda9e567f743.tar.gz |
Implement support for listing a generation in kdirstat.cache format
On Sat, 2014-12-06 at 19:15 +0200, Lars Wirzenius wrote:
> On Sun, Nov 16, 2014 at 11:24:11AM +0000, Ian Campbell wrote:
> > This implements an ls variant whose output format is compatible with the
> > kdirstat cache format. The best reference I can find for this is from an old fork:
> > https://github.com/thomas-joiner/k4dirstat/blob/master/kdirstat/cache-file-format.txt
> >
> > Recent versions of k4dirstat appear to be able to read the files produced just
> > fine, although this document is not present in their source AFAICT.
> >
> > I find k4dirstat to be an excellent way to visualise what is included in a
> > backup, e.g. for the purposes of excluding file types or marking directories
> > with a CACHEDIR.TAG. My previous solution involved post-processing the output
> > of ls which require a ssh to the machine with the files (for stat() purposes).
> > This approach pulls all of the data out of the obnam repo, so is much faster,
> > less hacky and gets the status of the actual generation and not the current
> > files etc.
>
> Thank you, Ian. I've applied the patch and pushed the changes to
> master on git.liw.fi.
Thanks.
> It would be nice if someone wrote a test case for this (in yarn form),
> so that I'll notice when I break it.
Your wish etc etc... (it even found a bug!)
8<----------------
>From 8f1aecfee8ec34e5d060f81ee47f9fd8aacdc201 Mon Sep 17 00:00:00 2001
From: Ian Campbell <ijc@hellion.org.uk>
Date: Sun, 7 Dec 2014 15:19:57 +0000
Subject: [PATCH] Add a yarn for testing kdirstat cachefile generation.
Rather simplistic, but caught one bug (unwanted newline at start of file) which
is also fixed here.
Diffstat (limited to 'obnamlib/plugins/show_plugin.py')
-rw-r--r-- | obnamlib/plugins/show_plugin.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/obnamlib/plugins/show_plugin.py b/obnamlib/plugins/show_plugin.py index 9114f309..5e28fed2 100644 --- a/obnamlib/plugins/show_plugin.py +++ b/obnamlib/plugins/show_plugin.py @@ -264,8 +264,7 @@ class ShowPlugin(obnamlib.ObnamPlugin): self.traverse(self.show_hdr_kdirstat, self.show_item_kdirstat, args) def show_hdr_kdirstat(self, comment): - self.app.output.write(''' -[kdirstat 4.0 cache file] + self.app.output.write('''[kdirstat 4.0 cache file] # Generated by obnam %s # Do not edit! # |