Skip to content

Commit

Permalink
core.get_binary_file(): create target directory if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
dmach committed Mar 21, 2022
1 parent b83aee1 commit fe2931e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions osc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4747,6 +4747,15 @@ def get_binary_file(apiurl, prj, repo, arch,

target_filename = target_filename or filename

# create target directory if it doesn't exist
target_dir = os.path.dirname(target_filename)
if target_dir:
try:
os.makedirs(target_dir, 0o755)
except OSError as e:
if e.errno != errno.EEXIST:
raise

where = package or '_repository'
u = makeurl(apiurl, ['build', prj, repo, arch, where, filename])
download(u, target_filename, progress_obj, target_mtime)
Expand Down

0 comments on commit fe2931e

Please sign in to comment.