Merge lp:~ed.so/duplicity/numowner+hashverbose into lp:duplicity/0.6

Proposed by edso
Status: Merged
Merged at revision: 775
Proposed branch: lp:~ed.so/duplicity/numowner+hashverbose
Merge into: lp:duplicity/0.6
Diff against target: 131 lines (+43/-9)
6 files modified
Changelog.GNU (+6/-0)
duplicity-bin (+15/-8)
duplicity.1 (+7/-0)
duplicity/commandline.py (+3/-0)
duplicity/globals.py (+3/-0)
duplicity/path.py (+9/-1)
To merge this branch: bzr merge lp:~ed.so/duplicity/numowner+hashverbose
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+72087@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Changelog.GNU'
--- Changelog.GNU 2011-07-16 18:37:47 +0000
+++ Changelog.GNU 2011-08-18 18:35:24 +0000
@@ -1,3 +1,9 @@
12011-08-18 Ede <edgar.soldin AT web.de>
2 - introduce --numeric-owner parameter
3 patch courtesy of Lukas Anzinger <l.anzinger AT gmail.com>
4 - duplicity:restore_check_hash
5 "Invalid data - *** hash mismatch" error now tells the offending filename
6
12011-07-16 Ede <edgar.soldin AT web.de>72011-07-16 Ede <edgar.soldin AT web.de>
2 branch encrypt-sign-key:8 branch encrypt-sign-key:
3 - introduce --encrypt-sign-key parameter9 - introduce --encrypt-sign-key parameter
410
=== modified file 'duplicity-bin'
--- duplicity-bin 2011-07-29 21:13:16 +0000
+++ duplicity-bin 2011-08-18 18:35:24 +0000
@@ -636,7 +636,16 @@
636 parseresults = file_naming.parse(filename)636 parseresults = file_naming.parse(filename)
637 tdp = dup_temp.new_tempduppath(parseresults)637 tdp = dup_temp.new_tempduppath(parseresults)
638 backend.get(filename, tdp)638 backend.get(filename, tdp)
639 restore_check_hash(volume_info, tdp)639
640 """ verify hash of the remote file """
641 verified, hash_pair, calculated_hash = restore_check_hash(volume_info, tdp)
642 if not verified:
643 log.FatalError("%s\n %s\n %s\n %s\n" %
644 (_("Invalid data - %s hash mismatch for file:") % hash_pair[0],
645 filename,
646 _("Calculated hash: %s") % calculated_hash,
647 _("Manifest hash: %s") % hash_pair[1]),
648 log.ErrorCode.mismatched_hash)
640649
641 fileobj = tdp.filtered_open_with_delete("rb")650 fileobj = tdp.filtered_open_with_delete("rb")
642 if parseresults.encrypted and globals.gpg_profile.sign_key:651 if parseresults.encrypted and globals.gpg_profile.sign_key:
@@ -648,18 +657,16 @@
648 """657 """
649 Check the hash of vol_path path against data in volume_info658 Check the hash of vol_path path against data in volume_info
650659
651 @rtype: void660 @rtype: boolean
652 @return: void661 @return: true (verified) / false (failed)
653 """662 """
654 hash_pair = volume_info.get_best_hash()663 hash_pair = volume_info.get_best_hash()
655 if hash_pair:664 if hash_pair:
656 calculated_hash = gpg.get_hash(hash_pair[0], vol_path)665 calculated_hash = gpg.get_hash(hash_pair[0], vol_path)
657 if calculated_hash != hash_pair[1]:666 if calculated_hash != hash_pair[1]:
658 log.FatalError("%s\n%s\n%s\n" %667 return False, hash_pair, calculated_hash
659 (_("Invalid data - %s hash mismatch:") % hash_pair[0],668 """ reached here, verification passed """
660 _("Calculated hash: %s") % calculated_hash,669 return True
661 _("Manifest hash: %s") % hash_pair[1]),
662 log.ErrorCode.mismatched_hash)
663670
664671
665def restore_add_sig_check(fileobj):672def restore_add_sig_check(fileobj):
666673
=== modified file 'duplicity.1'
--- duplicity.1 2011-08-06 15:57:54 +0000
+++ duplicity.1 2011-08-18 18:35:24 +0000
@@ -537,6 +537,13 @@
537the directory statistics file.537the directory statistics file.
538538
539.TP539.TP
540.B --numeric-owner
541On restore always use the numeric uid/gid from the archive and not the
542archived user/group names, which is the default behaviour.
543Recommended for restoring from live cds which might have the users with
544identical names but different uids/gids.
545
546.TP
540.BI "--num-retries " number547.BI "--num-retries " number
541Number of retries to make on errors before giving up.548Number of retries to make on errors before giving up.
542549
543550
=== modified file 'duplicity/commandline.py'
--- duplicity/commandline.py 2011-08-06 15:57:54 +0000
+++ duplicity/commandline.py 2011-08-18 18:35:24 +0000
@@ -378,6 +378,9 @@
378 # --num-retries <number>378 # --num-retries <number>
379 parser.add_option("--num-retries", type="int", metavar=_("number"))379 parser.add_option("--num-retries", type="int", metavar=_("number"))
380380
381 # File owner uid keeps number from tar file. Like same option in GNU tar.
382 parser.add_option("--numeric-owner", action="store_true")
383
381 # Whether the old filename format is in effect.384 # Whether the old filename format is in effect.
382 parser.add_option("--old-filenames", action="callback",385 parser.add_option("--old-filenames", action="callback",
383 dest="old_filenames",386 dest="old_filenames",
384387
=== modified file 'duplicity/globals.py'
--- duplicity/globals.py 2011-03-29 17:00:36 +0000
+++ duplicity/globals.py 2011-08-18 18:35:24 +0000
@@ -156,6 +156,9 @@
156# support european for now).156# support european for now).
157s3_european_buckets = False157s3_european_buckets = False
158158
159# File owner uid keeps number from tar file. Like same option in GNU tar.
160numeric_owner = False
161
159# Whether to use plain HTTP (without SSL) to send data to S3162# Whether to use plain HTTP (without SSL) to send data to S3
160# See <https://bugs.launchpad.net/duplicity/+bug/433970>.163# See <https://bugs.launchpad.net/duplicity/+bug/433970>.
161s3_unencrypted_connection = False164s3_unencrypted_connection = False
162165
=== modified file 'duplicity/path.py'
--- duplicity/path.py 2011-07-07 17:12:13 +0000
+++ duplicity/path.py 2011-08-18 18:35:24 +0000
@@ -198,12 +198,20 @@
198 self.mode = tarinfo.mode198 self.mode = tarinfo.mode
199 self.stat = StatResult()199 self.stat = StatResult()
200200
201 # Set user and group id201 """ Set user and group id
202 use numeric id if name lookup fails
203 OR
204 --numeric-owner is set
205 """
202 try:206 try:
207 if globals.numeric_owner:
208 raise KeyError
203 self.stat.st_uid = tarfile.uname2uid(tarinfo.uname)209 self.stat.st_uid = tarfile.uname2uid(tarinfo.uname)
204 except KeyError:210 except KeyError:
205 self.stat.st_uid = tarinfo.uid211 self.stat.st_uid = tarinfo.uid
206 try:212 try:
213 if globals.numeric_owner:
214 raise KeyError
207 self.stat.st_gid = tarfile.gname2gid(tarinfo.gname)215 self.stat.st_gid = tarfile.gname2gid(tarinfo.gname)
208 except KeyError:216 except KeyError:
209 self.stat.st_gid = tarinfo.gid217 self.stat.st_gid = tarinfo.gid

Subscribers

People subscribed via source and target branches

to all changes: