Merge lp:~mterry/duplicity/fix-gpg-options-crash-0.6 into lp:duplicity/0.6

Proposed by Michael Terry
Status: Merged
Merged at revision: not available
Proposed branch: lp:~mterry/duplicity/fix-gpg-options-crash-0.6
Merge into: lp:duplicity/0.6
Diff against target: 45 lines (+8/-3)
3 files modified
duplicity-bin (+4/-1)
duplicity/commandline.py (+3/-1)
duplicity/dup_time.py (+1/-1)
To merge this branch: bzr merge lp:~mterry/duplicity/fix-gpg-options-crash-0.6
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+20381@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

This fixes the recently reported bug on the mailing list where duplicity crashes when given an empty argument to --gpg-options. My bad.

644. By Michael Terry

and handle initial, empty value for extend commandline actions

645. By Michael Terry

fix time command line handling

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'duplicity-bin'
2--- duplicity-bin 2010-02-17 18:00:45 +0000
3+++ duplicity-bin 2010-03-02 01:43:12 +0000
4@@ -1111,10 +1111,13 @@
5 os.setuid(os.geteuid())
6 os.setgid(os.getegid())
7
8+ # set the current time strings (make it available for command line processing)
9+ dup_time.setcurtime()
10+
11 # determine what action we're performing and process command line
12 action = commandline.ProcessCommandLine(sys.argv[1:])
13
14- # set the current time strings
15+ # set the current time strings again now that we have time separator
16 dup_time.setcurtime()
17
18 # get the passphrase if we need to based on action/options
19
20=== modified file 'duplicity/commandline.py'
21--- duplicity/commandline.py 2009-12-28 16:03:09 +0000
22+++ duplicity/commandline.py 2010-03-02 01:43:12 +0000
23@@ -158,7 +158,9 @@
24
25 def take_action(self, action, dest, opt, value, values, parser):
26 if action == "extend":
27- if hasattr(values, dest):
28+ if not value:
29+ return
30+ if hasattr(values, dest) and getattr(values, dest):
31 setattr(values, dest, getattr(values, dest) + ' ' + value)
32 else:
33 setattr(values, dest, value)
34
35=== modified file 'duplicity/dup_time.py'
36--- duplicity/dup_time.py 2009-04-02 14:47:12 +0000
37+++ duplicity/dup_time.py 2010-03-02 01:43:12 +0000
38@@ -63,7 +63,7 @@
39 def setcurtime(time_in_secs = None):
40 """Sets the current time in curtime and curtimestr"""
41 global curtime, curtimestr
42- t = time_in_secs or long(time.time())
43+ t = time_in_secs or curtime or long(time.time()) # only set from NOW once
44 assert type(t) in (types.LongType, types.IntType)
45 curtime, curtimestr = t, timetostring(t)
46

Subscribers

People subscribed via source and target branches

to all changes: