I have created a script that allows me to find out dependencies for a specific extension based on the content of the extension.
It relies on having access to the *.tcz.list for all extensions in the repository and since people do mirror the repository in different ways and at different locations it has to be adjusted for each users particular environment.
The principle of operation is:
Loop through all files of the extension and use ldd to find out for each file the libraries it depends on (if any). Once the dependent libraries are found then the *.tcz.list files are visited to find out in what package the library is found.
I have found that some libraries are found in multiple extensions, which in principle should be wrong, so I think there could be a task here for the repository responsibles to have a look at this, e.g. the lilypond package contains fontconfig libraries and these should be fetched from the fontconfig extension instead.
As of now the files of the extension are fetched from my build environment but could be fetched from its .tcz file instead in order to make the script independent of the build environment.
I find this script very useful and if nothing similar is available elsewhere I propose to extend the "Creating extensions" part of the wiki with information about how one could go about to create the information needed for .dep files.
The script:
#!/bin/sh
package=$1
files=`cat /mnt/hda1/BUILD/tmp/bin/$package/$package.tcz.list`
rm -f /tmp/$package.lsdeps
for f in $files; do
fpath="/mnt/hda1/BUILD/tmp/bin/$package/root/$f"
ldd $fpath 2>/dev/null | \
grep -e "=> /usr/local" -e "=> not found" | \
awk '{print $1}' >>/tmp/$package.lsdeps
done
fdeps=`sort -u /tmp/$package.lsdeps`
rm -f /tmp/$package.lsdeps
rm -f $package.tcz.dep
for f in $fdeps; do
echo $f "----->"
deps=`grep -l $f /mnt/hda1/MIRROR/tcz/*.tcz.list`
many=""
for d in $deps; do
bd=`basename $d | sed "s/.tcz.list//"`
if [ "$bd" != "$package" ]; then
echo " " $bd
echo "$bd.tcz" >> /tmp/$package.lsdeps
fi
if [ -n "$many" ]; then
echo "WARNING!!!!!!!!! $f is found in multiple extensions !!!!!WARNING"
fi
many="yes"
done
done
if [ -f /tmp/$package.lsdeps ]; then
sort -u /tmp/$package.lsdeps > $package.dep
fi
Kind Regards
Lars