[Rpm-maint] [Patch 06/19] Revert to using perl.req and .prov
James Olin Oden
james.oden at gmail.com
Fri Feb 16 18:14:00 UTC 2007
On 2/16/07, Paul Nasrat <pnasrat at redhat.com> wrote:
> On Fri, 2007-02-09 at 13:57 +0000, Paul Nasrat wrote:
> > On Fri, 2007-02-09 at 08:43 -0500, James Olin Oden wrote:
> > > <snip>
> > > > As I said this is meant as a merge of mostly functional changes, and I
> > > > want to look at the underlying methodologies individually, as such major
> > > > reworking getOutputFrom was beyond the scope of this patchset. My
> > > > prefered approach to fixing perl.req/prov was mentioned in an earlier
> > > > mail and I'd like to revisit how file class requires and provides are
> > > > handled generically.
> > > >
> James
>
> > > I'd be very interested in getting this script to work. With the
> > > packages sets I've used the "Turner" script after some mods I made
> > > seemed to produce the correct results and was way more readable (read
> > > maintable) than the old scripts.
> >
> > I think the main thing we might need to do is fix the script to work
> > with both files in @ARGV or files coming from <stdin>. I don't imagine
> > that's too much work. I just tried the same build with adding a quick
> > hack. The previous failing build now succeeds. I'm pretty sure this
> > isn't the nicest way to do the processing but perhaps you can use that
> > as a guide to how to fix properly:
> >
>
> Any chance you've checked to see if this looks sane, or is there a
> better way of dealing with using either ARGV or stdin in perl
>
Sorry I've been busy (sheesh I'm always busy).
In general you could use something:
use FileHandle;
#
# If we have files given on the command line then parse those otherwise
# use stdin:
if(scalar(@ARGV)) {
foreach my $perlFile (@ARGV) {
my $fh = FileHandle->new();
$fh->open($perlFile) ||
die "Could not open file (${perlFile}): $!";
parsePerlFile($fh) ||
die "Could not parse perl file (${perlFile}): $!";
}
} else {
parsePerlFile();
}
sub parsePerlFile {
my $fh = shift || STDIN;
#
# Do all the parsing here
return 1;
}
If you want I'll get mercurial setup this weekend and get you a patch
if you need one. I'm sure its easy, just fear of new stuff keeping at
bay.
Cheers...james
More information about the Rpm-maint
mailing list