From 67f388c3fcad755d94944bee1f3a5a938817f5b9 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Wed, 23 Jul 2008 23:01:35 +1000 Subject: 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 Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index ae199837..379e9d8b 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" -- cgit v1.2.3-70-g09d2