summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-06-21 21:37:03 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-06-21 21:37:03 +0200
commit8733eafd8eff04872a14581ef51e65009480ab05 (patch)
treeb945a21de5a27603e07596d9faa27bb246f5b011
parent318a4c27d4f35ee9615dfd256001e545af8f351e (diff)
bin/pkg: check_{deps,conflits}: Don't ask per package
-rwxr-xr-xbin/pkg30
1 files changed, 20 insertions, 10 deletions
diff --git a/bin/pkg b/bin/pkg
index f89afdb..322f268 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -153,13 +153,19 @@ check_deps () {
INSTALL=()
for dep in $DEPS; {
if ([ ! -d $PDIR/$dep ]) {
- if (confirm_yes "$1 depends on $dep. Install dependency?") {
- INSTALL+="$dep"
- }
+ INSTALL+="$dep"
}
}
- for pkg in $INSTALL; {
- pkg_add "$pkg"
+ if ([ -n "$INSTALL" ]) {
+ info "$1 depends on the following packages: "
+ echo "$INSTALL"
+ if (confirm_yes "Install dependencies?") {
+ for pkg in $INSTALL; {
+ pkg_add "$pkg"
+ }
+ } else {
+ die "Installation aborted"
+ }
}
}
@@ -169,14 +175,18 @@ check_conflicts () {
REMOVE=()
for conflict in $CONFLICTS; {
if ([ -d $PDIR/$conflict ]) {
- if (confirm_no "$1 conflicts with $conflict. Remove $conflict?") {
- REMOVE+="$conflict"
- }
+ REMOVE+="$conflict"
}
}
if ([ -n "$REMOVE" ]) {
- for pkg in $REMOVE; {
- pkg_remove "$pkg"
+ info "$1 conflicts with the following packages: "
+ echo "$REMOVE"
+ if (confirm_no "Remove conflicting packages and proceed with installation?") {
+ for pkg in $REMOVE; {
+ pkg_remove "$pkg"
+ }
+ } else {
+ die "Installation aborted"
}
}
}