[Setup-tool-hackers] PATCH: PLD Distribution support



Hi!
Here is a patch, which adds support for PLD Linux Distribution
(http://pld.org.pl) to gst. It was made against 0.24.0 version of gst.
This patch is divided into 2 parts:
- gnome-system-tools-PLD.patch: patches backends files
- gnome-system-tools-pld_icon.patch: adds PLD icon to distributions list

There is also PLD logo icon in attachment.

-- 
<===========================>
$+>>  Grzegorz Golawski  <<+$
$+>>  grzegol@pld.org.pl <<+$
<===========================>
diff -urN aaa/gnome-system-tools-0.24.0/src/common/xst-platform.c gnome-system-tools-0.24.0/src/common/xst-platform.c
--- aaa/gnome-system-tools-0.24.0/src/common/xst-platform.c	Fri Nov 22 19:24:55 2002
+++ gnome-system-tools-0.24.0/src/common/xst-platform.c	Sun Apr 27 21:39:39 2003
@@ -37,6 +37,7 @@
 extern GdkPixbuf *suse;
 extern GdkPixbuf *freebsd;
 extern GdkPixbuf *gentoo;
+extern GdkPixbuf *pld;
 
 XstPlatform *
 xst_platform_new (const gchar *key, const gchar *name)
@@ -148,6 +149,8 @@
 		return freebsd;
 	else if (g_ascii_strncasecmp (platform->name, "Gentoo", 6) == 0)
 		return gentoo;
+	else if (g_ascii_strncasecmp (platform->name, "PLD", 3) == 0)
+		return pld;
 	else return NULL;
 }
 
diff -urN aaa/gnome-system-tools-0.24.0/src/common/xst-tool.c gnome-system-tools-0.24.0/src/common/xst-tool.c
--- aaa/gnome-system-tools-0.24.0/src/common/xst-tool.c	Wed Feb 19 19:31:19 2003
+++ gnome-system-tools-0.24.0/src/common/xst-tool.c	Sun Apr 27 21:43:06 2003
@@ -64,6 +64,7 @@
 GdkPixbuf *suse;
 GdkPixbuf *freebsd;
 GdkPixbuf *gentoo;
+GdkPixbuf *pld;
 
 enum {
 	BOGUS,
@@ -553,6 +554,7 @@
 	suse = gdk_pixbuf_new_from_file (PIXMAPS_DIR "/suse.png", NULL);
 	freebsd = gdk_pixbuf_new_from_file (PIXMAPS_DIR "/freebsd.png", NULL);
 	gentoo = gdk_pixbuf_new_from_file (PIXMAPS_DIR "/gentoo.png", NULL);
+	pld = gdk_pixbuf_new_from_file (PIXMAPS_DIR "/pld.png", NULL);
 }
 
 static void
diff -urN aaa/gnome-system-tools-0.24.0/backends/boot-conf.in gnome-system-tools-0.24.0/backends/boot-conf.in
--- aaa/gnome-system-tools-0.24.0/backends/boot-conf.in	Sat Mar  8 02:02:01 2003
+++ gnome-system-tools-0.24.0/backends/boot-conf.in	Tue Apr 29 12:35:23 2003
@@ -5,8 +5,9 @@
 #
 # Copyright (C) 2000-2001 Ximian, Inc.
 #
-# Authors: Tambet Ingo     <tambet@ximian.com>
-#          Arturo Espinosa <arturo@ximian.com>
+# Authors: Tambet Ingo       <tambet@ximian.com>
+#          Arturo Espinosa   <arturo@ximian.com>
+#          Grzegorz Golawski <grzegol@pld.org.pl> (PLD Support)
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Library General Public License as published
@@ -68,7 +69,7 @@
               
               "suse-7.0", "turbolinux-7.0",
 
-              "slackware-9.0");
+              "slackware-9.0", "pld-1.0");
 
 $description =<<"end_of_description;";
        Configures Boot manager (LILO and GRUB at the moment).
diff -urN aaa/gnome-system-tools-0.24.0/backends/network-conf.in gnome-system-tools-0.24.0/backends/network-conf.in
--- aaa/gnome-system-tools-0.24.0/backends/network-conf.in	Tue Jan 14 22:26:20 2003
+++ gnome-system-tools-0.24.0/backends/network-conf.in	Tue Apr 29 12:35:34 2003
@@ -8,6 +8,7 @@
 # Authors: Hans Petter Jansson <hpj@ximian.com>
 #          Michael Vogt <mvo@debian.org> (Debian Support)
 #          Arturo Espinosa <arturo@ximian.com>
+#          Grzegorz Golawski <grzegol@pld.org.pl> (PLD Support)
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Library General Public License as published
@@ -73,7 +74,7 @@
               
               "debian-2.2", "debian-woody", "debian-sarge",
               
