From a7884c93b59009915b4fc5921bef9c5c01216917 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 31 May 2008 14:06:17 +0200 Subject: several - rename .deps -> dependencies - shwo package name on info - show package priority on info --- bin/pkg | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'bin/pkg') diff --git a/bin/pkg b/bin/pkg index b61c3e0..49e7eb6 100755 --- a/bin/pkg +++ b/bin/pkg @@ -43,8 +43,8 @@ if ([ ! -d $PDIR ]) { } check_deps () { - [ -r $PDIR/$1/.deps ] || return 0 - DEPS=($(cat $PDIR/$1/.deps)) + [ -r $PDIR/$1/dependencies ] || return 0 + DEPS=($(cat $PDIR/$1/dependencies)) INSTALL=() for dep in $DEPS; { if ([ "$dep" = "$1" ]) { @@ -171,8 +171,24 @@ pkg_status_wrapper () { } } +real_priority () { + case "$1" in + 6) echo "essential" ;; + 5) echo "important" ;; + 4) echo "required" ;; + 3) echo "standard" ;; + 2) echo "optional" ;; + 1) echo "extra" ;; + *) echo "?" ;; + esac +} + pkg_info () { cd $PDIR/$1 || return + info "Package: " + echo "$1" + info "Priority: " + real_priority $(cat priority 2> /dev/null || echo 0) LOG=$(hg log) info "Current version: " echo $LOG | grep -m1 'changeset:' | grep -E -o '[0-9]{1,}:[0-9a-f]*' @@ -184,9 +200,10 @@ pkg_info () { info "Hooks: " ls hooks } - if ([ -r .deps ]) { + if ([ -r dependencies ]) { info "Dependencies:\n" - cat .deps + cat dependencies | tr "\n" " " + echo } } -- cgit v1.2.3