#!/bin/sh # download current package indexes to data/{,-proposed}/ for running # britney against a PPA. The PPA will play the role of "-proposed" (i. e. # "unstable" in britney terms, containing the updated packages to test), the # Ubuntu archive has the "-release" part (i. e. "testing" in britney terms, in # which the -proposed packages are being landed). # # Author: Martin Pitt set -eu DATADIR=data ARCHES="i386 amd64" PORTS_ARCHES="armhf arm64 powerpc ppc64el" MIRROR=http://archive.ubuntu.com/ubuntu PORTS_MIRROR=http://ports.ubuntu.com if [ -z "${2:-}" ]; then echo "Usage: $0 " >&2 exit 1 fi SERIES="$1" ARCHIVE_URL="$2" # download Ubuntu indexes as "release" mkdir -p $DATADIR/$SERIES/state/ rm -f $DATADIR/$SERIES/*.new for component in main restricted universe multiverse; do for arch in $ARCHES; do wget -O- $MIRROR/dists/$SERIES/$component/binary-$arch/Packages.gz >> $DATADIR/$SERIES/Packages_${arch}.new done for arch in $PORTS_ARCHES; do wget -O- $PORTS_MIRROR/dists/$SERIES/$component/binary-$arch/Packages.gz >> $DATADIR/$SERIES/Packages_${arch}.new done wget -O- $MIRROR/dists/$SERIES/$component/source/Sources.gz | zcat >> $DATADIR/$SERIES/Sources.new done mv $DATADIR/$SERIES/Sources.new $DATADIR/$SERIES/Sources for arch in $ARCHES $PORTS_ARCHES; do mv $DATADIR/$SERIES/Packages_${arch}.new $DATADIR/$SERIES/Packages_${arch}.gz gunzip $DATADIR/$SERIES/Packages_${arch} done # download PPA archive indexes as "-proposed"; note they only have a release # pocket and a "main" component suite="${SERIES}-proposed" mkdir -p $DATADIR/$suite rm -f $DATADIR/$suite/*.new for arch in $ARCHES $PORTS_ARCHES; do wget -O- $ARCHIVE_URL/dists/$SERIES/main/binary-$arch/Packages.gz >> $DATADIR/$suite/Packages_${arch}.new done wget -O- $ARCHIVE_URL/dists/$SERIES/main/source/Sources.gz | zcat >> $DATADIR/$suite/Sources.new mv $DATADIR/$suite/Sources.new $DATADIR/$suite/Sources for arch in $ARCHES $PORTS_ARCHES; do mv $DATADIR/$suite/Packages_${arch}.new $DATADIR/$suite/Packages_${arch}.gz gunzip $DATADIR/$suite/Packages_${arch} done # If a second PPA is specified, download the contents of that as well and put it onto the end of the -proposed files if [ $# -eq 3 ]; then ARCHIVE_URL_TWO="$3" for arch in $ARCHES $PORTS_ARCHES; do wget -O- $ARCHIVE_URL_TWO/dists/$SERIES/main/binary-$arch/Packages.gz >> $DATADIR/$suite/Packages_${arch}.new done wget -O- $ARCHIVE_URL_TWO/dists/$SERIES/main/source/Sources.gz | zcat >> $DATADIR/$suite/Sources.new cat $DATADIR/$suite/Sources.new >> $DATADIR/$suite/Sources for arch in $ARCHES $PORTS_ARCHES; do mv $DATADIR/$suite/Packages_${arch}.new $DATADIR/$suite/Packages_${arch}.two.gz gunzip $DATADIR/$suite/Packages_${arch}.two cat $DATADIR/$suite/Packages_${arch}.two >> gunzip $DATADIR/$suite/Packages_${arch} done fi # ensure other necessary files are present touch $DATADIR/${SERIES}-proposed/Blocks touch $DATADIR/$SERIES/state/age-policy-dates