[arch-dev-public] Generating rebuild lists
Hi, I have attached an updated version of my rebuild list script that now uses readelf instead of ldd thanks to Thomas' suggestion. The advantages of this compared to ldd are massive in terms of speed but also mean that you don't need to use a chroot to avoid false positives. Usage: ./rebuildlist /path/to/package/dir lib1 [lib2 ...] On my laptop (not blazingly fast in cpu or hard-drive terms), this takes ~15min to scan my package cache (all testing, core and extra and whatever I have from community). So this is now reasonable for people to run on the new server and we will never miss a rebuild again! Any comments on the script before I make the git patch to push it to devtools? Cheers, Allan #! /bin/bash # rebuildlist - list packages needing rebuilt for a soname bump # # Copyright (c) 2009 by Allan McRae <allan@archlinux.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. if [ -z "$1" -o -z "$2" ]; then echo "Usage $0 <pkg directory> <library1> [<library2> ...]" exit fi directory=$1 shift while [ -n "$1" ]; do grepexpr="$grepexpr -e ${1%%.so}.so" shift done startdir=$(pwd) tmpdir=$(mktemp -d) cd $tmpdir for pkg in $(ls $directory/*.pkg.tar.gz); do pkg=${pkg##*\/} echo "Scanning $pkg" mkdir $tmpdir/extract cp $directory/$pkg $tmpdir/extract cd $tmpdir/extract tar -xf $directory/$pkg rm $pkg found=$(readelf --dynamic $(find -type f) 2>/dev/null | grep $grepexpr | wc -l) if [ $found -ne 0 ]; then echo ${pkg%-*-*-*} >> ../rebuildlist.txt fi cd .. rm -rf extract done cp $tmpdir/rebuildlist.txt $startdir
Allan McRae schrieb:
On my laptop (not blazingly fast in cpu or hard-drive terms), this takes ~15min to scan my package cache (all testing, core and extra and whatever I have from community). So this is now reasonable for people to run on the new server and we will never miss a rebuild again!
Any comments on the script before I make the git patch to push it to devtools?
It should have an option to scan $PATH/*/os/$ARCH/*.pkg.tar.gz so we can scan an existing ftp mirror all at once. Also, using "ls" in unnecessary as far as I can see, so it would look like: for pkg in $directory/*.pkg.tar.gz; do or for pkg in $directory/*/os/$ARCH/*.pkg.tar.gz; do I keep a mirror of all arch packages on my laptop, so we wouldn't have to run it on the server.
Am Montag, 2. März 2009 09:27:04 schrieb Allan McRae:
Any comments on the script before I make the git patch to push it to devtools?
Nice. Would be better to pass a package name to it. Something like: rebuildlist $(pacman -Qql kdelibs | grep ".*\.so") PS: Why does the -q switch not work here? Is this a pacman bug or just a missing feature? -- Pierre Schmitz Clemens-August-Straße 76 53115 Bonn Telefon 0228 9716608 Mobil 0160 95269831 Jabber pierre@jabber.archlinux.de WWW http://www.archlinux.de
Pierre Schmitz wrote:
Am Montag, 2. März 2009 09:27:04 schrieb Allan McRae:
Any comments on the script before I make the git patch to push it to devtools?
Nice. Would be better to pass a package name to it. Something like: rebuildlist $(pacman -Qql kdelibs | grep ".*\.so")
I like passing the library names because I have had some packages which only bump one of their many library sonames (e.g. heimdal on a minor version update...). I could add a flag to pass a package.
PS: Why does the -q switch not work here? Is this a pacman bug or just a missing feature?
Missing feature is my guess. -q normally removes pkgver-pkgrel info so I guess this case was not considered. Allan
participants (3)
-
Allan McRae
-
Pierre Schmitz
-
Thomas Bächler