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

[Git][lintian/lintian][master] Remove strict check for comma in "Origin" field in DEP3 header



Title: GitLab

Nilesh Patra pushed to branch master at lintian / lintian

Commits:

  • a1805c7a
    by Nilesh Patra at 2024-05-06T04:00:45+00:00
    Remove strict check for comma in "Origin" field in DEP3 header
    
    According to https://dep-team.pages.debian.net/deps/dep3/ it is optional.
    Added some extra validation checks for the value in origin field. It should
    either be a commit prefixed by "commit:" or a URL prefixed by http:// or https://
    

1 changed file:

Changes:

  • lib/Lintian/Check/Debian/Patches/Dep3.pm
    ... ... @@ -80,10 +80,16 @@ sub visit_patched_files {
    80 80
         # use last mention when present multiple times
    
    81 81
         my $origin = $deb822->last_mention('Origin');
    
    82 82
     
    
    83
    -    my ($category) = split(m{\s*,\s*}, $origin, 2);
    
    84
    -    $category //= $EMPTY;
    
    85
    -    return
    
    86
    -      if any { $category eq $_ } qw(upstream backport);
    
    83
    +    if ($origin =~ /,/) {
    
    84
    +        my ($category, $origin_value) = split(m{\s*,\s*}, $origin, 2);
    
    85
    +        $category //= $EMPTY;
    
    86
    +        return
    
    87
    +          if ($origin_value =~ /^(?:http|https):\/\/|commit:/)
    
    88
    +          && any { $category eq $_ } qw(upstream backport);
    
    89
    +    } else {
    
    90
    +        $origin =~ s/\s//g;
    
    91
    +        return if $origin =~ (/^(?:http|https):\/\/|commit:/);
    
    92
    +    }
    
    87 93
     
    
    88 94
         $self->pointed_hint('patch-not-forwarded-upstream', $item->pointer)
    
    89 95
           if $deb822->last_mention('Forwarded') eq 'no'
    


  • Reply to: