+2010-03-12 Christopher Faylor <me+cygwin@cgf.cx>
+
+ * genini: Default to not worrying if "message" and "ldesc" don't exist.
+ Fix $val test which could have done the wrong thing if $val was zero.
+ (get): For 'message', parse the passed in value rather than $_. Return
+ undef on improperly formatted 'message' line.
+ (parse): Detect undef return from get and issue an error since it means
+ that the line wasn't parsed.
+
2010-03-11 Charles Wilson <cygwin@cwilson.fastmail.fm>
* genini (parsedir): Support tarballs whose name ends in gz,
sub myerror(@);
sub usage();
-my @okmissing;
+my @okmissing = qw'message ldesc';
my ($outfile, $help, $recursive);
my @cmp_fmts = qw(gz bz2 lzma xz);
unless $main::categories{lc $c};
}
}
- print "$key: ", $val, "\n" if $val;
+ print "$key: ", $val, "\n" if defined($val);
}
}
for my $what ('', "[prev]\n", "[test]\n") {
my $val = shift;
if ($keyhint eq 'message') {
- my ($kw, $rest) = /^(\S+)\s+(.*)$/;
+ my ($kw, $rest) = $val =~ /^([^"'\s]+)\s+(.*)$/;
+ return undef unless defined($kw) && defined($rest);
return $kw . ' ' . get($FH, 'ldesc', $rest);
} elsif (substr($val, 0, 1) ne '"') {
$val = '"'. $val . '"' if $keyhint eq 'ldesc' || $keyhint eq 'sdesc';
my $key = $1;
my $val = $2;
if ($key !~ /^(?:prev|curr|test)/) {
- $pkg{$pname}{$what}{$key} = get(\*F, $key, $val);
+ $val = get(\*F, $key, $val);
+ $pkg{$pname}{$what}{$key} = $val;
} else {
if ($key eq 'curr') {
$key = '';
}
$pkg{$pname}{$key}{'version'} = $val;
}
- next;
+ next if defined $val;
};
/^\[[^\]]+\]/ and do {
$what = $_ . "\n";