Re: [Setup-tool-hackers] [PATCH] for hardware-conf and platform.pl



Please find attached a patch for platform.pl.in to determine solaris 2.5 and 
2.6 (tested).  A test for solaris 7.0 and 8.0 are provided too, but are not 
tested on a solaris system.

Can someone with cvs access commit, please.  I again provided the patch for 
hardware.pl as that has not been committed :(

On Thursday 7 June 2001 20:46, you wrote:
> please find attached 2 patches; 1 for hardware-conf and the other for
> platform.pl.  The one for hardware-conf  is to get it running at all, at
> this moment it misses 2 requires, and the description field is not
> recognized correctly.
>
> The one for platform.pl is needed to get the correct error message, when a
> platform is not supported by xst, but has been recognized.
>
> Currently the error message is: Unable to determine host platform
> while it should be: Your platform [%s] is not supported.::unknown
> This is due to un incorrect located "}" :)
>
> Can someone with cvs access please commit.
>
> Question1: error messages are now spit out in plain text, shouldn't
> these be outputted in xml, so the frontend can easily parse them and
> display them in the gui/frontend?
>
> Question2: Is it already possibly to configure a remote machine via the gui
> and backends.  I imagine that the backends have been installed on the
> remote machine and the frontends are run at the local machine.  Whether it
> is yes or no, how (will be) is this implemented (using ssh e.g., and how is
> the frontend told to configure the remote system and the local one)?

This is for people that run linux as a router application, without X and 
desktop stuff.  If those people wanna use xst to configure that (router) box 
they need to tell their gui configuration environment that it needs access 
the remote system and not the local one.

I hope that this time the patches are reviewed (and comitted) and that I get 
an answer on my question (that will be appreciated).

-- 
Richard Bos
For those who have no (/)home the journey is endless
--- platform.pl.in.20010607	Thu Jun  7 23:36:20 2001
+++ platform.pl.in	Sat Jun  9 23:46:20 2001
@@ -170,6 +170,31 @@ sub check_freebsd
   return -1;
 }
 
+sub check_solaris
+{
+  my $cmd_uname = &xst_file_locate_tool ("uname");
+  my $dist;
+
+  #
+  # The file /etc/release is present for solaris-2.6
+  # solaris 2.5 does not have the file.  Solaris-7.0 and 8.0 have not
+  # been checked
+  #
+  # uname output
+  # Solaris 2.5: 5.5(.1)
+  # Solaris 2.6: 5.6
+  # Solaris 7:   unknown, assume 7.0
+  # Solaris 8:   unknown, assume 8.0
+  #
+  $pid = open (RELEASE, "$cmd_uname -r |") or return -1;
+  chomp ($dist = <RELEASE>);
+  close RELEASE;
+
+  if ($dist =~ /^5\.(\d)/) { return "solaris-2.$1" }
+  else { if ($dist =~ /^([78])\.\d/) { return "solaris-$1.0" } }
+  return -1;
+}
+
 sub xst_platform_guess
 {
   my $dir = "___scriptsdir___";
@@ -218,8 +243,6 @@ sub xst_platform_guess
         return;
       }
     }
-
-    $xst_dist = "unknown";
   }
 
   if ($xst_system =~ /freebsdelf/)
@@ -231,9 +254,20 @@ sub xst_platform_guess
       $xst_dist = $dist;
       return;
     }
+  }
 
-    $xst_dist = "unknown";
+  if ($xst_system =~ /solaris/)
+  {
+    my $dist;
+
+    $dist = &check_solaris ();
+    if ($dist != -1) {
+      $xst_dist = $dist;
+      return;
   }
+  }
+
+  $xst_dist = "unknown";
 }
 
 
--- hardware-conf.in.old	Thu Jun  7 09:53:46 2001
+++ hardware-conf.in	Thu Jun  7 09:55:54 2001
@@ -51,7 +51,8 @@
 
 
 
-require "___scriptsdir___/be.pl";
+require "___scriptsdir___/general.pl";
+require "___scriptsdir___/xml.pl";
 
 
 
@@ -60,7 +61,7 @@ require "___scriptsdir___/be.pl";
 $name = "hardware";
 $version = "0.1.0";
 
-$description =<<"end_of_description";
+$description =<<"end_of_description;";
        Configures hardware.
 end_of_description;
 


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