2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
5 # T2 SDE: misc/archive/showdeps.sh
6 # Copyright (C) 2004 - 2005 The T2 SDE Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
20 usage: $0 [-root <root>] [<pkg>]+
25 if [ -f package
/*/$1/$1.cache
]; then
26 grep -e "^\[DEP\]" package
/*/$1/$1.cache | cut
-d' ' -f2- |
tr '\n' ' '
33 if [ -f package
/*/$1/$1.desc
]; then
34 prio
=`sed -n -e "s,^\[P\] . .* \(.*\),\1,p" package/*/$1/$1.desc`
37 [ -n "$prio" ] && echo "$prio" ||
echo "---.---"
40 [ -f $root/var
/adm
/packages
/$1 ]
44 local deep
="$1" pkg
="$2" prefix
="$3"
45 local cache
="$4" banner= dep
=
47 [ $deep -eq 0 ] && return 0
50 banner="$pkg($( getprio $pkg ))"
52 if pkginstalled
$pkg; then
58 echo -e "$prefix$banner"
59 for dep
in $
( getdeps
$pkg ); do
60 if [ "$dep" == "unknown" ]; then
61 echo -e "$prefix$banner\tNODEPS"
62 elif [ -z "$(echo "$cache" | grep ":$dep:" )" ]; then
63 digdeps
$deep $dep "$prefix$banner\t" "$cache$pkg:"
68 while [ $# -ne 0 ]; do
72 -*) echo "ERROR: Option $1 is not recognized."
81 if [ -f package
/*/$pkg/$pkg.desc
]; then
84 echo "ERROR: '$pkg' not found!" 1>&2