Browse Source

Revert "dpkg-source: Generate Testsuite-Restrictions fields from test restrictions"

This reverts commit 9899bdcf9bde76d969b124abf0a898fcbb202c70.

This change is contentious and should have been discussed more widely.
Given that this has been live only for a couple of days, the impact
should be minimal, but still something to take into account once and
if this gets reintroduced, in the same or different form and shape.

Closes: #852820
Guillem Jover 7 years ago
parent
commit
d5a9cf8b9d

+ 5 - 0
debian/changelog

@@ -1,6 +1,11 @@
 dpkg (1.18.21) UNRELEASED; urgency=medium
 
   [ Guillem Jover ]
+  * Revert "Generate Testsuite-Restrictions fields from the test restrictions
+    in dpkg-source into .dsc files". This change is contentious and should
+    have been discussed more widely. Given that this has been live only for
+    a couple of days, the impact should be minimal, but still something to
+    take into account once and if this gets reintroduced. Closes: #852820
   * Perl modules:
     - Map alternative or old ELF machine types to canonical ones. We need
       those to match on the encoded ABI, otherwise dpkg-shlibdeps will not

+ 0 - 7
man/dsc.man

@@ -153,13 +153,6 @@ generated by this source package and meta-dependencies such as \fB@\fP or
 Rationale: this field is needed because otherwise to be able to get the
 test dependencies, each source package would need to be unpacked.
 .TP
-.BI Testsuite\-Restrictions: " name-list"
-This field declares the comma-separated union of all test restrictions
-(\fBRestrictions\fP fields in \fIdebian/tests/control\fP file).
-
-Rationale: this field is needed because otherwise to be able to get the
-test restrictions, each source package would need to be unpacked.
-.TP
 .BI Build\-Depends: " package-list"
 .TQ
 .BI Build\-Depends\-Arch: " package-list"

+ 1 - 6
scripts/Dpkg/Control/FieldsCore.pm

@@ -383,10 +383,6 @@ our %FIELDS = (
         allowed => ALL_SRC,
         separator => FIELD_SEP_COMMA,
     },
-    'Testsuite-Restrictions' => {
-        allowed => ALL_SRC,
-        separator => FIELD_SEP_COMMA,
-    },
     'Testsuite-Triggers' => {
         allowed => ALL_SRC,
         separator => FIELD_SEP_COMMA,
@@ -476,8 +472,7 @@ our %FIELD_ORDER = (
         qw(Format Source Binary Architecture Version Origin Maintainer
         Uploaders Homepage Standards-Version Vcs-Browser
         Vcs-Arch Vcs-Bzr Vcs-Cvs Vcs-Darcs Vcs-Git Vcs-Hg Vcs-Mtn
-        Vcs-Svn Testsuite Testsuite-Triggers Testsuite-Restrictions),
-        &field_list_src_dep(),
+        Vcs-Svn Testsuite Testsuite-Triggers), &field_list_src_dep(),
         qw(Package-List), @checksum_fields, qw(Files)
     ],
     CTRL_FILE_BUILDINFO() => [

+ 0 - 1
scripts/Makefile.am

@@ -326,7 +326,6 @@ test_data = \
 	t/dpkg_source/testsuite_1.dsc \
 	t/dpkg_source/testsuite_2.dsc \
 	t/dpkg_source/testsuite_3.dsc \
-	t/dpkg_source/testsuite_4.dsc \
 	t/merge_changelogs/ch-old \
 	t/merge_changelogs/ch-a \
 	t/merge_changelogs/ch-b \

+ 0 - 17
scripts/dpkg-source.pl

@@ -520,7 +520,6 @@ sub set_testsuite_fields
         $tests->load("$dir/debian/tests/control");
 
         set_testsuite_triggers_field($tests, $fields, @binarypackages);
-        set_testsuite_restrictions_field($tests, $fields);
     } elsif ($testsuite{autopkgtest}) {
         warning(g_('%s field contains value %s, but no tests control file %s'),
                 'Testsuite', 'autopkgtest', 'debian/tests/control');
@@ -551,22 +550,6 @@ sub set_testsuite_triggers_field
     $fields->{'Testsuite-Triggers'} = join ', ', sort keys %testdeps;
 }
 
-sub set_testsuite_restrictions_field
-{
-    my ($tests, $fields) = @_;
-    my %restrict;
-
-    # Never overwrite a manually defined field.
-    return if $fields->{'Testsuite-Restrictions'};
-
-    foreach my $test ($tests->get()) {
-        next unless $test->{Restrictions};
-
-        $restrict{$_} = 1 foreach (split /[,\s]+/, $test->{Restrictions});
-    }
-    $fields->{'Testsuite-Restrictions'} = join ', ', sort keys %restrict;
-}
-
 sub setopmode {
     my $opmode = shift;
 

+ 1 - 15
scripts/t/dpkg_source.t

@@ -16,7 +16,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 10;
+use Test::More tests => 8;
 use Test::Dpkg qw(test_neutralize_checksums);
 
 use File::Spec::Functions qw(rel2abs);
@@ -64,20 +64,12 @@ Architecture: all
 Description: test package
 TMPL_CONTROL
 
-my $tmpl_tests_control = <<'TMPL_TESTS_CONTROL';
-Test-Command: ${test-command}
-Depends: ${test-depends}
-Restrictions: ${test-restrictions}
-TMPL_TESTS_CONTROL
-
 my %default_substvars = (
     'source-name' => 'test-source',
     'source-version' => 0,
     'source-section' => 'test',
     'source-priority' => 'optional',
     'source-testsuite' => 'autopkgtest',
-    'test-command' => 'true',
-    'test-depends' => '@',
     'suite' => 'unstable',
     'urgency' => 'low',
     'maintainer' => 'Dpkg Developers <debian-dpkg@lists.debian.org>',
@@ -176,10 +168,4 @@ $dirname = gen_source('source-name' => 'testsuite',
                       'source-version' => 3);
 test_build_source($dirname);
 
-$dirname = gen_source('source-name' => 'testsuite',
-                      'source-version' => 4,
-                      'test-restrictions' => 'needs-root,build-needed  allow-stderr',
-                      'control-test' => $tmpl_tests_control);
-test_build_source($dirname);
-
 1;

+ 0 - 17
scripts/t/dpkg_source/testsuite_4.dsc

@@ -1,17 +0,0 @@
-Format: 3.0 (native)
-Source: testsuite
-Binary: test-binary
-Architecture: all
-Version: 4
-Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
-Standards-Version: 1.0
-Testsuite: autopkgtest
-Testsuite-Restrictions: allow-stderr, build-needed, needs-root
-Package-List:
- test-binary deb test optional arch=all
-Checksums-Sha1:
- 0000000000000000000000000000000000000000 0 testsuite_4.tar.xz
-Checksums-Sha256:
- 0000000000000000000000000000000000000000000000000000000000000000 0 testsuite_4.tar.xz
-Files:
- 00000000000000000000000000000000 0 testsuite_4.tar.xz