-              "suse-7.0", "turbolinux-7.0");
+              "suse-7.0", "turbolinux-7.0", "pld-1.0");
 
 $description =<<"end_of_description;";
        Configures all network parameters and interfaces.
diff -urN aaa/gnome-system-tools-0.24.0/backends/network.pl.in gnome-system-tools-0.24.0/backends/network.pl.in
--- aaa/gnome-system-tools-0.24.0/backends/network.pl.in	Thu Feb  6 20:12:05 2003
+++ gnome-system-tools-0.24.0/backends/network.pl.in	Tue Apr 29 12:43:22 2003
@@ -9,6 +9,7 @@
 #          Arturo Espinosa <arturo@ximian.com>
 #          Michael Vogt <mvo@debian.org> - Debian 2.[2|3] support.
 #          David Lee Ludwig <davidl@wpi.edu> - Debian 2.[2|3] support.
+#          Grzegorz Golawski <grzegol@pld.org.pl> - PLD support
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Library General Public License as published
@@ -142,7 +143,8 @@
        "debian-sarge" => "debian-2.2",
        "mandrake-7.1" => "debian-2.2",
        "mandrake-7.2" => "debian-2.2",
-       "suse-7.0"     => "debian-2.2" # FIXME: assumed that only redhat distros use -b.
+       "suse-7.0"     => "debian-2.2", # FIXME: assumed that only redhat distros use -b.
+       "pld-1.0"      => "redhat-6.2"
        );
 
   return $cmd_map{$dist_map{$xst_dist}};
@@ -576,6 +578,12 @@
   return @ret;
 }
 
+sub xst_network_sysconfig_pld10_ifaces_get_existing
+{
+  return @{&xst_network_sysconfig_dir_ifaces_get_existing ("/etc/sysconfig/interfaces")};
+}
+
+
 sub xst_network_suse70_parse_iface_num
 {
   my ($file, $dev) = @_;
@@ -998,6 +1006,25 @@
   return $i;
 }
 
+sub xst_network_pld10_get_file
+{
+  my ($iface) = @_;
+  my ($pre, $i, $dev);
+                                                                                
+  $dev = $$iface{"dev"};
+  $pre = "$xst_prefix/etc/sysconfig/interfaces/ifcfg-";
+                                                                                
+  return $dev if ! -e "$pre$dev";
+                                                                                
+  $dev =~ s/[0-9]*$//;
+                                                                                
+  $i = 0;
+  $i ++ while (-e "$pre$dev$i");
+                                                                                
+  return "$dev$i";
+}
+
+
 sub xst_network_get_file
 {
   my ($iface) = @_;
@@ -1018,7 +1045,8 @@
     "debian-woody" => \&xst_network_deb22_get_file,
     "debian-sarge" => \&xst_network_deb22_get_file,
     "suse-7.0"     => \&xst_network_suse70_get_file,
-	  "turbolinux-7.0"   => \&xst_network_rh62_get_file
+	  "turbolinux-7.0"   => \&xst_network_rh62_get_file,
+    "pld-1.0"      => \&xst_network_pld10_get_file
 	  );
 
   $proc = $dist_map{$xst_dist};
@@ -1366,6 +1394,26 @@
   &xst_replace_sh ($file, "IFCONFIG_$dev", "");
 }
 
+sub xst_network_pld10_interface_delete
+{
+  my ($old_hash) = @_;
+  my $dev = $$old_hash{"file"};
+  my $file = "$xst_prefix/etc/sysconfig/interfaces/ifcfg-$dev";
+  my $login;
+                                                                                
+  &xst_network_rh62_interface_activate_by_dev ($dev, 0);
+                                                                                
+  $login = $old_hash{"login"};
+  if ($login ne "")
+  {
+    &xst_network_remove_pap_entry ("/etc/ppp/pap-secrets", $login);
+    &xst_network_remove_pap_entry ("/etc/ppp/chap-secrets", $login);
+  }
+                                                                                
+  unlink ($file);
+}
+
+
 sub xst_network_interface_changed
 {
     my ($iface, $iface_old) = @_;
@@ -1771,6 +1819,43 @@
   return &xst_network_suse70_replace_iface_sh ($file, $iface, "IFCONFIG", $val);
 }
 
