[23408] in Source-Commits
/svn/athena r23062 - trunk/debathena/third/common
daemon@ATHENA.MIT.EDU (ghudson@MIT.EDU)
Mon Jul 7 14:48:12 2008
Date: Mon, 7 Jul 2008 14:47:58 -0400 (EDT)
From: ghudson@MIT.EDU
Message-Id: <200807071847.OAA08463@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: ghudson
Date: 2008-07-07 14:47:57 -0400 (Mon, 07 Jul 2008)
New Revision: 23062
Modified:
trunk/debathena/third/common/debathenificator.sh
Log:
In debathenificator, revert the most recent change and fix the problem
a different way.
Using reprepro introduced a locking problem which could cause packages
to be erroneously rebuilt if someone happens to be doing an upload
when autodebathenificator runs.
Instead, go back to using dpkg-awk, and just run it twice--once
looking for Source and once looking for Package.
Modified: trunk/debathena/third/common/debathenificator.sh
===================================================================
--- trunk/debathena/third/common/debathenificator.sh 2008-07-07 03:48:38 UTC (rev 23061)
+++ trunk/debathena/third/common/debathenificator.sh 2008-07-07 18:47:57 UTC (rev 23062)
@@ -19,9 +19,6 @@
dist=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\1/')
arch=$(echo "$dist_arch" | sed 's/^\(.*\)-\([^-]*\)$/\2/')
-. /mit/debathena/bin/debian-versions.sh
-tag=$(gettag $dist)
-
# Create a chroot and define functions for using it.
sid=$(schroot -b -c "$chroot")
trap 'schroot -e -c "$sid"' EXIT
@@ -109,6 +106,9 @@
REPREPRO="v reprepro -Vb $DEBATHENA_APT"
REPREPROI="$REPREPRO --ignore=wrongdistribution --ignore=missingfield"
+ . /mit/debathena/bin/debian-versions.sh
+ tag=$(gettag $dist)
+
if [ "$a" = "-A" ]; then
$REPREPROI include "$dist" "${name}_${daversion}_source.changes"
fi
@@ -133,15 +133,18 @@
)
daversion=$version$daversionappend
-# Avoid rebuilding anything we have already uploaded a package for.
-# Use reprepro to search for a binary package either named $name or
-# with the source $name, matching the expected version and current
-# architecture. This check will not work for sources which produce an
-# architecture-independent output, so it will have to be adapted if we
-# start debathenifying any of those.
-if reprepro -Vb "$DEBATHENA_APT" listfilter "$dist" \
- "(Source (== $name) | (!Source, Package (== $name)),
- Architecture (== $arch), Version (== $daversion$tag))" | grep -q .; then
+# Look for binary packages built from the named package with the right
+# version, and exit out if we find one (an architecture-specific one
+# if we weren't run with the -A flag). We need to look for either a
+# Source: or a Package: header matching $name since there is no
+# Source: header for a package whose name matches its source.
+pkgfile=$DEBATHENA_APT/dists/$dist/debathena-system/binary-$arch/Packages.gz
+if { zcat "$pkgfile" | \
+ dpkg-awk -f - "Package:^$name\$" "Version:^$daversion~" -- Architecture;
+ zcat "$pkgfile" | \
+ dpkg-awk -f - "Source:^$name\$" "Version:^$daversion~" -- Architecture; } \
+ | if [ "$a" = "-A" ]; then cat; else fgrep -vx 'Architecture: all'; fi \
+ | grep -q .; then
echo "$name $daversion already exists for $dist_arch." >&2
exit 0
fi