On Feb 3, 2004, at 5:44 PM, TheSin wrote:


the point is still why? it's not hurting fink or dpkg for our usage.

Even if it doesn't hurt fink's or dpkg's current usage (no guarantee about future versions of dpkg), users must be able to rely on the specs for whatever scripts they need.

Jean-Francois


PS: Fink gives very few "accessors" to its db, so users _ maybe in addition
afraid of a perpetual state of flux to write their own) have to do things
on their own.
And even w/o that, eg the following script, which doesn't use the db, performs
typically better (when piped through 'grep Maintainer' or 'grep Depends')
than 'fink info' to get a Maintainer :


#!/sw/bin/bash
hash grep sed tr sort cut dpkg xargs
check () {
local k
for k in $@
do
if [[ $i = `grep -i '^Package:' $k|grep -v '%'|tr "\n\t" "X "|cut -dX -f1|sed 's, *, ,'|cut -d ' ' -f2` ]]
then echo $k
fi
done
}
realname () { local k ; { for k in $@ ; do pushd $k 1>/dev/null ; pwd -P ; popd 1>/dev/null ; done } | xargs ; }
lst=`grep '^Trees:' /sw/etc/fink.conf|tr "\t" " "|sed 's/^Trees: *//'|sed 's/ *$//'|sed 's/ */ /'|tr -s ' ' '\n'|sed 's|^|/sw/fink/dists/|'|xargs`
ls=`realname $lst`
lst=`find $ls -follow \( -name CVS -o -name 'binary-darwin-powerpc' \) -prune -o -print|grep '\.info$'`
for i in $@
do
ls=`check \`{
grep -F "/${i}.info
/${i}-" <<-EOF
$lst
EOF
}\` | xargs`
max=0:0-0
vers () { val=$3:$1-$2 ; }
for j in $ls
do
vers `echo \`grep -iE "^(Epoch|Version|Revision):" $j |tr "\t" " "|sed 's/ */ /'|sort -fr|cut -f2 -d ' '\`` 0
# if dpkg --compare-versions $max le $val
if finch-version-cmp $max "<=" $val
then max=$val
l="$j"
fi
done
echo $l
done




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Fink-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to