Ticket #81: duck.sh

File duck.sh, 714 bytes (added by phurst, 12 years ago)
Line 
1#!/bin/sh
2
3get_hash() {
4    debfile=$1
5    dpkg -x $debfile .
6    md5sum $2
7}   
8
9DEBATHENA_APT=/mit/debathena/apt
10DIST=jaunty
11tmp_dir=$(mktemp -d /tmp/duck.XXXXXX)
12for encoded in $(find $DEBATHENA_APT/dists/$DIST -name Packages -exec grep-dctrl -F Provides diverts- {} -s Provides \; | sed -e 's/^Provides: //g; s/, /\n/g; s/^diverts-//gm' | sort -u)
13do
14    decoded=$(./decode "$encoded")
15    pkg=$(apt-file search -x "^$decoded\$" | head -n1 | cut -d: -f1)
16#    echo "Processing $decoded in pkg $pkg"
17    (cd $tmp_dir && aptitude -q download $pkg > /dev/null && get_hash $pkg*.deb $decoded)
18done
19# Get a list of all packages that build depend on config-package-dev via grep-dctrl
20# Iterate over those packages,