[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 Tue, 2016-06-21 at 21:38 +0200, Cyril Brulebois wrote:
> Hi,
> 
> Juerg Haefliger <juerg.haefliger@hpe.com> (2016-06-10):
> > Package: kernel-wedge
> > Version: 2.94
> > Severity: normal
> > Tags: patch
> > 
> > Module inclusion with wildcards should honor the KW_CHECK_NONFATAL
> > env variable and not error out if it's set and a wildcard
> > directory is not found.
> > 
> > This is in line with how missing non-optional modules are treated
> > when KW_CHECK_NONFATAL is set.
> > 
> > diff --git a/commands/preprocess b/commands/preprocess
> > index 045903b..1a54632 100755
> > --- a/commands/preprocess
> > +++ b/commands/preprocess
> > @@ -35,7 +35,7 @@ sub expandwildcards {
> >                 if (! -d "$moddir/$subdir") {
> >                         if (-d "$moddir/kernel/$subdir") {
> >                                 $subdir = "kernel/$subdir";
> > -                       } elsif ($checkdir) {
> > +                       } elsif ($checkdir && !length($ENV{KW_CHECK_NONFATAL}))
> > {
> >                                 die "pattern $pattern refers to nonexistent
> > subdirectory";
> >                         } else {
> >                                 return ();
> 
> Thanks for the report+patch.
> 
> Ben, since you've been pushing most code to kernel-wedge recently, do you concur?

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.

-- 
Ben Hutchings
[W]e found...that it wasn't as easy to get programs right as we had
thought.
... I realized that a large part of my life from then on was going to
be spent
in finding mistakes in my own programs. - Maurice Wilkes, 1949

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


Reply to: