[23389] in Source-Commits
/svn/athena r23043 - trunk/debathena/third/common
daemon@ATHENA.MIT.EDU (ghudson@MIT.EDU)
Fri Jun 27 16:17:04 2008
Date: Fri, 27 Jun 2008 16:16:31 -0400 (EDT)
From: ghudson@MIT.EDU
Message-Id: <200806272016.QAA17834@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: ghudson
Date: 2008-06-27 16:16:30 -0400 (Fri, 27 Jun 2008)
New Revision: 23043
Modified:
trunk/debathena/third/common/debathenificator.sh
Log:
In debathenificator, fix the already-exists check to look for packages
with no Source: line. (Packages whose names match their source
package names do not have a Source: line; that would be too easy.)
Since dpkg-awk doesn't do disjunctions, switch to using reprepro
listfilter. This change has a number of subtle consequences but the
result should work for our purposes.
Modified: trunk/debathena/third/common/debathenificator.sh
===================================================================
--- trunk/debathena/third/common/debathenificator.sh 2008-06-27 14:44:00 UTC (rev 23042)
+++ trunk/debathena/third/common/debathenificator.sh 2008-06-27 20:16:30 UTC (rev 23043)
@@ -19,6 +19,9 @@
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
@@ -106,9 +109,6 @@
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,10 +133,15 @@
)
daversion=$version$daversionappend
-if zcat "$DEBATHENA_APT/dists/$dist/debathena-system/binary-$arch/Packages.gz" | \
- dpkg-awk -f - "Source:^$name\$" "Version:^$daversion~" -- Architecture | \
- if [ "$a" = "-A" ]; then cat; else fgrep -vx 'Architecture: all'; fi | \
- grep -q .; then
+# 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
echo "$name $daversion already exists for $dist_arch." >&2
exit 0
fi