+sub xst_network_pld10_parse_bootproto
+{
+  my ($file, $key) = @_;
+  my %pld10_to_proto_name =
+	 (
+    "bootp" => "bootp",
+	  "dhcp"  => "dhcp",
+    "pump"  => "pump",
+	  "none"  => "none"
+	  );
+  my $ret;
+
+  $ret = &xst_parse_sh ($file, $key);
+  
+  if (!exists $pld10_to_proto_name{$ret})
+  {
+    &xst_report ("network_bootproto_unsup", $file, $ret);
+    $ret = "none";
+  }
+  return $pld10_to_proto_name{$ret};
+}
+
+sub xst_network_pld10_replace_bootproto
+{
+  my ($file, $key, $value) = @_;
+  my %proto_name_to_pld10 =
+	 (
+    "bootp"    => "bootp",
+	  "dhcp"     => "dhcp",
+    "pump"     => "pump",
+	  "none"     => "none"
+	  );
+
+  return &xst_replace_sh ($file, $key, $proto_name_to_pld10{$value});
+}
+
+
 sub xst_network_pump_iface_supported
 {
   my ($iface) = @_;
@@ -1912,6 +1997,81 @@
   return &xst_file_buffer_save ($buff, $file);
 }
 
+# Return IP address or netmask, depending on $what
+sub xst_network_pld10_get_ipaddr
+{
+  my ($file, $key, $what) = @_;
+  my ($ipaddr, $netmask, $ret, $i);
+	my @netmask_prefixes = (0, 128, 192, 224, 240, 248, 252, 254, 255);
+  
+  $ipaddr = &xst_parse_sh($file, $key);
+  return undef if $ipaddr eq "";
+  
+  if($ipaddr =~ /([^\/]*)\/([[:digit:]]*)/)
+  {
+    $netmask = $2;
+    return undef if $netmask eq "";
+
+    if($what eq "address")
+    {
+      return $1;
+    }
+
+    for($i = 0; $i < int($netmask/8); $i++)
+    {
+      $ret .= "255.";
+    }
+
+    $ret .= "$netmask_prefixes[$b%8]." if $netmask < 32;
+
+    for($i = int($netmask/8) + 1; $i < 4; $i++)
+    {
+      $ret .= "0.";
+    }
+
+    chop($ret);
+    return $ret;
+  }
+  return undef;
+}
+
+# Writes IP address or netmask, depending in $what, to $file
+sub xst_network_pld10_set_ipaddr
+{
+  my ($file, $key, $what, $value) = @_;
+  my %prefixes =
+  (
+    "0"   => 0,
+    "128" => 1,
+    "192" => 2,
+    "224" => 3,
+    "240" => 4,
+    "248" => 5,
+    "252" => 6,
+    "254" => 7,
+    "255" => 8
+  );
+  my ($ipaddr, $netmask);
+
+  $ipaddr = &xst_parse_sh($file, $key);
+  return undef if $ipaddr eq "";
+
+  if($what eq "address")
+  {
+    $ipaddr =~ s/.*\//$value\//;
+  }
+	else
+  {
+    if($value =~ /([[:digit:]]*).([[:digit:]]*).([[:digit:]]*).([[:digit:]]*)/)
+    {
+      $netmask = $prefixes{$1} + $prefixes{$2} + $prefixes{$3} + $prefixes{$4};
+      $ipaddr =~ s/\/[[:digit:]]*/\/$netmask/;
+    }
+  }
+
+  return &xst_replace_sh($file, $key, $ipaddr);
+}
+
 # Set dist_map for your distro to "" if you don't want
 # loopback ensuring. See suse-7.0 entry for example.
 sub xst_network_ensure_loopback_interface
@@ -1934,7 +2094,8 @@
     "debian-woody" => "lo",
     "debian-sarge" => "lo",
     "suse-7.0"     => "",
-	  "turbolinux-7.0"   => "lo"
+	  "turbolinux-7.0"   => "lo",
+    "pld-1.0"      => "lo"
 	  );
 
   $dev = $dist_map {$xst_dist};
@@ -2033,7 +2194,8 @@
     "debian-woody" => "debian-2.2",
     "debian-sarge" => "debian-2.2",
     "suse-7.0"     => "suse-7.0",
-	  "turbolinux-7.0"   => "redhat-7.0"
+	  "turbolinux-7.0"   => "redhat-7.0",
+    "pld-1.0"      =>  "pld-1.0"
 	  );
 
   my %dist_tables =
@@ -2227,6 +2389,42 @@
 		    [ "interface_tmp", \&xst_network_interfaces_get ],
         [ "interface",     \&xst_network_suse70_get_ppp,         "%dialing%", "%interface_tmp%" ],
 		    ]
