From: Matthijs Kooijman Date: Wed, 27 Jan 2010 16:46:12 +0000 (+0100) Subject: Update the rebuild script to use reprepro. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=e43078a4b6d0fb3670d245c3e390e95bcdfee9a0;p=apt-repository.git Update the rebuild script to use reprepro. --- diff --git a/rebuild b/rebuild index 60d1db0..97c08ac 100755 --- a/rebuild +++ b/rebuild @@ -1,12 +1,19 @@ #!/bin/sh + +# The location of the sources SOURCES=sources/equivs -PACKAGES=public/packages +# The codename of the archive to import into +CODENAME=stderr -mkdir -p $PACKAGES +# Save the root of the repository +cd `dirname $0` +REPO_ROOT=`pwd` -cd $PACKAGES +# Create our output dir +OUT_DIR=`mktemp -d` || exit 1 +cd $OUT_DIR -for i in ../../$SOURCES/*; do +for i in $REPO_ROOT/$SOURCES/*; do BASE=`basename "$i"` if [ -d "$i" ]; then echo "Skipping directory '$BASE'" @@ -28,13 +35,26 @@ for i in ../../$SOURCES/*; do echo "Skipping non-equivs file '$BASE'" continue; fi - if [ -f "${PACKAGE}_${VERSION}_all.deb" ]; then - echo "Skipping $PACKAGE, version $VERSION already built" - continue; + + # Find out what the current repostory version is. We simply take the + # first of the architectures in the output, since these are + # architecture all packages and should have the same version on all + # archs. + REPO_VERSION=`$REPO_ROOT/reprepro list "${CODENAME}" "${PACKAGE}" | head -1 | cut -d' ' -f 3` + if dpkg --compare-versions "${REPO_VERSION}" ge "${VERSION}"; then + echo "Not building version $VERSION of $PACKAGE, version $REPO_VERSION already in repository" + continue fi echo "Building version $VERSION of $PACKAGE" - equivs-build $i + equivs-build $i || exit 1 + + # Import the produced deb + $REPO_ROOT/reprepro includedeb "${CODENAME}" "${PACKAGE}_${VERSION}_all.deb" || exit 1 done -cd ../.. +# Conservatively delete our temporary directory (To prevent issues when +# $OUT_DIR got set to / for some reason or something like that) +cd / +rm -f $OUT_DIR/*.deb +rmdir $OUT_DIR