summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-03-14 14:11:28 (GMT)
committerMartin Pitt <martin.pitt@ubuntu.com>2016-03-14 14:11:28 (GMT)
commitb794e4acb7d7f0bac28c266cb078e569a128fc8a (patch)
treee71eae0836f4fd68f6e04dc96a6ee95e0ee859a9
parentad37ae899f4e2441f8f2975c116f9ff4cdb4b926 (diff)
Fix regular expression for removing profile guarded dependencies
When running on hosts that don't support build profiles.
-rw-r--r--debian/changelog2
-rw-r--r--lib/adt_testbed.py2
-rwxr-xr-xtests/adt-run10
3 files changed, 13 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index bb0abf4..0a6fb3e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,8 @@ autopkgtest (3.20.1) UNRELEASED; urgency=medium
images.linuxcontainers.org does not have much else.
* lib/VirtSubproc.py, cmd_reboot(): Add workaround for dhclient hanging on
reboot (see LP #1556175).
+ * Fix regular expression for removing profile guarded dependencies on hosts
+ that don't support build profiles.
-- Martin Pitt <mpitt@debian.org> Fri, 11 Mar 2016 15:56:40 +0100
diff --git a/lib/adt_testbed.py b/lib/adt_testbed.py
index 3fc477e..c512d2d 100644
--- a/lib/adt_testbed.py
+++ b/lib/adt_testbed.py
@@ -850,7 +850,7 @@ fi
code = '''use Dpkg::Deps;
$supports_profiles = ($Dpkg::Deps::VERSION gt '1.04' or 0);
$origdeps = '%s';
- $origdeps =~ s/(^|,)[^<,]+<[^!>]+>//g if (!$supports_profiles);
+ $origdeps =~ s/(^|,)[^<,]+<[^!,>]+>//g if (!$supports_profiles);
$dep = deps_parse($origdeps, reduce_arch => 1, host_arch => '%s' %s);
$out = $dep->output();
# fall back to ignoring build profiles
diff --git a/tests/adt-run b/tests/adt-run
index 6283a82..923a68b 100755
--- a/tests/adt-run
+++ b/tests/adt-run
@@ -1122,6 +1122,16 @@ if ($pid) { # parent
self.assertIn(os.uname().sysname, info['kernel_version'])
self.assertEqual(info['virt_server'], 'adt-virt-null')
+ def test_versioned_depends(self):
+ '''Depends: with versions'''
+
+ # ensure that build profile sedding does not affect versioned dependencies
+ p = self.build_src('Test-Command: true\nDepends: base-files, coreutils (<< 99:1), bash (>= 0.1), coreutils (>=0.1~)\n', {})
+
+ (code, out, err) = self.adt_run(['-d', '-B', p + '//'])
+ self.assertEqual(code, 0, err)
+ self.assertIn('install-deps: architecture resolved: base-files, coreutils (<< 99:1), bash (>= 0.1), coreutils (>= 0.1~)', err)
+
def test_env_passing(self):
'''Pass environment variable to test'''