+			 },
+
+	  "pld-1.0" =>
+	  {
+	    fn =>
+	    {
+        SYSCONFIG_NW => "/etc/sysconfig/network",
+        RESOLV_CONF  => "/etc/resolv.conf",
+        HOST_CONF    => "/etc/host.conf",
+        HOSTS        => "/etc/hosts",
+        SMB_CONF     => "/etc/smb/smb.conf",
+        WVDIAL       => "/etc/wvdial.conf"
+      },
+	    table =>
+		   [
+		    [ "hostname",      \&xst_parse_sh,                SYSCONFIG_NW, HOSTNAME ],
+        [ "gateway",       \&xst_parse_sh,                SYSCONFIG_NW, GATEWAY ],
+        [ "gatewaydev",    \&xst_parse_sh,                SYSCONFIG_NW, GATEWAYDEV ],
+        [ "userifacectl",  \&xst_parse_trivial,           1 ],
+		    [ "nameserver",    \&xst_parse_split_all_unique_hash_comment, RESOLV_CONF,  "nameserver", "[ \t]+" ],
+		    [ "searchdomain",  \&xst_parse_split_first_array_unique, RESOLV_CONF,  "search", "[ \t]+", "[ \t]+" ],
+		    [ "domain",        \&xst_parse_split_first_str,   RESOLV_CONF,  "domain", "[ \t]+" ],
+		    [ "order",         \&xst_parse_split_first_array, HOST_CONF,    "order", "[ \t]+", ",[ \t]*" ],
+		    [ "hostmatch",     \&xst_parse_split_first_bool,  HOST_CONF,    "multi", "[ \t]+" ],
+		    [ "statichost",    \&xst_parse_split_hash,        HOSTS,        "[ \t]+", "[ \t]+" ],
+		    [ "workgroup",     \&xst_parse_ini,               SMB_CONF,     "global", "workgroup" ],     
+		    [ "description",   \&xst_network_rh_get_smb_desc, SMB_CONF,   "global", "server string", "%hostname%" ],
+		    [ "winsserver",    \&xst_parse_ini,               SMB_CONF,     "global", "wins server" ],
+		    [ "winsuse",       \&xst_parse_ini_bool,          SMB_CONF,     "global", "wins support" ],
+        [ "smbuse",        \&xst_service_sysv_get_status_any, "smbd", "nmbd" ],
+        [ "smbinstalled",  \&xst_service_sysv_installed,  "smb" ],
+        [ "smartdhcpcd",   \&xst_file_tool_installed,     "pump" ],
+        [ "dialinstalled", \&xst_file_tool_installed,     "wvdial" ],
+		    [ "dialing",       \&xst_network_dialing_get,     WVDIAL ],
+		    [ "interface",     \&xst_network_interfaces_get ]
+		    ]
 			 }
 
 	  );
@@ -2256,7 +2454,8 @@
     "debian-woody" => "debian-woody",
     "debian-sarge" => "debian-woody",
     "suse-7.0"     => "suse-7.0",
-	  "turbolinux-7.0"   => "redhat-6.2"
+	  "turbolinux-7.0"   => "redhat-6.2",
+    "pld-1.0"      => "pld-1.0"
 	  );
   
   my %dist_tables =
@@ -2497,6 +2696,56 @@
                                                                 \&xst_network_suse70_active_interfaces_get ],
            [ "enabled",            \&xst_parse_trivial,                   0 ]
            ]
+             },
+
+	  "pld-1.0" =>
+	  {
+	    ifaces_get => \&xst_network_sysconfig_pld10_ifaces_get_existing,
+	    fn =>
+	    {
+        IFCFG => "/etc/sysconfig/interfaces/ifcfg-#iface#",
+        CHAT  => "/etc/sysconfig/interfaces/data/chat-#iface#",
+        IFACE => "#iface#",
+        PAP   => "/etc/ppp/pap-secrets",
+        CHAP  => "/etc/ppp/chap-secrets",
+        PUMP  => "/etc/pump.conf"
+      },
+	    table =>
+          [
+           [ "bootproto",          \&xst_network_pld10_parse_bootproto, IFCFG, BOOTPROTO ],
+           [ "auto",               \&xst_parse_sh_bool, IFCFG, ONBOOT ],
+           [ "user",               \&xst_parse_sh_bool, IFCFG, USERCTL ],
+           [ "name",               \&xst_parse_sh,      IFCFG, DEVICE ],
+           [ "dev",                \&xst_parse_sh,      IFCFG, DEVICE ],
+           [ "address",            \&xst_network_pld10_get_ipaddr, IFCFG, IPADDR, "address" ],
+           [ "netmask",            \&xst_network_pld10_get_ipaddr, IFCFG, IPADDR, "netmask" ],
+#           [ "broadcast",          \&xst_parse_sh,      IFCFG, BROADCAST ],
+#           [ "network",            \&xst_parse_sh,      IFCFG, NETWORK ],
+           [ "gateway",            \&xst_parse_sh,      IFCFG, GATEWAY ],
+#           [ "update_dns",         \&xst_network_pump_get_nodns, PUMP, "%dev%", "%bootproto%" ],
+           [ "update_dns",         \&xst_parse_sh_bool, IFCFG, PEERDNS ],
+#           [ "dns1",               \&xst_parse_sh,      IFCFG, DNS1 ],
+#           [ "dns2",               \&xst_parse_sh,      IFCFG, DNS2 ],
+           [ "mtu",                \&xst_parse_sh,      IFCFG, MTU ],
+           [ "mru",                \&xst_parse_sh,      IFCFG, MRU ],
+           [ "remote_address",     \&xst_parse_sh,      IFCFG, REMIP ],
+           [ "login",              \&xst_parse_sh,      IFCFG, PAPNAME ],
+           [ "password",           \&xst_network_get_pap_passwd, PAP,  "%login%" ],
+           [ "password",           \&xst_network_get_pap_passwd, CHAP, "%login%" ],
+           [ "serial_port",        \&xst_parse_sh,      IFCFG, MODEMPORT ],
+           [ "serial_speed",       \&xst_parse_sh,      IFCFG, LINESPEED ],
+           [ "ppp_options",        \&xst_parse_sh,      IFCFG, PPPOPTIONS ],
+#           [ "wvsection",          \&xst_parse_sh,      IFCFG, WVDIALSECT ],
+           [ "set_default_gw",     \&xst_parse_sh_bool, IFCFG, DEFROUTE ],
+           [ "debug",              \&xst_parse_sh_bool, IFCFG, DEBUG ],
+           [ "persist",            \&xst_parse_sh_bool, IFCFG, PERSIST ],
+           [ "serial_escapechars", \&xst_parse_sh_bool, IFCFG, ESCAPECHARS ],
+           [ "serial_hwctl",       \&xst_parse_sh_bool, IFCFG, HARDFLOWCTL ],
+           [ "phone_number",       \&xst_parse_chat,    CHAT, "^atd[^0-9]*([0-9, -]+)" ],
+           [ "enabled",            \&xst_network_interface_active, IFACE,
+                                                                   \&xst_network_active_interfaces_get ],
+           [ "enabled",            \&xst_parse_trivial, 0 ]
+           ]
              }
 	  );
   
