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

[Git][lintian/lintian][master] Prevent issuance of tags under their old names.



Title: GitLab

Felix Lechner pushed to branch master at lintian / lintian

Commits:

3 changed files:

Changes:

  • lib/Lintian/Check/Testsuite.pm
    ... ... @@ -309,13 +309,13 @@ sub check_test_file {
    309 309
     
    
    310 310
                 my $debian_control = $self->processable->debian_control;
    
    311 311
     
    
    312
    -            $self->pointed_hint('declare-requested-python-versions-for-test',
    
    312
    +            $self->pointed_hint('declare-python-versions-for-test',
    
    313 313
                     $pointer, $command)
    
    314 314
                   if $options =~ m{ \s (?: -\w*r | --requested ) }x
    
    315 315
                   && !$debian_control->source_fields->declares(
    
    316 316
                     'X-Python3-Version');
    
    317 317
     
    
    318
    -            $self->pointed_hint('query-requested-python-versions-in-test',
    
    318
    +            $self->pointed_hint('query-declared-python-versions-in-test',
    
    319 319
                     $pointer,
    
    320 320
                     $debian_control->source_fields->value('X-Python3-Version'))
    
    321 321
                   if $options =~ m{ \s (?: -\w*s | --supported ) }x
    

  • lib/Lintian/Group.pm
    ... ... @@ -304,39 +304,50 @@ sub process {
    304 304
     
    
    305 305
             for my $hint (@from_checks) {
    
    306 306
     
    
    307
    -            my $tag_name = $hint->tag_name;
    
    307
    +            my $as_issued = $hint->tag_name;
    
    308 308
     
    
    309 309
                 croak encode_utf8('No tag name')
    
    310
    -              unless length $tag_name;
    
    310
    +              unless length $as_issued;
    
    311 311
     
    
    312 312
                 my $issuer = $hint->issued_by;
    
    313 313
     
    
    314 314
                 # try local name space
    
    315
    -            my $tag = $self->profile->get_tag("$issuer/$tag_name");
    
    315
    +            my $tag = $self->profile->get_tag("$issuer/$as_issued");
    
    316 316
     
    
    317 317
                 warn encode_utf8(
    
    318
    -"Using tag $tag_name as name spaced while not so declared (in check $issuer)."
    
    318
    +"Using tag $as_issued as name spaced while not so declared (in check $issuer)."
    
    319 319
                 )if defined $tag && !$tag->name_spaced;
    
    320 320
     
    
    321 321
                 # try global name space
    
    322
    -            $tag ||= $self->profile->get_tag($tag_name);
    
    322
    +            $tag ||= $self->profile->get_tag($as_issued);
    
    323 323
     
    
    324 324
                 unless (defined $tag) {
    
    325 325
                     warn encode_utf8(
    
    326
    -                    "Tried to issue unknown tag $tag_name in check $issuer.");
    
    326
    +                    "Tried to issue unknown tag $as_issued in check $issuer.");
    
    327
    +                next;
    
    328
    +            }
    
    329
    +
    
    330
    +            if (  !$tag->name_spaced && $tag->name ne $as_issued
    
    331
    +                || $tag->name_spaced && $tag->name ne "$issuer/$as_issued") {
    
    332
    +
    
    333
    +                my $current_name = $tag->name;
    
    334
    +                warn encode_utf8(
    
    335
    +"Tried to issue renamed tag $as_issued (current name $current_name) in check $issuer."
    
    336
    +                );
    
    337
    +
    
    327 338
                     next;
    
    328 339
                 }
    
    329 340
     
    
    330 341
                 my $owner = $tag->check;
    
    331 342
                 if ($issuer ne $owner) {
    
    332 343
                     warn encode_utf8(
    
    333
    -                    "Check $issuer has no tag $tag_name (but $owner does).");
    
    344
    +                    "Check $issuer has no tag $as_issued (but $owner does).");
    
    334 345
                     next;
    
    335 346
                 }
    
    336 347
     
    
    337 348
                 # pull name from tag; could be name-spaced
    
    338 349
                 $hint->tag_name($tag->name);
    
    339
    -            $tag_name = $hint->tag_name;
    
    350
    +            my $tag_name = $hint->tag_name;
    
    340 351
     
    
    341 352
                 # skip disabled tags
    
    342 353
                 next
    

  • tags/q/query-declared-python-versions-in-test.tag
    1
    -Tag:  query-declared-python-versions-in-test
    
    1
    +Tag: query-declared-python-versions-in-test
    
    2 2
     Severity: warning
    
    3 3
     Check: testsuite
    
    4 4
     Renamed-From:
    


  • Reply to: