Merge lp:~antmak/duplicity/0.6-par2-fix into lp:duplicity/0.6

Proposed by antmak
Status: Work in progress
Proposed branch: lp:~antmak/duplicity/0.6-par2-fix
Merge into: lp:duplicity/0.6
Diff against target: 69 lines (+15/-4)
3 files modified
duplicity/backends/~par2wrapperbackend.py (+8/-3)
duplicity/commandline.py (+4/-1)
duplicity/globals.py (+3/-0)
To merge this branch: bzr merge lp:~antmak/duplicity/0.6-par2-fix
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+219144@code.launchpad.net

Commit message

Added user defined verbatim options for par2

Description of the change

Useful fix for verbatim par2cmdline options (like as "-t" in par2-tbb version)

To post a comment you must log in.
Revision history for this message
Germar (germar) wrote :

Looks good for me. But you need to add documentation for manpage, too.

Unmerged revisions

983. By antmak

Added user defined verbatim options for par2

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'duplicity/backends/~par2wrapperbackend.py'
2--- duplicity/backends/~par2wrapperbackend.py 2014-05-07 12:51:00 +0000
3+++ duplicity/backends/~par2wrapperbackend.py 2014-05-12 07:33:15 +0000
4@@ -39,6 +39,11 @@
5 self.redundancy = 10
6
7 try:
8+ self.common_options = globals.par2_options + "-q -q"
9+ except AttributeError:
10+ self.common_options = "-q -q"
11+
12+ try:
13 url_string = self.parsed_url.url_string.lstrip('par2+')
14 self.wrapped_backend = backend.get_backend(url_string)
15 except:
16@@ -62,7 +67,7 @@
17 source_symlink.setdata()
18
19 log.Info("Create Par2 recovery files")
20- par2create = 'par2 c -r%d -n1 -q -q %s' % (self.redundancy, source_symlink.get_canonical())
21+ par2create = 'par2 c -r%d -n1 %s %s' % (self.redundancy, self.common_options, source_symlink.get_canonical())
22 out, returncode = run(par2create, -1, True)
23 source_symlink.delete()
24 files_to_transfer = []
25@@ -99,7 +104,7 @@
26 par2file = par2temp.append(remote_filename + '.par2')
27 self.wrapped_backend.get(par2file.get_filename(), par2file)
28
29- par2verify = 'par2 v -q -q %s %s' % (par2file.get_canonical(), local_path_temp.get_canonical())
30+ par2verify = 'par2 v %s %s %s' % (self.common_options, par2file.get_canonical(), local_path_temp.get_canonical())
31 out, returncode = run(par2verify, -1, True)
32
33 if returncode:
34@@ -110,7 +115,7 @@
35 file = par2temp.append(filename)
36 self.wrapped_backend.get(filename, file)
37
38- par2repair = 'par2 r -q -q %s %s' % (par2file.get_canonical(), local_path_temp.get_canonical())
39+ par2repair = 'par2 r %s %s %s' % (self.common_options, par2file.get_canonical(), local_path_temp.get_canonical())
40 out, returncode = run(par2repair, -1, True)
41
42 if returncode:
43
44=== modified file 'duplicity/commandline.py'
45--- duplicity/commandline.py 2014-05-07 12:51:00 +0000
46+++ duplicity/commandline.py 2014-05-12 07:33:15 +0000
47@@ -452,7 +452,10 @@
48 old_fn_deprecation(s)))
49
50 # Level of Redundancy in % for Par2 files
51- parser.add_option("--par2-redundancy", type="int", metavar=_("number"))
52+ parser.add_option("--par2-redundancy", type = "int", metavar = _("number"))
53+
54+ # Verbatim par2 options
55+ parser.add_option("--par2-options", action = "extend", metavar = _("options"))
56
57 # Used to display the progress for the full and incremental backup operations
58 parser.add_option("--progress", action = "store_true")
59
60=== modified file 'duplicity/globals.py'
61--- duplicity/globals.py 2014-05-07 12:51:00 +0000
62+++ duplicity/globals.py 2014-05-12 07:33:15 +0000
63@@ -284,3 +284,6 @@
64
65 # Level of Redundancy in % for Par2 files
66 par2_redundancy = 10
67+
68+# Verbatim par2 other options
69+par2_options = ""

Subscribers

People subscribed via source and target branches

to all changes: