[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, vendor-profile, updated. 2.5.1-41-g912a1bf



The following commit has been merged in the vendor-profile branch:
commit 912a1bf162a6101c95840e8dd5a2974d0602b88d
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Jun 25 22:45:33 2011 +0200

    Renamed all Tag fields to use Tags instead
    
    Since the Enable-Tag, Disable-Tag and Tag fields actually take
    tag lists rather than a single tag, it is "less of a surprise" if
    they are named Tags instead of Tag.

diff --git a/doc/lintian.xml b/doc/lintian.xml
index bba5368..94d2965 100644
--- a/doc/lintian.xml
+++ b/doc/lintian.xml
@@ -646,7 +646,7 @@ foo source: configure-generated-file-in-source config.cache
               </listitem>
             </varlistentry>
             <varlistentry>
-	      <term><emphasis>Enable-Tag</emphasis> (folded, optional)</term>
+	      <term><emphasis>Enable-Tags</emphasis> (folded, optional)</term>
               <listitem>
 		<para> Comma-separated list of tags that should be
                 enabled.
@@ -654,7 +654,7 @@ foo source: configure-generated-file-in-source config.cache
               </listitem>
             </varlistentry>
             <varlistentry>
-              <term><emphasis>Disable-Tag</emphasis> (folded, optional)</term>
+              <term><emphasis>Disable-Tags</emphasis> (folded, optional)</term>
               <listitem>
 		<para>
 		  Comma-separated list of tags that should be
@@ -664,16 +664,17 @@ foo source: configure-generated-file-in-source config.cache
             </varlistentry>
 	  </variablelist>
           <para>
-            The profile is invalid and is rejected, if Enable-Tag and
-            Disable-Tag lists the same tag twice - even if it is in
+            The profile is invalid and is rejected, if Enable-Tags and
+            Disable-Tags lists the same tag twice - even if it is in
             the same field.  This holds analogously for
             Enable-Tags-From-Check and Disable-Tags-From-Check.
           </para>
           <para>
-            It is allowed to allowed to list a tag in Enable-Tag or
-            Disable-Tag even if the check that provides this tag is
-            listed in the Disable-Check or Enable-Check field. In case
-            of conflict, Enable-Tag / Disable-Tag shall overrule
+            It is allowed to allowed to list a tag in Enable-Tags or
+            Disable-Tags even if the check that provides this tag is
+            listed in the Disable-Tags-From-Check or
+            Enable-Tags-From-Check field. In case of conflict,
+            Enable-Tags / Disable-Tags shall overrule
             Disable-Tags-From-Check / Enable-Tags-From-Check within
             the profile.
           </para>
@@ -694,7 +695,7 @@ foo source: configure-generated-file-in-source config.cache
           </para>
 	  <variablelist>
             <varlistentry>
-	      <term><emphasis>Tag</emphasis> (folded, mandatory)</term>
+	      <term><emphasis>Tags</emphasis> (folded, mandatory)</term>
               <listitem>
 		<para>
 		  Comma separated list of tags affected by this
diff --git a/lib/Lintian/Profile.pm b/lib/Lintian/Profile.pm
index 552bd50..212e81f 100644
--- a/lib/Lintian/Profile.pm
+++ b/lib/Lintian/Profile.pm
@@ -160,12 +160,12 @@ sub _read_profile {
 
 sub _read_profile_section {
     my ($self, $pname, $section, $sno) = @_;
-    my @tags = $self->_split_comma_sep_field($section->{'tag'});
+    my @tags = $self->_split_comma_sep_field($section->{'tags'});
     my $overridable = $self->_parse_boolean($section->{'overridable'}, -1, $pname, $sno);
     my $severity = $section->{'severity'}//'';
     my $ignore_map = $self->{'ignored-overrides'};
     my $sev_map = $self->{'severity-changes'};
-    fail "Profile \"$pname\" is missing Tag field (or it is empty) in section $sno." unless @tags;
+    fail "Profile \"$pname\" is missing Tags field (or it is empty) in section $sno." unless @tags;
     fail "Profile \"$pname\" contains invalid severity \"$severity\" in section $sno."
         if $severity && !$SEVERITIES{$severity};
     foreach my $tag (@tags) {
@@ -184,7 +184,7 @@ sub _read_profile_section {
 sub _read_profile_tags{
     my ($self, $pname, $pheader) = @_;
     $self->_check_duplicates($pname, $pheader, 'enable-tags-from-check', 'disable-tags-from-check');
-    $self->_check_duplicates($pname, $pheader, 'enable-tag', 'disable-tag');
+    $self->_check_duplicates($pname, $pheader, 'enable-tags', 'disable-tags');
     my $tags_from_check_sub = sub {
         my ($field, $check) = @_;
         fail "Unknown check $check in $pname\n" unless exists $CHECK_MAP{$check};
@@ -197,8 +197,8 @@ sub _read_profile_tags{
     };
     $self->_enable_tags_from_field($pname, $pheader, 'enable-tags-from-check', $tags_from_check_sub, 1);
     $self->_enable_tags_from_field($pname, $pheader, 'disable-tags-from-check', $tags_from_check_sub, 0);
-    $self->_enable_tags_from_field($pname, $pheader, 'enable-tag', $tag_sub, 1);
-    $self->_enable_tags_from_field($pname, $pheader, 'disable-tag', $tag_sub, 0);
+    $self->_enable_tags_from_field($pname, $pheader, 'enable-tags', $tag_sub, 1);
+    $self->_enable_tags_from_field($pname, $pheader, 'disable-tags', $tag_sub, 0);
 }
 
 sub _enable_tags_from_field {
diff --git a/private/generate-profiles.pl b/private/generate-profiles.pl
index 3ca91fe..d55724e 100755
--- a/private/generate-profiles.pl
+++ b/private/generate-profiles.pl
@@ -9,10 +9,10 @@ use warnings;
 use constant LINE_LENGTH => 80;
 use constant FIELD_ORDER => ('Enable-Tags-From-Check',
                              'Disable-Tags-From-Check',
-                             'Enable-Tag',
-                             'Disable-Tag',
+                             'Enable-Tags',
+                             'Disable-Tags',
     );
-use constant PARAGRAPH_ORDER => ( 'Overridable' );
+use constant PARAGRAPH_ORDER => ( 'Overridable', 'Severity' );
 
 use lib "$ENV{LINTIAN_ROOT}/lib";
 use Lintian::Data;
@@ -43,9 +43,9 @@ generate_profile('debian/main', {
     });
 
 generate_profile('debian/ftp-master-auto-reject', {
-    'Enable-Tag' => [@fatal, @nonfatal],
+    'Enable-Tags' => [@fatal, @nonfatal],
     },
-    { 'Tag' => \@fatal,
+    { 'Tags' => \@fatal,
        'Overridable' => 'no',
     });
 
@@ -65,7 +65,7 @@ sub generate_profile {
     }
     print $fd "\n";
     foreach my $para (@other) {
-        format_field($fd, 'Tag', sort @{ $para->{'Tag'} });
+        format_field($fd, 'Tags', sort @{ $para->{'Tags'} });
         foreach my $f (PARAGRAPH_ORDER) {
             my $val = $para->{$f};
             next unless defined $val;
diff --git a/profiles/debian/ftp-master-auto-reject.profile b/profiles/debian/ftp-master-auto-reject.profile
index 9755254..104f256 100644
--- a/profiles/debian/ftp-master-auto-reject.profile
+++ b/profiles/debian/ftp-master-auto-reject.profile
@@ -1,6 +1,6 @@
 # This profile is auto-generated
 Profile: debian/ftp-master-auto-reject
-Enable-Tag: FSSTND-dir-in-usr, FSSTND-dir-in-var, arch-dependent-file-in-usr-share,
+Enable-Tags: FSSTND-dir-in-usr, FSSTND-dir-in-var, arch-dependent-file-in-usr-share,
  arch-independent-package-contains-binary-or-object, bad-package-name,
  bad-relation, bad-version-number, binary-file-compressed-with-upx,
  binary-in-etc, binary-or-shlib-defines-rpath, binary-with-bad-dynamic-table,
@@ -38,7 +38,7 @@ Enable-Tag: FSSTND-dir-in-usr, FSSTND-dir-in-var, arch-dependent-file-in-usr-sha
  usr-share-doc-symlink-to-foreign-package,
  usr-share-doc-symlink-without-dependency, wrong-file-owner-uid-or-gid
 
-Tag: FSSTND-dir-in-usr, FSSTND-dir-in-var, bad-package-name, bad-relation, bad-version-number,
+Tags: FSSTND-dir-in-usr, FSSTND-dir-in-var, bad-package-name, bad-relation, bad-version-number,
  binary-file-compressed-with-upx, binary-in-etc,
  build-info-in-binary-control-file-section, control-file-has-bad-owner,
  control-file-has-bad-permissions, control-interpreter-in-usr-local,
diff --git a/t/scripts/profiles-coverage.t b/t/scripts/profiles-coverage.t
index 0da9b15..5d81c2c 100755
--- a/t/scripts/profiles-coverage.t
+++ b/t/scripts/profiles-coverage.t
@@ -51,16 +51,16 @@ sub parse_profile {
     my ($header, @section) = Util::read_dpkg_control($profile);
     my $en_checks = $header->{'enable-tags-from-check'}//'';
     my $dis_checks = $header->{'disable-tags-from-check'}//'';
-    my $en_tag = $header->{'enable-tag'}//'';
-    my $dis_tag = $header->{'disable-tag'}//'';
+    my $en_tag = $header->{'enable-tags'}//'';
+    my $dis_tag = $header->{'disable-tags'}//'';
     foreach my $check (split m/\s*+,\s*+/o, $en_checks){
-        die "Unknown check in $profile.\n" unless $CHECKS{$check};
+        die "Unknown check ($check) in $profile.\n" unless $CHECKS{$check};
         foreach my $tag (@{$CHECKS{$check}}){
             $TAGS{$tag}++;
         }
     }
     foreach my $tag (split m/\s*+,\s*+/o, $en_tag){
-        die "Unknown tag in $profile.\n" unless exists $TAGS{$tag};
+        die "Unknown tag ($tag) in $profile.\n" unless exists $TAGS{$tag};
         $TAGS{$tag}++;
     }
 
@@ -73,8 +73,8 @@ sub parse_profile {
     }
     # ... and other fields
     foreach my $sect (@section){
-        foreach my $tag (split m/\s*+,\s*+/o, $sect->{'tag'}){
-            die "Unknown tag in $profile.\n" unless exists $TAGS{$tag};
+        foreach my $tag (split m/\s*+,\s*+/o, $sect->{'tags'}//''){
+            die "Unknown tag ($tag) in $profile.\n" unless exists $TAGS{$tag};
         }
     }
 }

-- 
Debian package checker


Reply to: