diff options
| author | Martin Pitt <martin.pitt@ubuntu.com> | 2015-09-10 10:29:25 (GMT) |
|---|---|---|
| committer | Martin Pitt <martin.pitt@ubuntu.com> | 2015-09-10 10:29:25 (GMT) |
| commit | 69561dae2fdc3c4a1ddbfcb0ac9d43305053fe3f (patch) | |
| tree | 985289cf740d00d2b759d174e92b036828b3b271 | |
| parent | 5f58ccd8cf7679cc958f3ef25825869277cf0ca5 (diff) | |
Add @builddeps@ build profile parsing fallback for libdpkg-perl < 1.04
Just ignore all build profiles for these old versions.
| -rw-r--r-- | debian/changelog | 2 | ||||
| -rw-r--r-- | lib/testdesc.py | 9 | ||||
| -rwxr-xr-x | tests/adt-run | 6 |
3 files changed, 14 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog index 0e447b5..71751b3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,8 @@ autopkgtest (3.17) UNRELEASED; urgency=medium of relying on the host locale's encoding. * tools/adt-setup-vm: Only configure eth0 in ifupdown if it actually exists, and then make sure it does not get renamed any more. + * Add @builddeps@ build profile parsing fallback for libdpkg-perl < 1.04; + just ignore all build profiles. -- Martin Pitt <mpitt@debian.org> Fri, 28 Aug 2015 05:29:25 +0200 diff --git a/lib/testdesc.py b/lib/testdesc.py index 0ba24f7..260b2fa 100644 --- a/lib/testdesc.py +++ b/lib/testdesc.py @@ -245,9 +245,14 @@ def _debian_build_deps_from_source(srcdir, testbed_arch): perl = subprocess.Popen(['perl', '-'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) code = '''use Dpkg::Deps; - $dep = deps_parse('%s', reduce_arch => 1, reduce_profiles => 1, + $supports_profiles = ($Dpkg::Deps::VERSION gt '1.04'); + $dep = deps_parse('%s', reduce_arch => 1, + reduce_profiles => $supports_profiles, build_dep => 1, host_arch => '%s'); - print $dep->output(), "\\n"; + $out = $dep->output(); + # fall back to ignoring build profiles + $out =~ s/ <[^ >]+>//g if (!$supports_profiles); + print $out, "\\n"; ''' % (deps, testbed_arch) deps = perl.communicate(code.encode('UTF-8'))[0].decode('UTF-8').strip() if perl.returncode != 0: diff --git a/tests/adt-run b/tests/adt-run index d8f8e34..df0831a 100755 --- a/tests/adt-run +++ b/tests/adt-run @@ -1416,9 +1416,13 @@ Restrictions: needs-root self.assertRegex(out, 'pass\s+PASS') self.assertIn('synthesised dependency bdepyes\n', err) - self.assertNotIn('bdepno', err) self.assertIn('synthesised dependency build-essential\n', err) + dpkg_deps_ver = subprocess.check_output(['perl', '-MDpkg::Deps', '-e', 'print $Dpkg::Deps::VERSION'], + universal_newlines=True) + if dpkg_deps_ver >= '1.04': + self.assertNotIn('bdepno', err) + def test_logfile(self): '''--log-file option''' |
