[pacman-dev] [PATCH] makepkg: add packages to pkgdeps list only after successful install
This fixed FS#9403. With this you can use "makepkg -sr", install the dependencies, Ctrl+c during the makedepends installation and have makepkg remove the installed packages on the exit. Previously makepkg tried to also remove the makedepends which were not installed. The deplist="" line in remove_deps is due to an obscure bug where local varaibles from the handle_deps function seem stay in scope because we never formally exited it. Signed-off-by: Allan McRae <allan@archlinux.org> --- scripts/makepkg.sh.in | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index ae19983..379e9d8 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -362,11 +362,10 @@ resolve_deps() { local deplist="$(check_deps $*)" if [ "$deplist" = "" ]; then return $R_DEPS_SATISFIED - else - pkgdeps="$pkgdeps $deplist" fi if handledeps $deplist; then + pkgdeps="$pkgdeps $deplist" # check deps again to make sure they were resolved deplist="$(check_deps $*)" [ "$deplist" = "" ] && return $R_DEPS_SATISFIED @@ -390,6 +389,7 @@ remove_deps() { [ "$pkgdeps" = "" ] && return local dep depstrip deplist + deplist="" for dep in $pkgdeps; do depstrip=$(echo $dep | sed -e 's|=.*$||' -e 's|>.*$||' -e 's|<.*$||') deplist="$deplist $depstrip" -- 1.5.6.4
Allan McRae wrote:
This fixed FS#9403. With this you can use "makepkg -sr", install the dependencies, Ctrl+c during the makedepends installation and have makepkg remove the installed packages on the exit. Previously makepkg tried to also remove the makedepends which were not installed.
The deplist="" line in remove_deps is due to an obscure bug where local varaibles from the handle_deps function seem stay in scope because we never formally exited it.
I'll find fixes for easier bugs while you guy work on the hard ones :) FYI - The now working example from the bug report:
./makepkg -sr ==> Making package: mail-notification 5.0-1 i686 (Wed Jul 23 23:06:23 EST 2008) ==> Checking Runtime Dependencies...
==> Installing missing dependencies... resolving dependencies... looking for inter-conflicts... Targets: eel-2.22.2-1 postgresql-libs-8.3.3-1 libmysqlclient-5.0.60-1 cyrus-sasl-plugins-2.1.22-7 gmime-2.2.21-1 Total Download Size: 0.00 MB Total Installed Size: 10.37 MB Proceed with installation? [Y/n] checking package integrity... (5/5) checking for file conflicts [#####################] 100% (1/5) installing eel [#####################] 100% (2/5) installing postgresql-libs [#####################] 100% (3/5) installing libmysqlclient [#####################] 100% (4/5) installing cyrus-sasl-plugins [#####################] 100% (5/5) installing gmime [#####################] 100% ==> Checking Buildtime Dependencies... eel cyrus-sasl-plugins gmime ==> Installing missing dependencies... resolving dependencies... looking for inter-conflicts... Targets: gob2-2.0.15-1 gtkhtml-3.18.3-1 pilot-link-0.12.3-1 gnome-pilot-2.0.16-1 evolution-2.22.3.1-2 rarian-0.8.0-1 gnome-doc-utils-0.12.2-1 Total Download Size: 59.50 MB Total Installed Size: 104.83 MB Proceed with installation? [Y/n] ^C ==> ERROR: Aborted by user! Exiting... ==> Removing installed dependencies... loading package data... checking dependencies... Targets: gmime cyrus-sasl-plugins eel postgresql-libs libmysqlclient Do you want to remove these packages? [Y/n] (1/5) removing gmime [#####################] 100% (2/5) removing cyrus-sasl-plugins [#####################] 100% (3/5) removing eel [#####################] 100% (4/5) removing postgresql-libs [#####################] 100% (5/5) removing libmysqlclient [#####################] 100%
participants (1)
-
Allan McRae