Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#13417 - makepkg -ic does not clean build files when package install failed

Attached to Project: Pacman
Opened by Val L. (onestep_ua) - Sunday, 22 February 2009, 11:10 GMT
Last edited by Allan McRae (Allan) - Sunday, 12 April 2009, 03:12 GMT
Task Type Bug Report
Category makepkg
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version 3.2.2
Due in Version 3.3.0
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Summary and Info:
when makepkg is ran with -ic switches, and the installation of built package failed, it leaves pkg and src directories on the disk. I think this is not good, because we have build process finished good, and met the problem with the package manager itself. I did not make a patch, because it will probably require to rewrite a big part of code. :) But the simple solution that comes to my mind is to remove the `$EXIT_CODE -eq 0` check from the clean_up function, since I don't need build files on my disk if I explicitly gave an -c option.

Steps to Reproduce:
1. run pacman -Syu and don't confirm anything
2. run makepkg -ic for some PKGBUILD

Example:
[onestep@onestep-box xcb-proto]$ makepkg -ic
==> Making package: xcb-proto 1.4-1 x86_64 (Sun Feb 22 13:08:18 EET 2009)
...
==> Finished making: xcb-proto 1.4-1 x86_64 (Sun Feb 22 13:08:25 EET 2009)
==> Installing package xcb-proto with pacman -U...
error: failed to init transaction (unable to lock database)
if you're sure a package manager is not already
running, you can remove /var/lib/pacman/db.lck
[onestep@onestep-box xcb-proto]$ ls
PKGBUILD pkg src
This task depends upon

Closed by  Allan McRae (Allan)
Sunday, 12 April 2009, 03:12 GMT
Reason for closing:  Fixed
Additional comments about closing:  git commmit:
http://projects.archlinux.org/?p=pacman. git;a=commit;h=442b91a5
Comment by Dan McGee (toofishes) - Saturday, 28 February 2009, 19:14 GMT
This seems logical. Patches welcome though of course. :)
Comment by Val L. (onestep_ua) - Sunday, 01 March 2009, 16:36 GMT
I've added a patch, which changes the makepkg's behaviour a bit, but it is simple and it works. :) There's possibly another way - declare some variable after successful build (e.g. BUILD_DONE) and check for it in clean_up.
Comment by Allan McRae (Allan) - Sunday, 01 March 2009, 21:46 GMT
I would prefer adding a check if pacman correctly ran and print a big warning message if it fails and return 0 from install_package. The reasoning being that makepkg has not failed in this case, pacman has. Similar to what is done when pacman fails to remove installed deps. See the "remove_deps" function.
Comment by Allan McRae (Allan) - Sunday, 29 March 2009, 06:54 GMT

Loading...