summaryrefslogtreecommitdiffstats
path: root/knetworkconf/backends/platform.pl.in
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2012-06-12 04:16:20 +0200
committerSlávek Banko <slavek.banko@axis.cz>2012-06-12 04:16:20 +0200
commit59394e6b2950b9178cc3e99c6eea49af7a8d5917 (patch)
tree7b60d48b2d38dd89b2c8f409619465e94981200e /knetworkconf/backends/platform.pl.in
parentf0594c064a6d98f4eb1e40f312d38791b279cc44 (diff)
downloadtdeadmin-59394e6b2950b9178cc3e99c6eea49af7a8d5917.tar.gz
tdeadmin-59394e6b2950b9178cc3e99c6eea49af7a8d5917.zip
Update network configuration support for RHEL/Fedora
Thanks to Francois Andriot for the patch!
Diffstat (limited to 'knetworkconf/backends/platform.pl.in')
-rw-r--r--knetworkconf/backends/platform.pl.in33
1 files changed, 31 insertions, 2 deletions
diff --git a/knetworkconf/backends/platform.pl.in b/knetworkconf/backends/platform.pl.in
index a3b52bb..7c8269e 100644
--- a/knetworkconf/backends/platform.pl.in
+++ b/knetworkconf/backends/platform.pl.in
@@ -71,6 +71,8 @@ $PLATFORM_INFO = {
"redhat-7.3" => "Red Hat Linux 7.3 Valhalla",
"redhat-8.0" => "Red Hat Linux 8.0 Psyche",
"redhat-9" => "Red Hat Linux 9.0 Shrike",
+ "rhel-5" => "Enterprise Linux 5",
+ "rhel-6" => "Enterprise Linux 6",
"openna-1.0" => "OpenNA Linux 1.0 VSLC",
"mandrake-7.1" => "Linux Mandrake 7.1",
"mandrake-7.2" => "Linux Mandrake 7.2 Odyssey",
@@ -123,6 +125,9 @@ $PLATFORM_INFO = {
"fedora-3" => "Fedora Core 3 (Heidelberg)",
"fedora-4" => "Fedora Core 4 (Stentz)",
"fedora-5" => "Fedora Core 5 (Bordeaux)",
+ "fedora-15" => "Fedora 15 (LoveLock)",
+ "fedora-16" => "Fedora 16 (Verne)",
+ "fedora-17" => "Fedora 17 (Beefy Miracle)",
"rpath" => "rPath Linux",
"ark" => "Ark Linux",
};
@@ -191,6 +196,27 @@ sub check_redhat
return -1;
}
+sub check_rhel
+{
+ open RELEASE, "$gst_prefix/etc/redhat-release" or return -1;
+ while (<RELEASE>)
+ {
+ chomp;
+ if (
+ (/^CentOS release (\d)([\d\.]+)\s+.*/)
+ or (/^Scientific Linux release (\d)([\d\.]+)\s+.*/)
+ or (/^Red Hat Enterprise Linux \w release (\d)([\d\.]+)\s+.*/)
+ )
+ {
+ close RELEASE;
+ return "rhel-$1";
+ }
+ }
+ close RELEASE;
+ return -1;
+}
+
+
sub check_openna
{
open OPENNA, "$gst_prefix/etc/openna-release" or return -1;
@@ -343,7 +369,10 @@ sub check_fedora
$ver = $_;
chomp ($ver);
- if ($ver =~ /^Fedora Core release (\S+)/)
+ if (
+ ($ver =~ /^Fedora Core release (\S+)/)
+ or ($ver =~ /^Fedora release (\S+)/)
+ )
{
close FEDORA;
return "fedora-$1";
@@ -584,7 +613,7 @@ sub gst_platform_guess
my %check = (
# Red Hat check must run after Vine, Mandrake and Fedora, and Mandrake after BlackPanther
"Linux" => [ \&check_lsb, \&check_debian, \&check_caldera, \&check_suse, \&check_blackpanther, \&check_vine,
- \&check_fedora, \&check_mandrake, \&check_mandriva, \&check_conectiva, \&check_linuxppc, \&check_redhat, \&check_openna,
+ \&check_fedora, \&check_mandrake, \&check_mandriva, \&check_conectiva, \&check_linuxppc, \&check_rhel, \&check_redhat, \&check_openna,
\&check_turbolinux, \&check_slackware, \&check_vlos, \&check_gentoo, \&check_pld, \&check_rpath, \&check_archlinux, \&check_ark ],
"FreeBSD" => [ \&check_freebsd ],
"SunOS" => [ \&check_solaris ]