@@ -2525,7 +2774,8 @@
     "debian-woody" => "debian-2.2",
     "debian-sarge" => "debian-2.2",
     "suse-7.0"     => "suse-7.0",
-	  "turbolinux-7.0"   => "redhat-7.0"
+	  "turbolinux-7.0"   => "redhat-7.0",
+    "pld-1.0"      => "pld-1.0"
 	  );
 
   my %dist_tables =
@@ -2713,7 +2963,43 @@
         [ "interface",     \&xst_network_interfaces_set,	 OLD_HASH ],
         [ "_always_",      \&xst_file_run,                 SUSECONFIG ],
 		    ]
-			 }
+			 },
+
+	  "pld-1.0" =>
+	  {
+	    fn =>
+	    {
+        SYSCONFIG_NW => "/etc/sysconfig/network",
+        RESOLV_CONF  => "/etc/resolv.conf",
+        HOST_CONF    => "/etc/host.conf",
+        HOSTS        => "/etc/hosts",
+        SMB_CONF     => "/etc/smb/smb.conf",
+        WVDIAL       => "/etc/wvdial.conf"
+      },
+	    table =>
+          [
+           [ "auto",          \&xst_replace_sh_bool,          SYSCONFIG_NW, NETWORKING ],
+           [ "hostname",      \&xst_replace_sh,               SYSCONFIG_NW, HOSTNAME ],
+           [ "hostname",      \&xst_network_run_hostname ],
+           [ "gateway",       \&xst_replace_sh,               SYSCONFIG_NW, GATEWAY],
+           [ "gatewaydev",    \&xst_replace_sh,               SYSCONFIG_NW, GATEWAYDEV],
+#           [ "domain",        \&xst_replace_sh,               SYSCONFIG_NW, DOMAIN],
+           [ "domain",        \&xst_replace_join_first_str,   RESOLV_CONF,  "domain", "[ \t]+" ],
+           [ "nameserver",    \&xst_replace_join_all,         RESOLV_CONF,  "nameserver", "[ \t]+" ],
+           [ "searchdomain",  \&xst_replace_join_first_array, RESOLV_CONF,  "search", "[ \t]+", "[ \t]+" ],
+           [ "order",         \&xst_replace_join_first_array, HOST_CONF,    "order", "[ \t]+", ",[ \t]*" ],
+           [ "hostmatch",     \&xst_replace_join_first_bool,  HOST_CONF,    "multi", "[ \t]+", "on", "off" ],
+           [ "statichost",    \&xst_replace_join_hash,        HOSTS,        "[ \t]+", "[ \t]+" ],
+           [ "workgroup",     \&xst_replace_ini,              SMB_CONF,     "global", "workgroup" ],     
+           [ "description",   \&xst_replace_ini,              SMB_CONF,     "global", "server string" ],
+           [ "winsserver",    \&xst_replace_ini,              SMB_CONF,     "global", "wins server" ],
+           [ "winsuse",       \&xst_replace_ini_bool,         SMB_CONF,     "global", "wins support" ],
+           [ "smbuse",        \&xst_service_sysv_set_status,  91, "smb" ],
+           [ "dialing",       \&xst_network_dialing_set,      [WVDIAL, OLD_HASH] ],
+           [ "interface",     \&xst_network_interfaces_set,		OLD_HASH ],
+           [ "gateway",       \&xst_network_route_set_default_gw, "%gatewaydev%" ]
+           ]
+             }
 	  );
   
   my $dist = $dist_map{$xst_dist};
