summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-05-19 23:01:50 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-05-19 23:01:50 +0200
commit5218cde3f394f2ab4d6f6cc763bc9267a0b69f07 (patch)
tree969d13117588d69c508894805775d2ca2b7ec588
parent3c3240157f18c7f1d4074e25279207da37cc62da (diff)
bin/pkg: Added experimental dependency support
-rwxr-xr-xbin/pkg16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/pkg b/bin/pkg
index a88a691..7f2b1d5 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -15,11 +15,26 @@ if [ ! -d $PDIR ]; then
exit 100
fi
+check_deps () {
+ [ -r $PDIR/$1/.deps ] || return 0
+ DEPS=($(cat $PDIR/$1/.deps))
+ for dep in DEPS; {
+ if [ ! -d $PDIR/$dep ]; then
+ echo -n "$1 depends on $dep. Install dependency? [Y/n] "
+ read
+ if [ ! "$REPLY" = 'n' ]; then
+ "$0" add "$dep"
+ fi
+ fi
+ }
+}
+
pkg_add () {
if [ -d $PDIR/$1 ]; then
echo_status "Package already installed!"
return 100
fi
+ check_deps "$1"
cd $PDIR || return 255
echo_status 'Retrieving package...'
hg $HG_OPTIONS clone $PKG_ROOT/$1 || return 255
@@ -50,6 +65,7 @@ pkg_update () {
cd $PDIR
for i in *(/); {
echo_status "Updating package $i..."
+ check_deps "$1"
cd $i
hg $HG_OPTIONS fetch
checklinks $CL_OPTIONS