diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-05-19 23:01:50 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-05-19 23:01:50 +0200 |
commit | 5218cde3f394f2ab4d6f6cc763bc9267a0b69f07 (patch) | |
tree | 969d13117588d69c508894805775d2ca2b7ec588 | |
parent | 3c3240157f18c7f1d4074e25279207da37cc62da (diff) |
bin/pkg: Added experimental dependency support
-rwxr-xr-x | bin/pkg | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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 |