@@ -2741,7 +3027,8 @@
     "debian-woody" => "debian-woody",
     "debian-sarge" => "debian-woody",
     "suse-7.0"     => "suse-7.0",
-	  "turbolinux-7.0"   => "redhat-6.2"
+	  "turbolinux-7.0"   => "redhat-6.2",
+    "pld-1.0"      => "pld-1.0"
 	  );
 
   my %dist_tables =
@@ -2968,7 +3255,54 @@
            [ "remote_address",     \&xst_network_suse70_set_ifconfig_arg,   [IFCFG, IFACE], pointopoint ],
            [ "update_dns",         \&xst_replace_kw,                        PPP_OPTIONS, "usepeerdns" ]
       ]
+    },
+
+    "pld-1.0" =>
+	  {
+      iface_set    => \&xst_network_rh62_interface_activate,
+      iface_delete => \&xst_network_pld10_interface_delete,
+      ifaces_get   => \&xst_network_sysconfig_pld10_ifaces_get_existing,
+      fn =>
+	    {
+        IFCFG  => "/etc/sysconfig/interfaces/ifcfg-#iface#",
+        CHAT   => "/etc/sysconfig/interfaces/data/chat-#iface#",
+        IFACE  => "#iface#",
+        WVDIAL => "/etc/wvdial.conf",
+        PUMP   => "/etc/pump.conf"
+      },
+      table =>
+       [
+        [ "bootproto",          \&xst_network_pld10_replace_bootproto, IFCFG, BOOTPROTO ],
+        [ "auto",               \&xst_replace_sh_bool, IFCFG, ONBOOT ],
+        [ "user",               \&xst_replace_sh_bool, IFCFG, USERCTL ],
+#        [ "name",               \&xst_replace_sh,      IFCFG, NAME ],
+        [ "dev",                \&xst_replace_sh,      IFCFG, DEVICE ],
+        [ "address",            \&xst_network_pld10_set_ipaddr, IFCFG, IPADDR, "address" ],
+        [ "netmask",            \&xst_network_pld10_set_ipaddr, IFCFG, IPADDR, "netmask" ],
+#        [ "broadcast",          \&xst_replace_sh,      IFCFG, BROADCAST ],
+#        [ "network",            \&xst_replace_sh,      IFCFG, NETWORK ],
+        [ "gateway",            \&xst_replace_sh,      IFCFG, GATEWAY ],
+#        [ "update_dns",         \&xst_network_pump_set_nodns, PUMP, "%dev%", "%bootproto%" ],
+        [ "update_dns",         \&xst_replace_sh_bool, IFCFG, PEERDNS ],
+#        [ "dns1",               \&xst_replace_sh,      IFCFG, DNS1 ],
+#        [ "dns2",               \&xst_replace_sh,      IFCFG, DNS2 ],
+        [ "mtu",                \&xst_replace_sh,      IFCFG, MTU ],
+        [ "mru",                \&xst_replace_sh,      IFCFG, MRU ],
+        [ "remote_address",     \&xst_replace_sh,      IFCFG, REMIP ],
+        [ "login",              \&xst_replace_sh,      IFCFG, PAPNAME ],
+        [ "serial_port",        \&xst_replace_sh,      IFCFG, MODEMPORT ],
+        [ "serial_speed",       \&xst_replace_sh,      IFCFG, LINESPEED ],
+        [ "ppp_options",        \&xst_replace_sh,      IFCFG, PPPOPTIONS ],
+#        [ "wvsection",          \&xst_replace_sh,      IFCFG, WVDIALSECT ],
+        [ "set_default_gw",     \&xst_replace_sh_bool, IFCFG, DEFROUTE ],
+        [ "debug",              \&xst_replace_sh_bool, IFCFG, DEBUG ],
+        [ "persist",            \&xst_replace_sh_bool, IFCFG, PERSIST ],
+        [ "serial_escapechars", \&xst_replace_sh_bool, IFCFG, ESCAPECHARS ],
+        [ "serial_hwctl",       \&xst_replace_sh_bool, IFCFG, HARDFLOWCTL ],
+        [ "phone_number",       \&xst_replace_chat,    CHAT,  "^atd[^0-9]*([0-9, -]+)" ]
+      ]
     }
