[email protected]
Jonathan Nieder wrote:
John D. Hendrickson and Sara Darnell wrote:
I have a working example of what to do that mostly uses existing
unix tools.
Well, what are you waiting for? :)
excuse me - let me include "show-all" incase anyone wishes to view tsort-out.
#!/bin/sh
# FILE: show-all
# DESC: works only after tsort-out is generated
#
if [ "$1" == "-h" ] || [ "$1" == "--help" ] ; then
echo "DESCR: show-all packages in tsorted dep order w/ some info"
echo "USAGE: show-all File"
echo "NOTES: File is tsort-in, a dep sorted numberic list"
exit
fi
if [ "$1" == "-f" ] ; then shift 1 ; file="$1" ; else file="tsort-out" ; fi
if [ ! -f ppd ] ; then
available="available"
if [ ! -f $available ] ; then
available="/var/lib/dpkg/available"
fi
awk 'BEGIN{FS="\n"}; /^Pa/{print $0}; /^Pri/{gsub(/,/,""); print $0}; /^Sec/{print $0}; /^Pro/{print
$0}; /^Dep/{gsub(/\([^)]*\)/,""); gsub(/,/,""); gsub(/\|/,""); print $0}; /^$/{print ++n"\n"}'
$available > ppd
once=1
fi
awk 'BEGIN {ORS=""; pri["req"]=1; pri["imp"]=2; pri["sta"]=3; pri["opt"]=4; pri["ext"]=5; RS="\n\n";
n=1; while(getline <"ppd"){x2[n]=$2; x3[n]=substr($4,1,3); x4[n]=substr($6,1,3); ++n}; RS="\n"}; {
print $1 "\t" x3[$1] " " pri[x3[$1]] "\t" x4[$1] "\t" x2[$1] "\n" }' $file
if [ $once ] ; then rm ppd ; fi
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]