Hi Asad, On Fri, 9 Nov 2012 13:02:18 +0530 Asad <asad.hasan2...@gmail.com> wrote:
> 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 . > 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 . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/