The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

RPM::Info

SYNOPSIS

#!/usr/bin/perl -w

use RPM::Info;

my $rpm = new Info(); my @rpms = (); my %filelist; my %info; my $dir = ""; my $info = ""; my @rpmreq = (); my $seek = "multi-gnome-terminal";

print "\nVer : ".$rpm->getRpmVer();

if ($rpm->getRpms(\@rpms, "gnome") == 0) { foreach (@rpms) { print "\nRPM:-> $_"; }

}

if ($rpm->getRpmFiles(\%filelist, $seek) == 0) { foreach $dir (keys(%filelist)) { print "\n\n\nDir : $dir"; foreach (@{$filelist{$dir}{'files'}}) { print "\nFile : $_"; } }

}

if ($rpm->getRpmInfo(\%info, $seek) == 0) { print "\n\nINFOS:"; foreach $info (keys(%info)) { print "\n$info : $info{$info}"; }

}

if ($rpm->getRpmRequirements(\@rpmreq, $seek) == 0) { print "\n\nREQUIREMENTS:"; foreach (@rpmreq) { print "\n$_"; }

}

DESCRIPTION

The RPM::Info module allows to get informations about installed RPM's like name, version, requirements, all files / directories containing to the RPM and so on,

AUTHOR

Andreas Mahnke

Methods:

new

creates a new object of the class

getRpms(result(Array Reference), search pattern(scalar))

searches for all installed rpm's containing the search pattern and saves them in an Array

if no search pattern is refered, all installed rpm's are saved

returns 0 on succes - 1 on failure

getRpmFiles((result(Hash Reference), rpmname(scalar))

searches for all files and directories which belong to the refered rpm - name and saves them in a Hash of Hashes

returns 0 on succes - 1 on failure

getRpmVer()

gets the version of rpm and returns it

getRpmInfo((result(Hash Reference), rpmname(scalar))

gets Infos about the specified rpm and saves them into a Hash of Hashes

returns 0 on succes - 1 on failure

getRpmRequirements((result(Array Reference), rpmname(scalar))

gets all the requirements of the specified rpm and saves them into an array

returns 0 on succes - 1 on failure