+
   );
   
   my $dist = $dist_map{$xst_dist};
diff -urN aaa/gnome-system-tools-0.24.0/backends/platform.pl.in gnome-system-tools-0.24.0/backends/platform.pl.in
--- aaa/gnome-system-tools-0.24.0/backends/platform.pl.in	Tue Jan 14 22:33:55 2003
+++ gnome-system-tools-0.24.0/backends/platform.pl.in	Tue Apr 29 12:56:10 2003
@@ -59,7 +59,8 @@
   "slackware-9.0"   => "Slackware 9.0",
   "freebsd-4"       => "FreeBSD 4",
   "freebsd-5"       => "FreeBSD 5",
-  "gentoo"          => "Gentoo Linux"
+  "gentoo"          => "Gentoo Linux",
+  "pld-1.0"         => "PLD 1.0 Ra"
 };
   
 sub check_lsb
@@ -201,6 +202,7 @@
 sub check_gentoo
 {
   return "gentoo" if stat ("$xst_prefix/usr/portage");
+  return -1;
 }
 
 sub check_linuxppc
@@ -261,6 +263,23 @@
   return -1;
 }
 
+sub check_pld
+{
+  open RELEASE, "$xst_prefix/etc/pld-release" or return -1;
+  while (<RELEASE>)
+  {
+    chomp;
+		if(/^([0-9.]+) PLD Linux/)
+    {
+      close RELEASE;
+      return "pld-$1";
+    }
+  }
+  close RELEASE;
+  return -1;
+}
+
+
 sub xst_platform_guess
 {
   my ($tool) = @_;
@@ -278,7 +297,7 @@
     # Red Hat check must run after Mandrake
     "Linux" => [ \&check_lsb,      \&check_debian,   \&check_caldera, \&check_suse, 
                  \&check_mandrake, \&check_linuxppc, \&check_redhat,  \&check_turbolinux,
-                 \&check_slackware, \&check_gentoo],
+                 \&check_slackware, \&check_gentoo,  \&check_pld ],
     "FreeBSD" => [ \&check_freebsd ],
     "SunOS"    => [ \&check_solaris ]
                );
diff -urN aaa/gnome-system-tools-0.24.0/backends/runlevel-conf.in gnome-system-tools-0.24.0/backends/runlevel-conf.in
--- aaa/gnome-system-tools-0.24.0/backends/runlevel-conf.in	Tue Jan 14 22:26:20 2003
+++ gnome-system-tools-0.24.0/backends/runlevel-conf.in	Tue Apr 29 12:43:26 2003
@@ -6,6 +6,7 @@
 # Copyright (C) 2002 Ximian, Inc.
 #
 # Authors: Carlos Garnacho Parro <garparr@teleline.es>
+#          Grzegorz Golawski <grzegol@pld.org.pl> (PLD Support)
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Library General Public License as published
@@ -48,7 +49,7 @@
 
               "debian-2.2", "debian-woody", "debian-sarge",
 
-              "suse-7.0", "turbolinux-7.0");
+              "suse-7.0", "turbolinux-7.0", "pld-1.0");
 
 $description =<<"end_of_description;";
        Configures which services are to be started or stopped at which runlevels
diff -urN aaa/gnome-system-tools-0.24.0/backends/service.pl.in gnome-system-tools-0.24.0/backends/service.pl.in
--- aaa/gnome-system-tools-0.24.0/backends/service.pl.in	Tue Jan 14 22:26:20 2003
+++ gnome-system-tools-0.24.0/backends/service.pl.in	Tue Apr 29 12:43:51 2003
@@ -67,7 +67,9 @@
 
        "suse-7.0"     => ["/etc/rc.d", "/etc/rc.d", "../"],
 
-       "turbolinux-7.0"   => ["/etc/rc.d", "/etc/rc.d/init.d", "../init.d"]
+       "turbolinux-7.0"   => ["/etc/rc.d", "/etc/rc.d/init.d", "../init.d"],
+
+       "pld-1.0"      => ["/etc/rc.d", "/etc/rc.d/init.d", "../init.d"]
        );
   my $res;
 
@@ -101,7 +103,9 @@
 
        "suse-7.0"       => [3, 5],
 
-       "turbolinux-7.0" => [3, 5]
+       "turbolinux-7.0" => [3, 5],
+
+       "pld-1.0"        => [3, 5]
        );
   my $res;
 
diff -urN aaa/gnome-system-tools-0.24.0/backends/time-conf.in gnome-system-tools-0.24.0/backends/time-conf.in
--- aaa/gnome-system-tools-0.24.0/backends/time-conf.in	Tue Jan 14 22:26:20 2003
+++ gnome-system-tools-0.24.0/backends/time-conf.in	Tue Apr 29 12:44:04 2003
@@ -6,6 +6,7 @@
 # Copyright (C) 2000-2001 Ximian, Inc.
 #
 # Authors: Hans Petter Jansson <hpj@ximian.com>
