Skip to content
Browse files

added RHEL, Red Hat Linux & CrashBang Linux codenames, updated others

  • Loading branch information...
1 parent 6a1a6f1 commit 442dbd1170b71b19d6073f3098615726f614d85a @barbie committed Jun 5, 2012
Showing with 211 additions and 80 deletions.
  1. +11 −8 Changes
  2. +200 −72 lib/Devel/Platform/Info/Linux.pm
View
19 Changes
@@ -2,31 +2,34 @@ Revision history for Perl library Devel-Platform-Info
=====================================================
0.10 current
- - updated BSD derivative list.
- - fixed OpenSolaris/Solaris oslabel/osvers elements.
+ - updated BSD derivative list.
+ - fixed OpenSolaris/Solaris oslabel/osvers elements.
+ - added Red Hat Enterprise Linux & Red Hat Linux codenames.
+ - added CrunchBang Linux codenames.
+ - updated versions and codenames.
0.09 25/05/2011
- remove trailing newlines from Mac command results (JJ)
0.08 01/04/2011
- added Scientific Linux distro (as suggested by Norbert Gruener).
-0.07 13/01/2011
+0.07 13/01/2011
- updated several distribution codenames (Linux & Mac).
- documentation update.
-0.06 15/07/2010
+0.06 15/07/2010
- added requirement for Test-JSON-Meta-0.08 due to issues with old
versions of JSON not implementing the current API.
- - better 32/64 detection for BSD (thanks to Chris Williams for help)
- - upped version check of Test-JSON-Meta to ensure we have JSON v2.
+ - better 32/64 detection for BSD (thanks to Chris Williams for help)
+ - upped version check of Test-JSON-Meta to ensure we have JSON v2.
-0.05 12/07/2010
+0.05 12/07/2010
- updated Mac version check (Colin Newell).
- added Mac tests (Colin Newell).
- updated diag reference test (Colin Newell).
-0.04 04/07/2010
+0.04 04/07/2010
- fixed Solaris internal references.
- fixed BSD kernel version formatting.
- changed 'source' to be a hash not a string. (Colin's suggestion).
View
272 lib/Devel/Platform/Info/Linux.pm
@@ -4,7 +4,7 @@ use strict;
use warnings;
use vars qw($VERSION);
-$VERSION = '0.09';
+$VERSION = '0.10';
#----------------------------------------------------------------------------
@@ -21,23 +21,37 @@ my %commands = (
my %default = ();
+# http://en.wikipedia.org/wiki/Arch_Linux#Versions
my %archlinux = (
- '0.1' => 'Homer',
- '0.2' => 'Vega',
- '0.3' => 'Firefly',
- '0.4' => 'Dragon',
- '0.5' => 'Nova',
- '0.6' => 'Widget',
- '0.7' => 'Wombat',
- '0.8' => 'Voodoo',
- '2007.05' => 'Duke',
- '2007.08' => "Don't Panic",
- '2008.06' => 'Overlord',
- '2009.02' => '2009.02',
- '2009.08' => '2009.08',
- '2010.05' => '2010.05',
+ '0.1' => 'Homer',
+ '0.2' => 'Vega',
+ '0.3' => 'Firefly',
+ '0.4' => 'Dragon',
+ '0.5' => 'Nova',
+ '0.6' => 'Widget',
+ '0.7' => 'Wombat',
+ '0.8' => 'Voodoo',
+ '2007.05' => 'Duke',
+ '2007.08' => "Don't Panic",
+ '2008.06' => 'Overlord',
+ '2009.02' => '2009.02',
+ '2009.08' => '2009.08',
+ '2010.05' => '2010.05',
+ '2011.08.19' => '2011.08.19',
);
+# previously CrunchBang Linux hasn't normally used codenames, however from
+# version 10 they are using Debian releases as a base, and thus are using
+# Muppet Show characters to compliment the Toy Story characters as used by
+# Debian.
+
+my %crunch = (
+ '8.04.02' => 'Back in Black',
+ '10' => 'Statler',
+ '11' => 'Waldorf',
+);
+
+# http://en.wikipedia.org/wiki/Debian#Release_history
my %debian = (
'1.1' => 'buzz',
'1.2' => 'rex',
@@ -53,6 +67,7 @@ my %debian = (
'7.0' => 'wheezy',
);
+# http://en.wikipedia.org/wiki/Fedora_%28operating_system%29#Version_history
my %fedora = (
'1' => 'Yarrow',
'2' => 'Tettnang',
@@ -68,8 +83,13 @@ my %fedora = (
'12' => 'Constantine',
'13' => 'Goddard',
'14' => 'Laughlin',
+ '15' => 'Lovelock',
+ '16' => 'Verne',
+ '17' => 'Beefy Miracle',
+ '18' => 'Spherical Cow',
);
+# http://en.wikipedia.org/wiki/Mandriva_Linux#Versions
my %mandriva = (
'5.1' => 'Venice',
'5.2' => 'Leeloo',
@@ -99,25 +119,100 @@ my %mandriva = (
'2010.0' => 'Mandriva Linux 2010 (Adélie)',
'2010.1' => 'Mandriva Linux 2010 Spring',
'2010.2' => 'Mandriva Linux 2010.2',
+ '2011.0' => 'Hydrogen',
);
-my %ubuntu = (
- '4.10' => 'Warty Warthog',
- '5.04' => 'Hoary Hedgehog',
- '5.10' => 'Breezy Badger',
- '6.06' => 'Dapper Drake',
- '6.10' => 'Edgy Eft',
- '7.04' => 'Feisty Fawn',
- '7.10' => 'Gutsy Gibbon',
- '8.04' => 'Hardy Heron',
- '8.10' => 'Intrepid Ibex',
- '9.04' => 'Jaunty Jackalope',
- '9.10' => 'Karmic Koala',
- '10.04' => 'Lucid Lynx',
- '10.10' => 'Maverick Meerkat',
- '11.04' => 'Natty Narwhal',
+# http://en.wikipedia.org/wiki/Red_Hat_Linux#Version_history
+# http://fedoraproject.org/wiki/History_of_Red_Hat_Linux
+my %redhat = (
+ '0.8' => 'Preview',
+ '0.9' => 'Halloween',
+ '1.0' => q{Mother's Day},
+ '1.1' => q{Mother's Day+0.1},
+ '2.0' => '',
+ '2.1' => '',
+ '3.0.3' => 'Picasso',
+ '3.95' => 'Rembrandt',
+ '4.0' => 'Colgate',
+ '4.1' => 'Vanderbilt',
+ '4.2' => 'Biltmore',
+ '4.95' => 'Thunderbird',
+ '4.96' => 'Mustang',
+ '5.0' => 'Hurricane',
+ '5.1' => 'Manhattan',
+ '5.2' => 'Apollo',
+ '5.9' => 'Starbuck',
+ '6.0' => 'Hedwig',
+ '6.0.95' => 'Lorax',
+ '6.1' => 'Cartman',
+ '6.1.95' => 'Piglet',
+ '6.2' => 'Zoot',
+ '6.2.98' => 'Pinstripe',
+ '7' => 'Guinness',
+ '7.0.90' => 'Fisher',
+ '7.0.91' => 'Wolverine',
+ '7.1' => 'Seawolf',
+ '7.1.92' => 'Roswell',
+ '7.2' => 'Enigma',
+ '7.2.92' => 'Skipjack',
+ '7.3' => 'Valhalla',
+ '7.3.92' => 'Limbo',
+ '7.3.93' => 'Limbo',
+ '7.3.94' => 'Null',
+ '8.0' => 'Psyche',
+ '8.0.93' => 'Phoebe',
+ '9' => 'Shrike',
+ '9.0.93' => 'Severn',
);
+# http://en.wikipedia.org/wiki/Red_Hat_Enterprise_Linux#Version_history
+my %rhel = (
+ '2.1 AS' => 'Pensacola',
+ '2.1' => 'Pensacola',
+ '2.1.1' => 'Pensacola',
+ '2.1.2' => 'Pensacola',
+ '2.1.3' => 'Pensacola',
+ '2.1.4' => 'Pensacola',
+ '2.1.5' => 'Pensacola',
+ '2.1.6' => 'Pensacola',
+ '2.1.7' => 'Pensacola',
+ '2.1 ES' => 'Panama',
+ '3' => 'Taroon',
+ '3.0' => 'Taroon',
+ '3.1' => 'Taroon',
+ '3.2' => 'Taroon',
+ '3.3' => 'Taroon',
+ '3.4' => 'Taroon',
+ '3.5' => 'Taroon',
+ '3.6' => 'Taroon',
+ '3.7' => 'Taroon',
+ '3.8' => 'Taroon',
+ '3.9' => 'Taroon',
+ '4' => 'Nahant',
+ '4.1' => 'Nahant',
+ '4.2' => 'Nahant',
+ '4.3' => 'Nahant',
+ '4.4' => 'Nahant',
+ '4.5' => 'Nahant',
+ '4.6' => 'Nahant',
+ '4.7' => 'Nahant',
+ '4.8' => 'Nahant',
+ '4.9' => 'Nahant',
+ '5' => 'Tikanga',
+ '5.1' => 'Tikanga',
+ '5.2' => 'Tikanga',
+ '5.3' => 'Tikanga',
+ '5.4' => 'Tikanga',
+ '5.5' => 'Tikanga',
+ '5.6' => 'Tikanga',
+ '5.7' => 'Tikanga',
+ '5.8' => 'Tikanga',
+ '6' => 'Santiago',
+ '6.1' => 'Santiago',
+ '6.2' => 'Santiago',
+);
+
+# https://www.scientificlinux.org/about/history.short
my %scientific = (
'3.0.1' => 'Feynman',
'3.0.2' => 'Feynman',
@@ -137,56 +232,87 @@ my %scientific = (
'4.6' => 'Beryllium',
'4.7' => 'Beryllium',
'4.8' => 'Beryllium',
+ '4.9' => 'Beryllium',
'5.0' => 'Boron',
'5.1' => 'Boron',
'5.2' => 'Boron',
'5.3' => 'Boron',
'5.4' => 'Boron',
'5.5' => 'Boron',
+ '5.6' => 'Boron',
+ '5.7' => 'Boron',
+ '5.8' => 'Boron',
+ '5.9' => 'Boron',
'6.0' => 'Carbon',
+ '6.1' => 'Carbon',
+ '6.2' => 'Carbon',
+ '6.3' => 'Carbon',
+);
+
+# http://en.wikipedia.org/wiki/Ubuntu_%28operating_system%29#Releases
+my %ubuntu = (
+ '4.10' => 'Warty Warthog',
+ '5.04' => 'Hoary Hedgehog',
+ '5.10' => 'Breezy Badger',
+ '6.06' => 'Dapper Drake',
+ '6.10' => 'Edgy Eft',
+ '7.04' => 'Feisty Fawn',
+ '7.10' => 'Gutsy Gibbon',
+ '8.04' => 'Hardy Heron',
+ '8.10' => 'Intrepid Ibex',
+ '9.04' => 'Jaunty Jackalope',
+ '9.10' => 'Karmic Koala',
+ '10.04' => 'Lucid Lynx',
+ '10.10' => 'Maverick Meerkat',
+ '11.04' => 'Natty Narwhal',
+ '11.10' => 'Oneiric Ocelot',
+ '12.04' => 'Precise Pangolin',
+ '12.10' => 'Quantal Quetzal',
);
my %distributions = (
- 'Adamantix' => { codenames => \%default, files => [ qw( /etc/adamantix_version ) ] },
- 'Annvix' => { codenames => \%default, files => [ qw( /etc/annvix-release ) ] },
- 'Arch Linux' => { codenames => \%archlinux, files => [ qw( /etc/arch-release ) ] },
- 'Arklinux' => { codenames => \%default, files => [ qw( /etc/arklinux-release ) ] },
- 'Aurox Linux' => { codenames => \%default, files => [ qw( /etc/aurox-release ) ] },
- 'BlackCat' => { codenames => \%default, files => [ qw( /etc/blackcat-release ) ] },
- 'Cobalt' => { codenames => \%default, files => [ qw( /etc/cobalt-release ) ] },
- 'Conectiva' => { codenames => \%default, files => [ qw( /etc/conectiva-release ) ] },
- 'Debian' => { codenames => \%debian, key => 'debian', files => [ qw( /etc/debian_version /etc/debian_release ) ] },
- 'Fedora Core' => { codenames => \%fedora, key => 'fedora', files => [ qw( /etc/fedora-release ) ] },
- 'Gentoo Linux' => { codenames => \%default, key => 'gentoo', files => [ qw( /etc/gentoo-release ) ] },
- 'Immunix' => { codenames => \%default, files => [ qw( /etc/immunix-release ) ] },
- 'Knoppix' => { codenames => \%default, files => [ qw( /etc/knoppix_version ) ] },
- 'Libranet' => { codenames => \%default, files => [ qw( /etc/libranet_version ) ] },
- 'Linux-From-Scratch' => { codenames => \%default, files => [ qw( /etc/lfs-release ) ] },
- 'Linux-PPC' => { codenames => \%default, files => [ qw( /etc/linuxppc-release ) ] },
- 'Mandrake' => { codenames => \%mandriva, files => [ qw( /etc/mandrake-release ) ] },
- 'Mandriva' => { codenames => \%mandriva, files => [ qw( /etc/mandriva-release /etc/mandrake-release /etc/mandakelinux-release ) ] },
- 'Mandrake Linux' => { codenames => \%mandriva, files => [ qw( /etc/mandriva-release /etc/mandrake-release /etc/mandakelinux-release ) ] },
- 'MkLinux' => { codenames => \%default, files => [ qw( /etc/mklinux-release ) ] },
- 'Novell Linux Desktop' => { codenames => \%default, files => [ qw( /etc/nld-release ) ] },
- 'Pardus' => { codenames => \%default, key => 'pardus', files => [ qw( /etc/pardus-release ) ] },
- 'PLD Linux' => { codenames => \%default, files => [ qw( /etc/pld-release ) ] },
- 'Red Flag' => { codenames => \%default, key => 'redflag', files => [ qw( /etc/redflag-release ) ] },
- 'Red Hat' => { codenames => \%default, key => 'redhat', files => [ qw( /etc/redhat-release /etc/redhat_version ) ] },
- 'Scientific Linux' => { codenames => \%scientific, files => [ qw( /etc/lsb-release ) ] },
- 'Slackware' => { codenames => \%default, key => 'slackware', files => [ qw( /etc/slackware-version /etc/slackware-release ) ] },
- 'SME Server' => { codenames => \%default, files => [ qw( /etc/e-smith-release ) ] },
- 'Sun JDS' => { codenames => \%default, files => [ qw( /etc/sun-release ) ] },
- 'SUSE Linux' => { codenames => \%default, key => 'suse', files => [ qw( /etc/SuSE-release /etc/novell-release ) ] },
- 'SUSE Linux ES9' => { codenames => \%default, key => 'suse', files => [ qw( /etc/sles-release ) ] },
- 'Tiny Sofa' => { codenames => \%default, files => [ qw( /etc/tinysofa-release ) ] },
- 'Trustix Secure Linux' => { codenames => \%default, files => [ qw( /etc/trustix-release ) ] },
- 'TurboLinux' => { codenames => \%default, files => [ qw( /etc/turbolinux-release ) ] },
- 'Ubuntu Linux' => { codenames => \%ubuntu, files => [ qw( /etc/lsb-release ) ] },
- 'UltraPenguin' => { codenames => \%default, files => [ qw( /etc/ultrapenguin-release ) ] },
- 'UnitedLinux' => { codenames => \%default, files => [ qw( /etc/UnitedLinux-release ) ] },
- 'VA-Linux/RH-VALE' => { codenames => \%default, files => [ qw( /etc/va-release ) ] },
- 'Yellow Dog' => { codenames => \%default, files => [ qw( /etc/yellowdog-release ) ] },
- 'Yoper' => { codenames => \%default, files => [ qw( /etc/yoper-release ) ] },
+ 'Adamantix' => { codenames => \%default, files => [ qw( /etc/adamantix_version ) ] },
+ 'Annvix' => { codenames => \%default, files => [ qw( /etc/annvix-release ) ] },
+ 'Arch Linux' => { codenames => \%archlinux, files => [ qw( /etc/arch-release ) ] },
+ 'Arklinux' => { codenames => \%default, files => [ qw( /etc/arklinux-release ) ] },
+ 'Aurox Linux' => { codenames => \%default, files => [ qw( /etc/aurox-release ) ] },
+ 'BlackCat' => { codenames => \%default, files => [ qw( /etc/blackcat-release ) ] },
+ 'Cobalt' => { codenames => \%default, files => [ qw( /etc/cobalt-release ) ] },
+ 'Conectiva' => { codenames => \%default, files => [ qw( /etc/conectiva-release ) ] },
+ 'CrunchBang Linux' => { codenames => \%crunch, files => [ qw( /etc/lsb-release-crunchbang /etc/lsb-release ) ] },
+ 'Debian' => { codenames => \%debian, key => 'debian', files => [ qw( /etc/debian_version /etc/debian_release ) ] },
+ 'Fedora Core' => { codenames => \%fedora, key => 'fedora', files => [ qw( /etc/fedora-release ) ] },
+ 'Gentoo Linux' => { codenames => \%default, key => 'gentoo', files => [ qw( /etc/gentoo-release ) ] },
+ 'Immunix' => { codenames => \%default, files => [ qw( /etc/immunix-release ) ] },
+ 'Knoppix' => { codenames => \%default, files => [ qw( /etc/knoppix_version ) ] },
+ 'Libranet' => { codenames => \%default, files => [ qw( /etc/libranet_version ) ] },
+ 'Linux-From-Scratch' => { codenames => \%default, files => [ qw( /etc/lfs-release ) ] },
+ 'Linux-PPC' => { codenames => \%default, files => [ qw( /etc/linuxppc-release ) ] },
+ 'Mandrake' => { codenames => \%mandriva, files => [ qw( /etc/mandrake-release ) ] },
+ 'Mandriva' => { codenames => \%mandriva, files => [ qw( /etc/mandriva-release /etc/mandrake-release /etc/mandakelinux-release ) ] },
+ 'Mandrake Linux' => { codenames => \%mandriva, files => [ qw( /etc/mandriva-release /etc/mandrake-release /etc/mandakelinux-release ) ] },
+ 'MkLinux' => { codenames => \%default, files => [ qw( /etc/mklinux-release ) ] },
+ 'Novell Linux Desktop' => { codenames => \%default, files => [ qw( /etc/nld-release ) ] },
+ 'Pardus' => { codenames => \%default, key => 'pardus', files => [ qw( /etc/pardus-release ) ] },
+ 'PLD Linux' => { codenames => \%default, files => [ qw( /etc/pld-release ) ] },
+ 'Red Flag' => { codenames => \%default, key => 'redflag', files => [ qw( /etc/redflag-release ) ] },
+ 'Red Hat Enterprise Linux' => { codenames => \%rhel, key => 'rhel', files => [ qw( /etc/redhat-release /etc/redhat_version ) ] },
+ 'Red Hat Linux' => { codenames => \%redhat, key => 'redhat', files => [ qw( /etc/redhat-release /etc/redhat_version ) ] },
+ 'Scientific Linux' => { codenames => \%scientific, files => [ qw( /etc/lsb-release ) ] },
+ 'Slackware' => { codenames => \%default, key => 'slackware', files => [ qw( /etc/slackware-version /etc/slackware-release ) ] },
+ 'SME Server' => { codenames => \%default, files => [ qw( /etc/e-smith-release ) ] },
+ 'Sun JDS' => { codenames => \%default, files => [ qw( /etc/sun-release ) ] },
+ 'SUSE Linux' => { codenames => \%default, key => 'suse', files => [ qw( /etc/SuSE-release /etc/novell-release ) ] },
+ 'SUSE Linux ES9' => { codenames => \%default, key => 'suse', files => [ qw( /etc/sles-release ) ] },
+ 'Tiny Sofa' => { codenames => \%default, files => [ qw( /etc/tinysofa-release ) ] },
+ 'Trustix Secure Linux' => { codenames => \%default, files => [ qw( /etc/trustix-release ) ] },
+ 'TurboLinux' => { codenames => \%default, files => [ qw( /etc/turbolinux-release ) ] },
+ 'Ubuntu Linux' => { codenames => \%ubuntu, files => [ qw( /etc/lsb-release ) ] },
+ 'UltraPenguin' => { codenames => \%default, files => [ qw( /etc/ultrapenguin-release ) ] },
+ 'UnitedLinux' => { codenames => \%default, files => [ qw( /etc/UnitedLinux-release ) ] },
+ 'VA-Linux/RH-VALE' => { codenames => \%default, files => [ qw( /etc/va-release ) ] },
+ 'Yellow Dog' => { codenames => \%default, files => [ qw( /etc/yellowdog-release ) ] },
+ 'Yoper' => { codenames => \%default, files => [ qw( /etc/yoper-release ) ] },
);
my %version_pattern = (
@@ -196,12 +322,14 @@ my %version_pattern = (
'fedora' => 'Fedora Core release (\d+) \(',
'redflag' => 'Red Flag (?:Desktop|Linux) (?:release |\()(.*?)(?: \(.+)?\)',
'redhat' => 'Red Hat Linux release (.*) \(',
+ 'rhel' => 'Red Hat Enterprise Linux(?: Server)? release (.*) \(',
'slackware' => '^Slackware (.+)$',
'pardus' => '^Pardus (.+)$',
);
my %oslabel_pattern = (
'suse' => '^(\S+)',
+ 'rhel' => '(Red Hat Enterprise Linux(?: Server)?) release (.*) \(',
);
#----------------------------------------------------------------------------
@@ -220,7 +348,7 @@ sub get_info {
for my $cmd (keys %commands) {
$self->{cmds}{$cmd} = `$commands{$cmd} 2>/dev/null`;
$self->{cmds}{$cmd} =~ s/\s+$//s;
- $self->{info}{$cmd} = $self->{cmds}{$cmd} if($cmd =~ /^[^_]/);
+ $self->{info}{$cmd} = $self->{cmds}{$cmd} if($cmd !~ /^_/);
}
$self->{info}{osflag} = $^O;
@@ -373,7 +501,7 @@ RT Queue: http://rt.cpan.org/Public/Dist/Display.html?Name=Devel-Platform-Info
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2010-2011 Birmingham Perl Mongers
+ Copyright (C) 2010-2012 Birmingham Perl Mongers
This module is free software; you can redistribute it and/or
modify it under the Artistic License 2.0.

0 comments on commit 442dbd1

Please sign in to comment.
Something went wrong with that request. Please try again.