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> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
5e4882dfe8
commit
67f388c3fc
1 changed files with 2 additions and 2 deletions
|
@ -362,11 +362,10 @@ resolve_deps() {
|
||||||
local deplist="$(check_deps $*)"
|
local deplist="$(check_deps $*)"
|
||||||
if [ "$deplist" = "" ]; then
|
if [ "$deplist" = "" ]; then
|
||||||
return $R_DEPS_SATISFIED
|
return $R_DEPS_SATISFIED
|
||||||
else
|
|
||||||
pkgdeps="$pkgdeps $deplist"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if handledeps $deplist; then
|
if handledeps $deplist; then
|
||||||
|
pkgdeps="$pkgdeps $deplist"
|
||||||
# check deps again to make sure they were resolved
|
# check deps again to make sure they were resolved
|
||||||
deplist="$(check_deps $*)"
|
deplist="$(check_deps $*)"
|
||||||
[ "$deplist" = "" ] && return $R_DEPS_SATISFIED
|
[ "$deplist" = "" ] && return $R_DEPS_SATISFIED
|
||||||
|
@ -390,6 +389,7 @@ remove_deps() {
|
||||||
[ "$pkgdeps" = "" ] && return
|
[ "$pkgdeps" = "" ] && return
|
||||||
|
|
||||||
local dep depstrip deplist
|
local dep depstrip deplist
|
||||||
|
deplist=""
|
||||||
for dep in $pkgdeps; do
|
for dep in $pkgdeps; do
|
||||||
depstrip=$(echo $dep | sed -e 's|=.*$||' -e 's|>.*$||' -e 's|<.*$||')
|
depstrip=$(echo $dep | sed -e 's|=.*$||' -e 's|>.*$||' -e 's|<.*$||')
|
||||||
deplist="$deplist $depstrip"
|
deplist="$deplist $depstrip"
|
||||||
|
|
Loading…
Add table
Reference in a new issue