Chris Lamb:
> This is an automated email from the git hooks/post-receive script.
> 
> lamby pushed a commit to branch master
> in repository lintian.
> 
> commit 76a12dd8be5bd2308918d4019a880d84ced00877
> Author: Chris Lamb <la...@debian.org>
> Date:   Sun Feb 4 09:36:00 2018 +0000
> 
>     Avoid emitting "Can't use an undefined value as an ARRAY reference" 
> warnings when debian/patches is a file, not a directory. (Closes: #889535)
> ---
>  checks/patch-systems.pm | 5 +++--
>  debian/changelog        | 4 ++++
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 

Hi,

Thanks for fixing this bug; just one comment.

> diff --git a/checks/patch-systems.pm b/checks/patch-systems.pm
> index cac174e..d73a653 100644
> --- a/checks/patch-systems.pm
> +++ b/checks/patch-systems.pm
> @@ -47,13 +47,14 @@ sub run {
>      my $droot = $info->index_resolved_path('debian/');
>      return if not $droot;
>      my $dpdir = $droot->resolve_path('patches');
> +    my $resolved;
>      my $patch_series;
>      my %known_files;
>  
>      # Find debian/patches/series, assuming debian/patches is a (symlink to a)
>      # dir.  There are cases, where it is a file (ctwm: #778556)
>      if ($dpdir and ($dpdir->is_dir or $dpdir->is_symlink)) {
> -        my $resolved = $dpdir->resolve_path;
> +        $resolved = $dpdir->resolve_path;
>          $patch_series = $resolved->resolve_path('series') if 
> $resolved->is_dir;
>      }
>  
> @@ -227,7 +228,7 @@ sub run {
>      }
>  
>      #----- look for unreferenced files in debian/patches
> -    if ($dpdir and $format ne '2.0') {
> +    if ($resolved and $format ne '2.0') {
>          # Check all series files, including $vendor.series
>          foreach my $file ($dpdir->children) {
>              next unless $file =~ /\/(.+\.)?series$/;
> [...]


This looks like it would still cause issues if d/patches is a symlink to
a file.  In that case, $resolved would still be valid path (to the
file).  Adding a "and $resolved->is_dir" should solve that.

Thanks,
~Niels

Reply via email to