FS#63000 - [makepkg] does not correctly remove installed packages if installing makedepends fails.
Attached to Project:
Pacman
Opened by Erich Eckner (deepthought) - Tuesday, 25 June 2019, 11:20 GMT
Last edited by Allan McRae (Allan) - Friday, 11 October 2019, 01:33 GMT
Opened by Erich Eckner (deepthought) - Tuesday, 25 June 2019, 11:20 GMT
Last edited by Allan McRae (Allan) - Friday, 11 October 2019, 01:33 GMT
|
Details
Summary and Info:
consider this PKGBUILD: ---- start pkgname='test' pkgver=0 pkgrel=0 arch=(any) pkgdesc='just a PKGBUILD demo' url='archlinux.org' license=(custom) depends=(perl-xml-xpath) makedepends=(boggggussss) package() { touch $pkgdir/test } ---- end which has a normal entry in depends=() and an unresolvable entry in makedepends=(). running `makepkg -fcrs` installs the depends=(), then tries to install the makedepends=() and fails. But it also fails to uninstall perl-xml-xpath which got installed as depends=(). The reason is, that makepkg does not update the "current_pkglist" variable between installing depends=() and makedepends=() (and checkdepends=()). The following patch solves the issue: ---- start --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1366,6 +1366,10 @@ else msg "$(gettext "Checking runtime dependencies...")" resolve_deps ${depends[@]} || deperr=1 + if (( RMDEPS )); then + current_pkglist=($(run_pacman -Qq)) # required by remove_deps + fi + if (( RMDEPS && INSTALL )); then original_pkglist=($(run_pacman -Qq)) # required by remove_dep fi ---- end I experience this with makepkg for quite some time now (I'm unsure if it was better at any time), most recently with pacman-5.1.3-1. regards, deep42thought P.S.: How is one supposed to compile/test with the git HEAD of pacman? Running `sudo make install` inside the git repo (after building with make) killed my pacman ... (I was used to install modified devtools versions into /usr/local with this command) |
This task depends upon
Closed by Allan McRae (Allan)
Friday, 11 October 2019, 01:33 GMT
Reason for closing: Fixed
Additional comments about closing: git commit d91710943
Friday, 11 October 2019, 01:33 GMT
Reason for closing: Fixed
Additional comments about closing: git commit d91710943
Everything can be run in tree.
ok, thx.
I just tested my patch on the current master and it seems to do the right thing (in my case).