FS#54994 - [devtools] makechrootpkg leaves behind empty directory tree if download of source failed

Attached to Project: Arch Linux
Opened by Erich Eckner (deepthought) - Monday, 31 July 2017, 18:20 GMT
Last edited by Levente Polyak (anthraxx) - Tuesday, 22 January 2019, 01:01 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

If 'makepkg ... --verifysource' inside makechrootpkg's 'download_source()' fails, the temporary directory is not being removed, leaving behind an empty directory tree of the structure 'tmp.XXXXXX/foobar/src' for package foobar.

The attached patch (against git revision 75fdff1811a0487f82c75b2e260da905102b4eea) will get rid of the directories if the said command failed.

It would be nice, if you could include it in the source - otherwise the 32-bit build slaves will be jammed with a lot temporary directories :-)
If you don't want to include it, let me know (and possibly a reason therefore), and I will probably patch it into our fork of the devtools.

Cheers,
deep42thought
This task depends upon

Closed by  Levente Polyak (anthraxx)
Tuesday, 22 January 2019, 01:01 GMT
Reason for closing:  Implemented
Additional comments about closing:  fixed in git 8310abb3485bdf63fc3557e3020a43f9f9e03927
Comment by Erich Eckner (deepthought) - Monday, 31 July 2017, 18:23 GMT
forgot patch (thanks eschwartz)
   patch (0.6 KiB)
Comment by Eli Schwartz (eschwartz) - Monday, 31 July 2017, 18:31 GMT
makechrootpkg should probably just reuse the WORKDIR and trap set up in lib/common.sh (used by crossrepomove and find-libdeps.sh)
Comment by Erich Eckner (deepthought) - Monday, 31 July 2017, 18:38 GMT
another approach: Use the $WORKDIR from lib/common.sh.
Comment by Erich Eckner (deepthought) - Monday, 31 July 2017, 18:39 GMT
crap, forgot patch, again :-/
Comment by Erich Eckner (deepthought) - Monday, 14 August 2017, 13:01 GMT
The above patch introduces a bug, because $WORKDIR is owned by root and not by $makepkg_user.
This has been corrected in the attached patch (which now also is being tested / has been tested in the archlinux32 build system).

sry, I should have done this before :-/

Loading...