From 1b2337558f02131e63a8fd44aa3a098c39df8aed Mon Sep 17 00:00:00 2001 From: Mathieu Bridon Date: Tue, 28 Oct 2014 10:47:39 +0100 Subject: [PATCH] lookaside: Add the hash type to the folder structure This makes it more explicit which hash was used for a given tarball. https://fedorahosted.org/rel-eng/ticket/5846 --- roles/distgit/files/dist-git-upload.cgi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/distgit/files/dist-git-upload.cgi b/roles/distgit/files/dist-git-upload.cgi index 0fcf821e39..6610d8f305 100644 --- a/roles/distgit/files/dist-git-upload.cgi +++ b/roles/distgit/files/dist-git-upload.cgi @@ -148,7 +148,11 @@ def main(): print >> sys.stderr, '[username=%s] Processing upload request: NAME=%s FILENAME=%s %sSUM=%s' % (username, name, filename, hash_type.upper(), checksum) module_dir = os.path.join(CACHE_DIR, name) - hash_dir = os.path.join(module_dir, filename, checksum) + hash_dir = os.path.join(module_dir, filename, hash_type, checksum) + + if hash_type == "md5": + # Preserve compatibility with the current folder hierarchy for md5 + hash_dir = os.path.join(module_dir, filename, checksum) # first test if the module really exists git_dir = os.path.join(GITREPO, '%s.git' % name)