On 30 Aug 2006, at 04:56, Koen van der Drift wrote:

> Is there a command that shows which packages either depend or
> builddepend on another package (xorg and xorg-shlibs in this case) ?

There might be a play with apt or fink rm -r if they have something  
like a 'dry-run' option..
But the "either depend or builddepends"  makes me want to be more  
cautious about the formulation :

On this machine I use to get recursive (bld-)deps the no-brainers :
:~ root# ls -l ~/bin|grep rec_
-rwxr-xr-x 4 root wheel 1454 Aug 23 00:23 rec_fb
-rwxr-xr-x 4 root wheel 1454 Aug 23 00:23 rec_fd
-rwxr-xr-x 4 root wheel 1454 Aug 23 00:23 rec_pb
-rwxr-xr-x 4 root wheel 1454 Aug 23 00:23 rec_pd

which, as you can see, are all the same file:
_______________________________________________
:~ root# cat ~/bin/rec_pd
#!/sw/bin/bash
# rec-pd : recursive depends of pkgs (= parameters)
# rec_pb : recursive depends and builddepends of pkgs
# rec_fd : recursive depends of the families of pkgs
# rec_fb : recursive depends and builddepends of the families of pkgs
# the output is always net of the (families of the) parameters
if [[ `cut -c5<<<"$0"` = "f" ]]
         then ls=`fink dumpinfo -ffamily $@|sed -r -e 's,^family:  
*,,' -e 's, +$,,' -e 's; *, *;\n;g'|sort -u`
         else ls=`sed -r -e 's,( |\t)+,\n,g'<<<"$*"`
fi
ls0=$ls
totls=$ls
if [[ `cut -c6<<<"$0"` = "d" ]] ; then cmd="-fdepends" ; else cmd="- 
fdepends -fbuilddepends" ; fi
until [[ `echo -n $ls|wc -w` -eq 0 ]] ; do
ls1=`fink dumpinfo $cmd $ls|sed -r -e 's,^(|build)depends: ,,' -e 's,  
*\([^)]*\) *, ,g' -e 's,[[:space:]]+$,,' -e 's; *, *;\n;g'|sort -u| 
sed -r -e 's,vfs2\-ssl,vfs2-unified,g' -e 's,vfs2( |$|\-sh),vfs2- 
unified\1,g' -e 's,db44(|$|\-[bds]),db44-aes\1,g' -e 's,([-+a-z0-9]+) 
[[:space:]]*\|[[:space:]]*\1,\1,g' -e 's,x11\-dev,xorg,' -e  
's,x11,xorg,'|sort -u`
if [[ -n "`echo $ls1`" ]]
         then ls=`fink list -t $ls1|fgrep -v '[virtual package'|cut - 
f2|fgrep -x "$ls1"|fgrep -vx "$totls"`
         else ls=$ls1
fi
# algorithm for removing alternatives is no good. Thus keep the  
following echo
# here, to check for remaining alternatives at each stage, and  
eventually to
# remove them manually (and to improve the algorithm itself each time):
echo "$ls"|fgrep '|' || :
totls=`echo $totls $ls|tr ' ' '\n'|sort -u`
done
totls=`echo "$totls"|fgrep -vx "$ls0"`
echo $totls
____________________________
on my office desktop, I use a conceptually completely different _ and  
much heavier,
with no room for heuristics like above (takes into account all  
provides, all sorts of virtual pkgs,
and all versionings, etc) _ set of  tools...

The above  does only "recursive" dependency analysis _ and even there,

<< referring here to my initial question about the formulation >>

you have to be quite careful whether you want to apply one of those  
commands
to a (set of) pkg, or to their families, or _ whichever be that  
choice _ to
their deps, or to their builddeps, or to the conjunction of both.
________________
Reverse recursive deps, as you want, are conceptually similar as above,
but "fink dumpinfo" doesn't seem geared towards it; I would rather be  
thinking of tools
like 'dpkg-awk' for this type of job  (ie, until 'fink dumpinfo'  
gives us a similar language...
wishfull thinking <sigh>...).
The main drawback would be that dpkg-awk limits you to already built  
pkgs...

JF

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Fink-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to