RPM Community Forums

Mailing List Message of <rpm-users>

Perl: Query with RPM-Perl in 5.x for a package?

From: Robert Scheck <robert@rpm5.org>
Date: Wed 13 Aug 2008 - 00:42:42 CEST
Message-ID: <20080812224242.GA13525@hurricane.linuxnetz.de>
Hello folks,

I know, that the rpm-perl part was completely rewritten with the 5.x
release series and I'm now trying to port my old rpm-perl 4.5 script.
I already read the man pages, but it seems just to confuse me and I
am not getting a usable result - note that, the man pages seem to be
incomplete ... ;-)

All I'm trying to do is: "rpm -q --qf '%{version}-%{release}\n' rpm"
using the perl interface. Old-style rpm-perl 4.5 was this:

  my $rpmdb = RPM->open_rpm_db();
  my $query = $rpmdb->find_by_name_iter("rpm");
  my $result = $query->next;
  print $result->as_nvre;

Any suggestions and ideas for the new rpm perl interface?

Received on Wed Aug 13 00:54:35 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.