RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Choosing a test harness ...

From: Jeff Johnson <n3npq@mac.com>
Date: Fri 31 Aug 2007 - 17:19:04 CEST
Message-Id: <96DD0B92-D588-4871-B6EC-F6F47B61A09D@mac.com>

On Aug 31, 2007, at 10:57 AM, Anders F Björklund wrote:

> Jeff Johnson wrote:
>
>> My personal preference (today expect quixotic behavior) would be to  
>> replace
>> the test-harness driver with devtool, and add some additional  
>> stanzas to generate
>> test manifests using the globs from trpm.
>>
>> But I'd like to see any harness rather than none.
>
> I found some basic bugs with "rpm --version", "rpmbuild -ba  
> zlib.spec",
> and by running the two scripts that I call "rpmqa.py" and "rpmqa.pl":
>

Yah, the lazy perl/python loading is of the "brain fart" variety.

I can't tell you the number of times that I forget to add a new
symbol to the loader maps. Trivial but embarassing fix.

73 de Jeff

> #!/usr/bin/perl
>
> use RPM;
>
> my $ts = RPM::Transaction->new();
> my $it = $ts->packageiterator();
>
> while (my $pkg = $it->next() ) {
>   print $pkg->tag('name') . "-" . $pkg->tag('version') . "-" . $pkg- 
> >tag('release') . "\n";
> }
>
> $ts->closedb();
> undef $ts;
>
> #!/usr/bin/python
>
> import rpm
>
> ts = rpm.TransactionSet()
> mi = ts.dbMatch()
>
> for h in mi:
> 	print "%s-%s-%s" % (h['name'], h['version'], h['release'])
>
> And a similar thing using the C API called "rpmqa.c" which is much
> too long and boring to quote here, but looks pretty much the same.
>
> --anders
>
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> Developer Communication List                        rpm-devel@rpm5.org
Received on Fri Aug 31 17:19:07 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.