[26257] in Source-Commits
/svn/athena r25476 - trunk/debathena/scripts
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Mon May 7 12:27:34 2012
Date: Mon, 7 May 2012 12:27:33 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201205071627.q47GRX7g008659@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: jdreed
Date: 2012-05-07 12:27:33 -0400 (Mon, 07 May 2012)
New Revision: 25476
Modified:
trunk/debathena/scripts/daupload-proposed
trunk/debathena/scripts/sbuildhack
Log:
Use control fields instead of nobuild files (Trac #913)
Modified: trunk/debathena/scripts/daupload-proposed
===================================================================
--- trunk/debathena/scripts/daupload-proposed 2012-05-07 14:59:35 UTC (rev 25475)
+++ trunk/debathena/scripts/daupload-proposed 2012-05-07 16:27:33 UTC (rev 25476)
@@ -46,6 +46,21 @@
if [ "$1" = "-S" ]; then S=1; shift; fi
change=$1
+set +e
+NOBUILD=$(grep-dctrl -n -s Debathena-No-Build -F Debathena-No-Build -e . "$change")
+BUILDFOR=$(grep-dctrl -n -s Debathena-Build-For -F Debathena-Build-For -e . "$change")
+if [ -n "$NOBUILD" ] && [ -n "$BUILDFOR" ]; then
+ echo "Error: changes file contains both Debathena-Build-For and Debathena-No-Build"
+ echo "(This should never happen, since sbuildhack should have caught it.)"
+ exit 1
+fi
+if [ -z "$NOBUILD" ] && [ -z "$BUILDFOR" ] && [ -e nobuild ]; then
+ NOBUILD="$(cat nobuild)"
+ echo "NOTE: Please migrate ./nobuild to XSC-Debathena-No-Build!"
+fi
+
+
+set -e
cd "$(dirname "$change")"
change=$(basename "$change")
base=${change%_source.changes}
@@ -57,11 +72,13 @@
! [ -s "$1" ] || missing="$missing-$1 "
}
-# If ./nobuild exists, filter out its contents from DEBIAN_CODES.
-if [ -e nobuild ]; then
+# Adjust DEBIAN_CODES based on Debathena-Build-For or Debathena-No-Build
+if [ -n "$BUILDFOR" ]; then
+ DEBIAN_CODES=$BUILDFOR
+elif [ -n "$NOBUILD" ]; then
newcodes=
for code in $DEBIAN_CODES; do
- if ! fgrep -q "$code" nobuild; then
+ if ! echo $NOBUILD | fgrep -q "$code"; then
newcodes="$newcodes $code"
fi
done
Modified: trunk/debathena/scripts/sbuildhack
===================================================================
--- trunk/debathena/scripts/sbuildhack 2012-05-07 14:59:35 UTC (rev 25475)
+++ trunk/debathena/scripts/sbuildhack 2012-05-07 16:27:33 UTC (rev 25476)
@@ -22,11 +22,37 @@
EOF
if [ -z "$dist" ] || [ -z "$arch" ]; then usage; fi
-if [ -e nobuild ] && fgrep -q "$dist" nobuild; then
- echo "Skipping $dist since it is listed in ./nobuild."
+dscfile=
+for i in $@; do
+ if echo $i | grep -q '\.dsc$'; then
+ dscfile=$i
+ fi
+done
+
+NOBUILD=$(grep-dctrl -n -s Debathena-No-Build -F Debathena-No-Build -e . "$dscfile")
+BUILDFOR=$(grep-dctrl -n -s Debathena-Build-For -F Debathena-Build-For -e . "$dscfile")
+
+if [ -n "$NOBUILD" ] && [ -n "$BUILDFOR" ]; then
+ echo "It is an error to specify both Debathena-Build-For and Debathena-No-Build fields."
+ echo "Pick one and try again."
+ exit 1
+fi
+
+if [ -z "$NOBUILD" ] && [ -z "$BUILDFOR" ] && [ -e nobuild ]; then
+ NOBUILD="$(cat nobuild)"
+ echo "NOTE: Please migrate ./nobuild to XSC-Debathena-No-Build!"
+fi
+
+if [ -n "$NOBUILD" ] && echo "$NOBUILD" | fgrep -q "$dist"; then
+ echo "Skipping $dist since it is listed in the Debathena-No-Build field"
exit
fi
+if [ -n "$BUILDFOR" ] && ! echo "$BUILDFOR" | fgrep -q "$dist"; then
+ echo "Skipping $dist since it is not listed in the Debathena-Build-For field"
+ exit
+fi
+
sbuild --append-to-version=`gettag "$dist"` \
-d "$dist" --arch="$arch" \
--apt-update --apt-distupgrade \