On 17/09/2016 17:51, Achim Gratz wrote:
From 3fa17efb7049f7cc20c119c0a696e4f4212dd6bc Mon Sep 17 00:00:00 2001
From: Achim Gratz <achim.gratz-gl6zormxvad+tktra80...@public.gmane.org>
Date: Sat, 17 Sep 2016 18:49:19 +0200
Subject: [PATCH 2/2] Write human-readable time in addition to machine-readable

* calm/package.py (write_setup_ini): In addition to the epoch
  timestamp write that time (as a comment) in human-readable form so
  that it can be more easily deciphered.

This is a good idea.  Applied, with updated tests.  Thanks.

From f35d1d01e83b6e319b249f736b69eb4e4e677d6d Mon Sep 17 00:00:00 2001
From: Achim Gratz <achim.gratz-gl6zormxvad+tktra80...@public.gmane.org>
Date: Sat, 17 Sep 2016 18:47:44 +0200
Subject: [PATCH 1/2] Use Base64URL encoding for the checksums

* calm/package.py (sha512_file): Import base64 and use Base64URL
  encoding for the checksums for higher coding efficiency and shorter
  setup files.
-    return sha512.hexdigest()
+    return base64.urlsafe_b64encode(sha512.digest())[:86].decode()

I'm not so sure about this.

Firstly, this doesn't do what's wanted (always use Base64 encoded hashes), as the hash is only computed here if it's not available from a sha512.sum file (which mirror maintenance scripts on sourceware generate for us)

So, I guess the correct change would be to re-encode the sha512 hashes from hex to base64 somewhere.

I'm not sure I really see the value in that, though. It would reduce the length of the hashes from 86 to 128 characters, so setup.ini gets somewhat less that 33% smaller, but I'm sceptical that the size of the compressed setup.ini file changes much.

Reply via email to