diff options
Diffstat (limited to 'sbodeps')
| -rwxr-xr-x | sbodeps | 41 |
1 files changed, 27 insertions, 14 deletions
@@ -47,17 +47,25 @@ print_installed_status() { pkg_is_installed $1 >/dev/null && echo " (installed)" || echo " (NOT installed)" } +print_with_maint() { + local info=$(/bin/ls $SBOROOT/*/$1/$1.info 2>/dev/null | head -1) + local MAINTAINER + local EMAIL + source "$info" + echo "$1: $MAINTAINER <$EMAIL>" +} + find_deps() { local i local req local REQUIRES local info=$(/bin/ls $SBOROOT/*/$2/$2.info 2>/dev/null | head -1) - if [ -z "$info" ]; then - echo "$SELF: $2: no such package" 1>&2 - RETVAL=1 - return; - fi + if [ -z "$info" ]; then + echo "$SELF: $2: no such package" 1>&2 + RETVAL=1 + return; + fi eval $(grep ^REQUIRES= $info) if [ "$REQUIRES" = "" ]; then @@ -86,11 +94,12 @@ QUEUE=yes while [ "$argsdone" != "yes" ]; do case "$1" in -h|-help|--help) usage; exit 0 ;; - -iq|-qi) QUEUE=yes ; IGNORE=yes ; shift ;; - -it|-ti) QUEUE=no ; IGNORE=yes ; shift ;; + -iq|-qi) QUEUE=yes ; IGNORE=yes ; shift ;; + -it|-ti) QUEUE=no ; IGNORE=yes ; shift ;; -t) QUEUE=no ; shift ;; -q) QUEUE=yes ; shift ;; -i) IGNORE=yes ; shift ;; + -m) SHOWMAINT=yes ; shift ;; -*) echo "Unknown option $1"; usage; exit 1 ;; *) argsdone=yes ;; esac @@ -105,8 +114,8 @@ if [ "$QUEUE" = "yes" ]; then fi if [ ! -e "$SBOROOT/system" ]; then - echo "$SELF: path \"$SBOROOT\" doesn't look like an SBo repo, set SBOROOT in environment" 1>&2 - exit 1 + echo "$SELF: path \"$SBOROOT\" doesn't look like an SBo repo, set SBOROOT in environment" 1>&2 + exit 1 fi RETVAL=0 @@ -117,10 +126,10 @@ for arg; do echo -n $arg print_installed_status $arg if [ "$QUEUE" = "yes" ]; then - if ! pkg_is_installed $arg || [ "$IGNORE" = "yes" ]; then - echo 0 $arg >> $QTMPFILE - fi - fi + if ! pkg_is_installed $arg || [ "$IGNORE" = "yes" ]; then + echo 0 $arg >> $QTMPFILE + fi + fi find_deps 1 $arg done @@ -137,7 +146,11 @@ if [ "$QUEUE" = "yes" -a -e "$QTMPFILE" ]; then r=seen_$(echo $q | sed 's,[^A-Za-z0-9_],_,g') s=${!r} # bash indirect variable ref, yay if [ "$s" != "yes" ]; then - echo $q + if [ "$SHOWMAINT" = "yes" ]; then + print_with_maint $q + else + echo $q + fi eval $r="yes" fi done |
