[arch-general] Advanced pacman dependency functions
Hi all. I was looking for a way to do a couple of things with pacman that may be useful, mainly for package maintainers. Maybe they can already be done and I just didn't find out how. I used to use pt-deptree, but it hasn't been working for quite some time now. The first one is finding all the packages that directly depend on a specific package, even if they're not installed. This came to my mind considering those upgrades which break other software, like x264 and tcl/tk (8.5 has just been released): it could be a lot easier to test if all packages work properly with the new version or if it is necessary to rebuild them. Second, I often find myself looking for package dependencies along the tree, because I need to know, given two packages, if one of the two depends on the other or not. This is good when I'm deciding which dependencies should be put in a package, becuase the cycle edit-makepkg-namcap is sometimes impractical when the package has a lot of dependencies. Is anybody able to help? TIA, Corrado
On Sat 2007-12-22 12:52 , bardo wrote:
Hi all.
I was looking for a way to do a couple of things with pacman that may be useful, mainly for package maintainers. Maybe they can already be done and I just didn't find out how. I used to use pt-deptree, but it hasn't been working for quite some time now.
The first one is finding all the packages that directly depend on a specific package, even if they're not installed. This came to my mind considering those upgrades which break other software, like x264 and tcl/tk (8.5 has just been released): it could be a lot easier to test if all packages work properly with the new version or if it is necessary to rebuild them.
Something like this? (proof of concept) ---------------------------------8<------------------------------------ foo() { checkdep=$1 pkgbuild=$2 unset depends makedepends source $pkgbuild for dep in ${depends[@]} ${makedepends[@]}; do dep_s=$(echo $dep | sed 's|=.*$||' | sed 's|>.*$||' \ | sed 's|<.*$||') if [[ "$dep_s" == "$checkdep" ]]; then echo $pkgbuild fi done } find_dep=$1 for pkg in `find /var/abs -name PKGBUILD`; do foo $find_dep $pkg done ---------------------------------8<------------------------------------
Second, I often find myself looking for package dependencies along the tree, because I need to know, given two packages, if one of the two depends on the other or not. This is good when I'm deciding which dependencies should be put in a package, becuase the cycle edit-makepkg-namcap is sometimes impractical when the package has a lot of dependencies.
I think I didn't understand what you need here. Can you provide a real example where this is useful? -- Alessio 'mOLOk' Bolognino Arch Linux Trusted User Please send personal email to themolok@gmail.com Public Key http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xFE0270FB GPG Key ID = 1024D / FE0270FB 2007-04-11 Key Fingerprint = 9AF8 9011 F271 450D 59CF 2D7D 96C9 8F2A FE02 70FB
On Dec 22, 2007 6:52 AM, bardo <ilbardo@gmail.com> wrote:
The first one is finding all the packages that directly depend on a specific package, even if they're not installed. This came to my mind considering those upgrades which break other software, like x264 and tcl/tk (8.5 has just been released): it could be a lot easier to test if all packages work properly with the new version or if it is necessary to rebuild them.
I wrote a script to do something similar a while ago - it was modified by another dev (maybe Pierre?) and this is the modified version. You can probably run it on the abs tree.
participants (3)
-
Alessio 'mOLOk' Bolognino
-
bardo
-
Travis Willard