X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=perl%2Flib%2FSys%2FGuestfs%2FLib.pm;h=31833bcf5c51550b115d73f47b6f3a9880e85074;hp=98cdb88358c344fe0804ff767ec060dbd9595157;hb=4851466ec5adbbc039222201f7c3b1bc3b97e84e;hpb=ed6fc794c8a2f64f8b987137b54551f4380177f3 diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm index 98cdb88..31833bc 100644 --- a/perl/lib/Sys/Guestfs/Lib.pm +++ b/perl/lib/Sys/Guestfs/Lib.pm @@ -814,6 +814,7 @@ sub _check_linux_root $_ = $g->cat ("/etc/redhat-release"); if (/Fedora release (\d+)(?:\.(\d+))?/) { + chomp; $r->{product_name} = $_; $r->{osdistro} = "fedora"; $r->{os_major_version} = "$1"; $r->{os_minor_version} = "$2" if(defined($2)); @@ -821,6 +822,8 @@ sub _check_linux_root } elsif (/(Red Hat Enterprise Linux|CentOS|Scientific Linux)/) { + chomp; $r->{product_name} = $_; + my $distro = $1; if($distro eq "Red Hat Enterprise Linux") { @@ -874,6 +877,7 @@ sub _check_linux_root $_ = $g->cat ("/etc/debian_version"); if (/(\d+)\.(\d+)/) { + chomp; $r->{product_name} = $_; $r->{osdistro} = "debian"; $r->{os_major_version} = "$1"; $r->{os_minor_version} = "$2"; @@ -1097,6 +1101,10 @@ Operating system userspace architecture, eg. "i386", "x86_64". Operating system distribution, eg. "debian". +=item product_name + +Free text product name. + =item major_version Operating system major version, eg. "4". @@ -1168,6 +1176,8 @@ sub _get_os_version my $r = shift; $r->{os} = $r->{root}->{fsos} if exists $r->{root}->{fsos}; + $r->{product_name} = $r->{root}->{product_name} + if exists $r->{root}->{product_name}; $r->{distro} = $r->{root}->{osdistro} if exists $r->{root}->{osdistro}; $r->{major_version} = $r->{root}->{os_major_version} if exists $r->{root}->{os_major_version};