+#          Grzegorz Golawski <grzegol@pld.org.pl> (PLD Support)
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Library General Public License as published
@@ -70,7 +71,7 @@
 	      
               "slackware-8.0.0", "slackware-9.0",
 
-              "gentoo");
+              "gentoo", "pld-1.0");
 
 $description =<<"end_of_description;";
        Configures your system clock, timezone and time server list.
@@ -439,7 +440,9 @@
    "slackware-8.0.0" => "debian-2.2",
    "slackware-9.0"   => "debian-2.2",
 
-   "gentoo"          => "redhat-7.0"
+   "gentoo"          => "redhat-7.0",
+
+   "pld-1.0"         => "pld-1.0"
    );
 
   my %dist_tables =
@@ -515,6 +518,24 @@
               [ "sync_active",  \&xst_service_sysv_get_status, "xntpd" ],
               [ "ntpinstalled", \&xst_service_sysv_installed, "xntpd" ],
               ]
+                },
+
+       "pld-1.0" =>
+       {
+         fn =>
+         {
+           NTP_CONF     => "/etc/ntp/ntp.conf",
+           ZONEINFO     => "/usr/share/zoneinfo",
+           LOCAL_TIME   => "/etc/localtime"
+         },
+         table =>
+             [
+              [ "local_time",   \&time_get_local_time ],
+              [ "timezone",     \&time_get_rh62_zone, [LOCAL_TIME, ZONEINFO] ],
+              [ "sync",         \&xst_parse_split_all_hash_comment, NTP_CONF, "server", "[ \t]+" ],
+              [ "sync_active",  \&xst_service_sysv_get_status, "ntpd" ],
+              [ "ntpinstalled", \&xst_service_sysv_installed, "ntpd" ],
+              ]
                 }
        );
 
@@ -551,7 +572,9 @@
    "turbolinux-7.0"  => "redhat-7.0",
    
    "slackware-8.0.0" => "debian-2.2",
-   "slackware-9.0"   => "debian-2.2"
+   "slackware-9.0"   => "debian-2.2",
+
+   "pld-1.0"         => "pld-1.0"
    );
 
   my %dist_tables =
@@ -623,6 +646,22 @@
               [ "sync",         \&xst_replace_join_all, NTP_CONF, "server", "[ \t]+" ],
               [ "sync_active",  \&xst_service_sysv_set_status, 90, "xntpd" ],
               ]
+                },
+
+       "pld-1.0" =>
+       {
+         fn =>
+         {
+           NTP_CONF     => "/etc/ntp/ntp.conf",
+           ZONEINFO     => "/usr/share/zoneinfo",
+           LOCAL_TIME   => "/etc/localtime"
+         },
+         table =>
+             [
+              [ "timezone",     \&time_set_rh62_zone, [LOCAL_TIME, ZONEINFO] ],
+              [ "local_time",   \&xst_replace_join_all, NTP_CONF, "server", "[ \t]+" ],
+              [ "sync_active",  \&xst_service_sysv_set_status, 90, "ntpd" ],
+              ]
                 }
        );
 
diff -urN aaa/gnome-system-tools-0.24.0/backends/users-conf.in gnome-system-tools-0.24.0/backends/users-conf.in
--- aaa/gnome-system-tools-0.24.0/backends/users-conf.in	Tue Jan 14 22:26:20 2003
+++ gnome-system-tools-0.24.0/backends/users-conf.in	Tue Apr 29 12:44:09 2003
@@ -8,6 +8,7 @@
 # Authors: Hans Petter Jansson <hpj@ximian.com>,
 #          Arturo Espinosa <arturo@ximian.com>,
 #          Tambet Ingo <tambet@ximian.com>.
+#          Grzegorz Golawski <grzegol@pld.org.pl> (PLD Support)
 #
 #
 # This program is free software; you can redistribute it and/or modify
@@ -78,7 +79,8 @@
 
               "slackware-8.0.0", "slackware-9.0",
 
-              "freebsd-4", "freebsd-5");
+              "freebsd-4", "freebsd-5",
+              "pld-1.0");
 
 $description =<<"end_of_description;";
        Manages system users.
@@ -229,6 +231,7 @@
   'redhat-8.0'      => $rh_logindefs_defaults,
   'mandrake-7.1'    => $rh_logindefs_defaults,
   'mandrake-7.2'    => $rh_logindefs_defaults,
+  'pld-1.0'         => $rh_logindefs_defaults,
 
   # FIXME: I don't know about those, so using RH values for now.
   'debian-2.2'      => $rh_logindefs_defaults,

gnome-system-tools-pld.png



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]