duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Duplicity-talk] [PATCH 2/2] rdiffdir delta: support incremental sigtar


From: Laszlo Ersek
Subject: [Duplicity-talk] [PATCH 2/2] rdiffdir delta: support incremental sigtar files
Date: Mon, 31 Dec 2012 16:35:55 +0100

Launchpad reference:
<https://answers.launchpad.net/duplicity/+question/103229> comment #4.

Signed-off-by: Laszlo Ersek <address@hidden>
---
 bin/rdiffdir   |   10 +++++-----
 bin/rdiffdir.1 |   34 +++++++++++++++++++++++++++++++++-
 2 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/bin/rdiffdir b/bin/rdiffdir
index 17640ca..a686edf 100755
--- a/bin/rdiffdir
+++ b/bin/rdiffdir
@@ -136,7 +136,7 @@ def get_action(args):
     elif command == "tar":
         require_args(2)
     elif command == "delta":
-        require_args(3)
+        require_args(3, False)
     elif command == "patch":
         require_args(2)
     return command, args[1:]
@@ -208,13 +208,13 @@ def main():
     if action == "sig":
         write_sig(file_args[0], get_fileobj(file_args[1], "wb"))
     elif action == "delta":
-        sig_infp = get_fileobj(file_args[0], "rb")
-        delta_outfp = get_fileobj(file_args[2], "wb")
+        sig_infp = map(lambda fname: get_fileobj(fname, "rb"), file_args[0:-2])
+        delta_outfp = get_fileobj(file_args[-1], "wb")
         if sig_fileobj:
-            write_delta_and_sig(file_args[1], sig_infp,
+            write_delta_and_sig(file_args[-2], sig_infp,
                                 delta_outfp, sig_fileobj)
         else:
-            write_delta(file_args[1], sig_infp, delta_outfp)
+            write_delta(file_args[-2], sig_infp, delta_outfp)
     elif action == "patch":
         patch(file_args[0], get_fileobj(file_args[1], "rb"))
     elif action == "tar":
diff --git a/bin/rdiffdir.1 b/bin/rdiffdir.1
index be8f771..49b5998 100644
--- a/bin/rdiffdir.1
+++ b/bin/rdiffdir.1
@@ -10,7 +10,9 @@ rdiffdir \- compute and apply signatures and diffs to 
directories
 .B rdiffdir
 .BI [ options ]
 .B delta
-.I signature_file new_dir delta_file
+.I full_sigtar
+.BI { incr_sigtar }
+.I new_dir delta_file
 
 .B rdiffdir
 .BI [ options ]
@@ -34,6 +36,36 @@ is supposed to be like rdiff, but can operate on 
directories.  See
 .BR rdiff (1)
 for more information.  The syntax is similar.
 
+Regarding the
+.B delta
+command, the
+.I full_sigtar
+operand is a
+.I signature_file
+written by an earlier
+.B signature
+or
+.B tar
+command (the latter using the
+.B --write-sig-to
+option). The optional
+.I incr_sigtar
+operands are signature files written by earlier
+.B delta
+commands using the
+.I --write-sig-to
+option. This way the Nth invocation of the
+.B delta
+command can parse (and extend) the signature chain that has been founded by the
+first
+.B signature
+or
+.B tar
+command with a full signature, and then extended by the subsequent N-1
+.B delta
+invocations with incremental signatures. It is the responsibility of the user
+to specify the sigtar operands in logical increment order.
+
 .SH OPTIONS
 .TP
 .BI "--write-sig-to " sigfile
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]