Possible freeze exception for autopkgtest

Ian Jackson ijackson at chiark.greenend.org.uk
Sun Jul 8 22:26:08 UTC 2012


Ian Jackson writes ("Re: Possible freeze exception for autopkgtest"):
> Uh, I asked about two possible uploads.  One of which needs me to
> review and test the patch so I only have a provisional diff.  The
> provisional diff is the final one in this bug report
>  http://bugs.debian.org/678359

After testing etc. I have finished this and the final debdiff is
below.  I'm about to upload it.

Ian.

diff -Nru autopkgtest-2.2.2/debian/changelog autopkgtest-2.2.3/debian/changelog
--- autopkgtest-2.2.2/debian/changelog	2012-06-28 01:36:43.000000000 +0100
+++ autopkgtest-2.2.3/debian/changelog	2012-07-08 23:16:05.000000000 +0100
@@ -1,3 +1,11 @@
+autopkgtest (2.2.3) unstable; urgency=medium
+
+  [ Martin Pitt ]
+  * Make `@' in tests' Depends work even if we're not building the
+    source tree.  Closes: #678359.  This is an important bugfix.
+
+ -- Ian Jackson <ijackson at chiark.greenend.org.uk>  Sun, 08 Jul 2012 23:15:42 +0100
+
 autopkgtest (2.2.2) unstable; urgency=low
 
   [ Martin Pitt ]
diff -Nru autopkgtest-2.2.2/debian/control autopkgtest-2.2.3/debian/control
--- autopkgtest-2.2.2/debian/control	2012-06-28 00:41:33.000000000 +0100
+++ autopkgtest-2.2.3/debian/control	2012-07-08 19:17:48.000000000 +0100
@@ -10,7 +10,7 @@
 
 Package: autopkgtest
 Architecture: all
-Depends: python (>= 2.6)
+Depends: python (>= 2.6), debhelper
 Conflicts: autodebtest (<< 0.5.3)
 Replaces: autodebtest (<< 0.5.3)
 Recommends: apt-utils, pbuilder
diff -Nru autopkgtest-2.2.2/runner/adt-run autopkgtest-2.2.3/runner/adt-run
--- autopkgtest-2.2.2/runner/adt-run	2012-06-28 00:41:33.000000000 +0100
+++ autopkgtest-2.2.3/runner/adt-run	2012-07-08 22:57:26.000000000 +0100
@@ -1090,7 +1090,7 @@
 			report('*', 'SKIP package has metadata but no tests')
 			errorcode |= 8
 		for t in tests:
-			t.prepare()
+			t.prepare(tree)
 			t.run(tree)
 			if 'breaks-testbed' in t.restriction_names:
 				testbed.needs_reset()
@@ -1116,7 +1116,7 @@
 	global errorcode
 	errorcode |= 4
 	report(t.what, 'FAIL ' + m)
- def prepare(t):
+ def prepare(t, tree):
 	t._debug('preparing')
 	dn = []
 	for d in t.depends:
@@ -1125,7 +1125,7 @@
 			t._debug('  literal dependency '+d)
 			dn.append(d)
 		else:
-			for (pkg,bin) in t.act.binaries:
+			for pkg in packages_from_source(t.act, tree):
 				dp = d.replace('@',pkg)
 				t._debug('  synthesised dependency '+dp)
 				dn.append(dp)
@@ -1205,19 +1205,11 @@
 
 	t._debug('----------------------------------------]')
 
-def read_control(act, tree, control_override):
+def read_stanzas(af):
 	stanzas = [ ]
 
-	if control_override is not None:
-		control_af = control_override
-		testbed.blame('arg:'+control_override.spec)
-	else:
-		if act.missing_tests_control:
-			return ()
-		control_af = RelativeInputFile(act.what+'-testcontrol',
-			tree, 'debian/tests/control')
 	try:
-		control = open(control_af.read(), 'r')
+		control = open(af.read(), 'r')
 	except (IOError,OSError), oe:
 		if oe[0] != errno.ENOENT: raise
 		return []
@@ -1261,6 +1253,21 @@
 		hcurrent.append((lno, l))
 	end_stanza(stz)
 
+        return stanzas
+
+def read_control(act, tree, control_override):
+
+	if control_override is not None:
+		control_af = control_override
+		testbed.blame('arg:'+control_override.spec)
+	else:
+		if act.missing_tests_control:
+			return ()
+		control_af = RelativeInputFile(act.what+'-testcontrol',
+			tree, 'debian/tests/control')
+
+        stanzas = read_stanzas(control_af)
+
 	def testbadctrl(stz, lno, m):
 		report_badctrl(lno, m)
 		stz[' errs'] += 1
@@ -1346,6 +1353,29 @@
 		act.pkg = m.groups()[0]
 	if not act.pkg: badpkg('no good Package: line in control file')
 
+def packages_from_source(act, tree):
+    (rc, output) = subprocess_cooked(['dh_listpackages'],
+            stdout=subprocess.PIPE, cwd=tree.read())
+    if rc: badpkg('failed to parse packages built from source, code %d' % rc)
+
+    # filter out empty lines
+    packages = [p for p in output.split() if p] 
+
+    # filter out udebs
+    control_af = RelativeInputFile(act.what+'-control',
+            tree, 'debian/control')
+    for st in read_stanzas(control_af):
+            if 'Package' not in st:
+                    # source stanza
+                    continue
+            if 'Xc-package-type' in st:
+                    try:
+                            packages.remove(st['Package'][0][1])
+                    except ValueError:
+                            pass
+
+    return packages
+
 class Binaries:
  def __init__(b, tb):
 	b.dir = TemporaryDir('binaries')



More information about the autopkgtest-devel mailing list