Re: Debhelper: Do not upgrade
On Sun, Jun 10, 2001 at 11:57:27PM -0700, Jeff Bailey wrote:
> Between debhelper 3.0.26, and 3.0.31 dh_gencontrol changed, and no
> longer works on the Hurd.
>
> I haven't filed a bug yet, because I think this is exposing a
> perl-on-hurd bug (dh_gencontrol works fine under Linux).
>
> I don't speak perl, so I might have this wrong, but:
>
> if (-e $varname) should test for the existance of a file, yes?
>
True.
> perl 5.6.1-3 appears to be returning true when $varname is blank. I get this theory because in verbose mode:
>
> my $substvars=pkgfile($package,"substvars");
> if (-e $substvars) {
> complex_doit("cat $substvars >> debian/${ext}substvars.debhelper");
> }
>
> displays:
>
> cat >> debian/foo.substvars.debhelper
>
a) To debug:
Before the test insert the line:
warn "substvars is ",$substvars; (if when run it says use of
uninitialized variable on line [of warn], then it is undef.
b) To bomb-proof the code:
modify the test to read:
if ((defined $substvars) and ($substvars) and (-e $substvars)) {
to test for a filename which:
1. is not undef
2. is not "" (or 0). If 0 is a vlaid filename, then modify the
second part of the test to read ($substvars ne ""), rather than
($substvars).
3. the file exists. (the original test).
> I don't know enough perl to be confident in my test case though. =( If
> noone answers, I'll ask one of my coworkers, though.
>
> Tks,
> Jeff Bailey
>
Bob
--
To the systems programmer, users and applications serve only to provide a
test load.
Reply to: