Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Trying to find perl logic

10 views
Skip to first unread message

Asad

unread,
Nov 9, 2012, 2:32:18 AM11/9/12
to beginners@perl.org"
Hi All ,

I have a requirement in Linux environement to check for an
application pre-requisites if rpm's are installed or not .

Like rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE}\n"
compat-libstdc++-*

rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE}\n" glibc-common-*

Where glibc-common- and compat-libstdc++- are rpm's . And I have for this
application to check 10 more rpm's in the list.

The other complexity is these rpm's have major and minor numbers . So the
rpm's should have minimum major number which would be in the list of rpm's
.Higher than that is ok .

for example :compat-libstdc++-296-2.96-138 is minimum version(major number
) required for the application to run sucessfully .

Any help in the right direction .



**

Thanks,

Shlomi Fish

unread,
Nov 9, 2012, 5:51:06 AM11/9/12
to begi...@perl.org
Hi Asad,
One option for you would be to parse the output of rpm -q --queryformat or rpm
-qa --queryformat. For doing this, look at:

* https://metacpan.org/release/IPC-Run

* https://metacpan.org/module/IPC::System::Simple

This functionality may also be provided by librpm (not sure about that) and
there are some rpm-related Perl wrappers for it on CPAN:

https://metacpan.org/search?q=rpm

Mageia Linux ships with perl-RPM2-1.0-5.mga3 and perl-RPM4-0.31-1.mga3 .

I sincerely hope all of this will help you.

Regards,

Shlomi Fish

--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Parody of "The Fountainhead" - http://shlom.in/towtf

When a FLOSS developer says they will work on something, he or she means
“maybe”.

Please reply to list if it's a mailing list post - http://shlom.in/reply .
0 new messages