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!
This commit is contained in:
Mathieu Bridon 2015-05-29 11:59:57 +02:00
parent e570c2f271
commit 2e35fa64a3

View file

@ -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: