On 2013-04-06 18:33, Michael Stapelberg wrote: > Hi Niels, > > Niels Thykier <ni...@thykier.net> writes: >> [...] >> Almost; it definitely plugs the issues I mentioned. That said, I >> believe we prefer to emit tags instead of erroring out when we see an >> unexpected file type (e.g. see control-file-is-not-a-file). >> Secondly, there is a bug in that link_resolved is only applicable to >> links. So if it is not a regular file and not a link, the code will >> croak in $path->link_resolved[2]. > Okay, so how about this? > > sub check_init_script { > my ($pkg, $info, $file) = @_; > > my $lsb_source_seen; > my $path = $info->index ($file); > unless ($path->is_regular_file || > ($path->is_symlink && defined($path->link_resolved))) { > tag 'init-script-is-not-a-file', $file;
I think you are missing a return here? > } > open(my $fh, '<', $info->unpacked($file)) > or fail "cannot open $file: $!"; > # … > } > >> It really looks like a implementation of Text::ParseWords's >> shellwords[3]. If so, we can get that entire sub as a oneliner (we >> already use Text::ParseWords elsewhere). > I switched to shellwords. We can always rever to the code we’ve had > before, but in my tests, shellwords works fine. > Appreciated. > Find the new files attached. > ~Niels -- To UNSUBSCRIBE, email to debian-lint-maint-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/516064aa.6050...@thykier.net