summaryrefslogtreecommitdiffstats
path: root/inspector
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-05-08 14:28:03 +0100
committerRichard Jones <rjones@redhat.com>2009-05-08 14:28:03 +0100
commit0faa5dde7b992ba11bb88f77b3424676c7c492e4 (patch)
tree14948be793fca09223d7ca3022b9ac7e1fbebd81 /inspector
parentfa7c8bb79b45aecdf65ed93635a42f3fdf301134 (diff)
downloadlibguestfs-0faa5dde7b992ba11bb88f77b3424676c7c492e4.tar.gz
libguestfs-0faa5dde7b992ba11bb88f77b3424676c7c492e4.tar.xz
libguestfs-0faa5dde7b992ba11bb88f77b3424676c7c492e4.zip
Generated code to support previous 2 commits.
Diffstat (limited to 'inspector')
-rwxr-xr-xinspector/virt-inspector.pl29
1 files changed, 28 insertions, 1 deletions
diff --git a/inspector/virt-inspector.pl b/inspector/virt-inspector.pl
index b2983b3d..a5ba0050 100755
--- a/inspector/virt-inspector.pl
+++ b/inspector/virt-inspector.pl
@@ -575,7 +575,34 @@ sub check_for_applications
local $_;
my $root_dev = shift;
- # XXX rpm -qa, look in Program Files, or whatever
+ my @apps;
+
+ my $os = $oses{$root_dev}->{os};
+ if ($os eq "linux") {
+ my $distro = $oses{$root_dev}->{distro};
+ if ($distro eq "redhat") {
+ my @lines = $g->command_lines
+ (["rpm", "-q", "-a", "--qf",
+ "%{name} %{epoch} %{version} %{release} %{arch}\n"]);
+ foreach (@lines) {
+ if (m/^(.*) (.*) (.*) (.*) (.*)$/) {
+ $epoch = $2;
+ $epoch = "" if $epoch eq "(none)";
+ my $app = {
+ name => $1,
+ epoch => $epoch,
+ version => $3,
+ release => $4,
+ arch => $5
+ };
+ push @apps, $app
+ }
+ }
+ }
+ } elsif ($os eq "windows") {
+ # This sucks ... XXX
+ XXX
+ }
}
sub check_for_kernels