From 2e35fa64a30bfa8e0138f36c6905a980e151510e Mon Sep 17 00:00:00 2001 From: Mathieu Bridon Date: Fri, 29 May 2015 11:59:57 +0200 Subject: [PATCH] distgit: Ensure the folder exists We can't hard link the file if the folder containing the link destination does not exist. Hurray for testing in staging! --- roles/distgit/files/dist-git-upload.cgi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/distgit/files/dist-git-upload.cgi b/roles/distgit/files/dist-git-upload.cgi index 38c40dbdfa..bbc44a7365 100644 --- a/roles/distgit/files/dist-git-upload.cgi +++ b/roles/distgit/files/dist-git-upload.cgi @@ -177,8 +177,9 @@ def main(): # Add the file to the old path, where fedpkg is currently looking for it if hash_type == "md5": - old_path = os.path.join(module_dir, filename, checksum, filename) - os.link(dest_file, old_path) + old_dir = os.path.join(module_dir, filename, checksum) + os.makedirs(old_dir) + os.link(dest_file, os.path.join(old_dir, filename)) # Emit a fedmsg message. Load the config to talk to the fedmsg-relay. try: