Merge lp:~mfisch/sync.links/gpg-error-check into lp:sync.links

Proposed by Matt Fischer
Status: Merged
Merged at revision: 2
Proposed branch: lp:~mfisch/sync.links/gpg-error-check
Merge into: lp:sync.links
Diff against target: 17 lines (+6/-1)
1 file modified
put.py (+6/-1)
To merge this branch: bzr merge lp:~mfisch/sync.links/gpg-error-check
Reviewer Review Type Date Requested Status
Alex Chiang Approve
Review via email: mp+89374@code.launchpad.net

Description of the change

Adds some error checking to the gpg call. This will catch issues when you enter a bad password.

To post a comment you must log in.
Revision history for this message
Alex Chiang (achiang) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'put.py'
--- put.py 2012-01-17 05:47:23 +0000
+++ put.py 2012-01-20 03:05:24 +0000
@@ -51,7 +51,12 @@
51 abspath = os.path.abspath(tmp)51 abspath = os.path.abspath(tmp)
52 os.system("cp '%s' '%s'" % ('/'.join([dotdir_abspath, secure_tgz_gpg]), tmp))52 os.system("cp '%s' '%s'" % ('/'.join([dotdir_abspath, secure_tgz_gpg]), tmp))
53 os.chdir(tmp)53 os.chdir(tmp)
54 os.system("gpg %s" % secure_tgz_gpg)54 status = os.system("gpg %s" % secure_tgz_gpg)
55 retval = ((status >> 8) & 0xFF)
56 if retval != 0 or not os.path.exists(secure_tgz):
57 print "Failed to decrypt secure dotfiles, probably a bad password"
58 sys.exit(1)
59
55 os.system("tar xf %s" % secure_tgz)60 os.system("tar xf %s" % secure_tgz)
56 os.unlink(secure_tgz)61 os.unlink(secure_tgz)
57 os.unlink(secure_tgz_gpg)62 os.unlink(secure_tgz_gpg)

Subscribers

People subscribed via source and target branches

to all changes: