2008-09-15 23:09:18 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# which_deb
|
|
|
|
#
|
|
|
|
# Simple helper tool to find the appropriate version of a package in
|
|
|
|
# the archive to meet a requirement in the debian-cd build
|
|
|
|
|
|
|
|
MIRROR=$1
|
|
|
|
CODENAME=$2
|
|
|
|
PKG=$3
|
2008-09-16 01:40:15 +00:00
|
|
|
PTH=$MIRROR/dists/$CODENAME/main
|
2008-09-15 23:09:18 +00:00
|
|
|
|
|
|
|
case $PKG in
|
|
|
|
|
|
|
|
debootstrap)
|
2008-09-16 01:40:15 +00:00
|
|
|
DEB="$MIRROR/"`zcat $PTH/binary-i386/Packages.gz | \
|
2008-09-15 23:09:18 +00:00
|
|
|
awk '/\/debootstrap_.*deb/ {print $2}'`
|
|
|
|
;;
|
|
|
|
|
|
|
|
silo)
|
2008-09-16 01:40:15 +00:00
|
|
|
DEB="$MIRROR/"`zcat $PTH/binary-sparc/Packages.gz | \
|
2008-09-15 23:09:18 +00:00
|
|
|
awk '/\/silo.*deb/ {print $2}'`
|
|
|
|
;;
|
|
|
|
|
|
|
|
syslinux)
|
|
|
|
# More complex - look for syslinux-common, then fall back to
|
|
|
|
# syslinux if we don't find that
|
2008-09-16 01:40:15 +00:00
|
|
|
DEB="$MIRROR/"`zcat $PTH/binary-i386/Packages.gz | \
|
2008-09-15 23:09:18 +00:00
|
|
|
awk '/\/syslinux-common.*deb/ {print $2}'`
|
|
|
|
if [ "$DEB"x = "$MIRROR/"x ] ; then
|
2008-09-16 01:40:15 +00:00
|
|
|
DEB="$MIRROR/"`zcat $PTH/binary-i386/Packages.gz | \
|
2008-09-15 23:09:18 +00:00
|
|
|
awk '/\/syslinux.*deb/ {print $2}'`
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
yaboot)
|
2008-09-16 01:40:15 +00:00
|
|
|
DEB="$MIRROR/"`zcat $PTH/binary-powerpc/Packages.gz | \
|
2008-09-15 23:09:18 +00:00
|
|
|
awk '/\/yaboot.*deb/ {print $2}'`
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
# No idea what we should be doing here...
|
|
|
|
DEB="$MIRROR/"
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ "$DEB"x = "$MIRROR/"x ] ; then
|
|
|
|
echo "$0: Failed to find a deb for package $PKG in $MIRROR/"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo $DEB
|
|
|
|
|