Skip to content

Commit

Permalink
Avoid Traceback for resultdir ENOSPC
Browse files Browse the repository at this point in the history
Resolves: rhbz#2261758
  • Loading branch information
praiskup committed Feb 19, 2024
1 parent f9398b0 commit 788dddc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mock/py/mockbuild/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,9 +820,12 @@ def get_command(mode, checkdeps=False):
def copy_build_results(self, results):
self.buildroot.root_log.debug("Copying packages to result dir")
ret = []
for item in results:
shutil.copy2(item, self.buildroot.resultdir)
ret.append(os.path.join(self.buildroot.resultdir, os.path.split(item)[1]))
try:
for item in results:
shutil.copy2(item, self.buildroot.resultdir)
ret.append(os.path.join(self.buildroot.resultdir, os.path.split(item)[1]))
except OSError as err:
raise Error(f"Can not copy {item} into resultdir {self.buildroot.resultdir}: {err}") from err
return ret

@traceLog()
Expand Down
3 changes: 3 additions & 0 deletions releng/release-notes-next/rhbz-2254328.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
No more ugly tracebacks for "no space left on device" (and similar
`OSError`s) related to copying built artifacts to `--resultdir`,
[rhbz#2261758][].

0 comments on commit 788dddc

Please sign in to comment.