Merge lp:~mvo/click/stronger-hashes into lp:click/devel

Proposed by Michael Vogt
Status: Work in progress
Proposed branch: lp:~mvo/click/stronger-hashes
Merge into: lp:click/devel
Diff against target: 53 lines (+21/-11)
2 files modified
click/build.py (+15/-11)
click/tests/test_build.py (+6/-0)
To merge this branch: bzr merge lp:~mvo/click/stronger-hashes
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
click hackers Pending
Review via email: mp+219714@code.launchpad.net

This proposal supersedes a proposal from 2014-05-12.

Description of the change

This branch adds support for strong hashes in DEBIAN/ to fix bug #1214485.

Its a bit of a drive-by/get-feedback MP right now to ask about the final location of the filename with the stronger hashes. I currently just used DEBIAN/sha512sums. But I'm happy to change that to e.g. to DEBIAN/hashes/sha512 for example.

Thanks for your feedback,
 Michael

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:423
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mvo/click/stronger-hashes/+merge/219714/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/click-devel-ci/3/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/click-devel-utopic-amd64-ci/3
    SUCCESS: http://jenkins.qa.ubuntu.com/job/click-devel-utopic-armhf-ci/3
        deb: http://jenkins.qa.ubuntu.com/job/click-devel-utopic-armhf-ci/3/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/click-devel-utopic-i386-ci/3

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/click-devel-ci/3/rebuild

review: Needs Fixing (continuous-integration)

Unmerged revisions

423. By Michael Vogt

add support for strong hashes (LP: #1214485)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'click/build.py'
--- click/build.py 2014-05-05 13:10:19 +0000
+++ click/build.py 2014-05-15 15:19:27 +0000
@@ -270,17 +270,21 @@
270 os.unlink(full_manifest_path)270 os.unlink(full_manifest_path)
271 os.chmod(real_manifest_path, 0o644)271 os.chmod(real_manifest_path, 0o644)
272272
273 md5sums_path = os.path.join(control_dir, "md5sums")273 def _make_hashes(name, hash_class):
274 with open(md5sums_path, "w") as md5sums:274 hashes_path = os.path.join(control_dir, name)
275 for path in sorted(self.list_files(root_path)):275 with open(hashes_path, "w") as hashsums:
276 md5 = hashlib.md5()276 for path in sorted(self.list_files(root_path)):
277 with open(os.path.join(root_path, path), "rb") as f:277 hash = hash_class()
278 while True:278 with open(os.path.join(root_path, path), "rb") as f:
279 buf = f.read(16384)279 while True:
280 if not buf:280 buf = f.read(16384)
281 break281 if not buf:
282 md5.update(buf)282 break
283 print("%s %s" % (md5.hexdigest(), path), file=md5sums)283 hash.update(buf)
284 print("%s %s" % (
285 hash.hexdigest(), path), file=hashsums)
286 _make_hashes("md5sums", hashlib.md5)
287 _make_hashes("sha512sums", hashlib.sha512)
284288
285 preinst_path = os.path.join(control_dir, "preinst")289 preinst_path = os.path.join(control_dir, "preinst")
286 with open(preinst_path, "w") as preinst:290 with open(preinst_path, "w") as preinst:
287291
=== modified file 'click/tests/test_build.py'
--- click/tests/test_build.py 2014-05-05 13:10:19 +0000
+++ click/tests/test_build.py 2014-05-15 15:19:27 +0000
@@ -173,6 +173,12 @@
173 r"eb774c3ead632b397d6450d1df25e001 bin/foo\n"173 r"eb774c3ead632b397d6450d1df25e001 bin/foo\n"
174 r"49327ce6306df8a87522456b14a179e0 toplevel\n"174 r"49327ce6306df8a87522456b14a179e0 toplevel\n"
175 r"$")175 r"$")
176 with open(os.path.join(control_path, "sha512sums")) as sha512sums:
177 self.assertEqual(
178 sha512sums.read(),dedent("""be5e74b12a237d6ffb280cfda698113c66d0d2d1262e1dc28696940533f04e923156c27b12cff869d153bd5e81c6ec117c1b6d0e7f0b530daaa22beeac48b63b bin/bar
179be5e74b12a237d6ffb280cfda698113c66d0d2d1262e1dc28696940533f04e923156c27b12cff869d153bd5e81c6ec117c1b6d0e7f0b530daaa22beeac48b63b bin/foo
18035f845eec71da8904c3a3e62b4ede16e8f3b3cfdfdd6374f7842cff0385f8dfc52b4b04c76532aee24dd881f4164cf34cc11a24b6031589502e0284993c686c4 toplevel
181 """))
176 with open(os.path.join(control_path, "preinst")) as preinst:182 with open(os.path.join(control_path, "preinst")) as preinst:
177 self.assertEqual(static_preinst, preinst.read())183 self.assertEqual(static_preinst, preinst.read())
178 contents = subprocess.check_output(184 contents = subprocess.check_output(

Subscribers

People subscribed via source and target branches

to all changes: