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

Bug#826952: kernel-wedge: preprocess should honor KW_CHECK_NONFATAL for wildcard inclusions



On Fri, 2016-07-01 at 11:02 +0200, Juerg Haefliger wrote:
> > 
> > I agree that this error shouldn't be fatal in case that variable is
> > set, but there should still be a warning.
> > 
> > Additionally, the variable test should exists() as well as length() to
> > avoid a Perl warning when the variable is not defined at all.  (find-
> > dups gets away with this because the embedded Perl script does not
> > enable warnings.)
> > 
> > Ben.
> 
> How about the following?
> 
> ...Juerg
> 
> 
> diff --git a/commands/preprocess b/commands/preprocess
> index 045903b..37b8e67 100755
> --- a/commands/preprocess
> +++ b/commands/preprocess
> @@ -35,9 +35,12 @@ sub expandwildcards {
>                 if (! -d "$moddir/$subdir") {
>                         if (-d "$moddir/kernel/$subdir") {
>                                 $subdir = "kernel/$subdir";
> -                       } elsif ($checkdir) {
> -                               die "pattern $pattern refers to nonexistent subdirectory";
>                         } else {
> +                               if ($checkdir) {
> +                                       print STDERR "missing module directory $pattern\n";

The directory is $subdir not $pattern.

Aside from that, I think this is good.

Ben.

> +                                       die if !(exists($ENV{KW_CHECK_NONFATAL}) &&
> +                                                length($ENV{KW_CHECK_NONFATAL}));
> +                               }
>                                 return ();
>                         }
>                 }
> 
> 
-- 

Ben Hutchings
All extremists should be taken out and shot.

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: