2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
5 # T2 SDE: misc/archive/showsorteddeps.sh
6 # Copyright (C) 2006 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 if [ "$1" == "-cfg" ]; then
26 echo "$@" |
sed -e 's,^,!> ,g' >& 2
30 echo "$@" |
sed -e 's,^,!> ,g' >& 2
34 if [ ! -f config
/$config/packages
]; then
35 echo_error
"config '$config' doesn't exist, sorry"
38 # get the list of cache files
41 confdir
=`echo package/*/$pkg/`
42 if [ -d $confdir ]; then
43 packages
="$packages $pkg"
44 if [ -f ${confdir}$pkg.cache
]; then
45 cachefiles
="$cachefiles ${confdir}$pkg.cache"
47 echo_warning
"package '$pkg' doesn't have a .cache file"
50 echo_warning
"package '$pkg' doesn't exist"
55 # get the list of interesting packages
56 # just one level of recursion
59 echo "$packages" |
tr ' ' '\n'
60 for cache
in $cachefiles; do
61 grep '^\[DEP\]' $cache | cut
-d' ' -f2
62 done } |
sort -u |
tr -s '\n' |
tr '\n' ' ' )
64 # pattern to search at packages file of this config
66 pkgsexp
=$
( echo "$packages" |
sed -e 's,^ ,,' -e 's, $,,' -e 's,\+,[+],' -e 's, ,\\\|,g' )
68 # catch interesting data from packages file
69 # (sorted by package name)
72 ( sed -n -e "s,^\(.\) \([^ ]*\) \(...\)\.\(...\) [^ ]* \($pkgsexp\) .*,\5 \3\4 \2 \1,p" \
73 config
/$config/packages |
sort > $0.$$
) &
76 packages_orig
="$packages"
77 while read pkg prio stages status
; do
78 packages_new
="${packages/ $pkg / }"
79 if [ "$packages" != "$packages_new" ]; then
80 packages
="$packages_new"
81 if [ "$status" != X
] ; then
86 echo "$prio $stages $status $pkg"
88 echo_warning
"what is '$pkg' doing here?"
93 # and catch data from dependencies which were not found at packages list
95 for pkg
in $packages; do
96 confdir
=`echo package/*/$pkg/`
97 if [ -f $confdir/$pkg.desc
]; then
98 echo_warning
"dependency '$pkg' is not available for this build."
99 sed -n -e 's,^\[P\] . \([^ ]*\) \([^ \.]*\)\.\([^ \.]*\).*,\2\3 \1 - '$pkg',p' $confdir/$pkg.desc
101 echo_warning
"dependency '$pkg' doesn't exist!"