Re: [Setup-tool-hackers] Platform detection is braindead



Hi Jose Carlos!

	The bug is fixed, I'm pretty sure that the uname command I've used is
installed by default in every linux, solaris or freebsd, correct me if
I'm in a mistake :-)

	I'm attaching the patch to fix it in GST 0.22, I think that it should
work too in the GST-0.21 (only if you are going to make a new 0.21 .deb
:-)

		Greetings
--- gnome-system-tools/backends/platform.pl.in	2002-12-12 22:11:41.000000000 +0100
+++ gnome-system-tools/backends/platform.pl.in.new	2002-12-12 22:01:31.000000000 +0100
@@ -263,35 +263,23 @@
 sub xst_platform_guess
 {
   my ($tool) = @_;
-  my $dir = "$SCRIPTSDIR";
-  
-  if (! -f "$dir/system.guess")
-  {
-    system ("$dir/guess_system.sh 2> /dev/null > $dir/system.guess");
-  }
-
-  if (-f "$dir/system.guess")
-  {
-    open FILE, "$dir/system.guess";
-  }
-  else
-  {
-    open FILE, "$dir/guess_system.sh 2>/dev/null |";
-  }
+  local *FD;
 
-  chomp ($$tool{"system"} = <FILE>);
-  close FILE;
+  # get the output of 'uname -s', it returns the system we are running
+  *FD = &xst_file_run_pipe_read ("uname -s");
+  $$tool{"system"} = <FD>;
+  chomp ($$tool{"system"});
+  close FD;
 
   # set $xst_dist and $xst_dist_version
   
   my %check = (
     # Red Hat check must run after Mandrake
-    "linux" => [ \&check_lsb,      \&check_debian,   \&check_caldera, \&check_suse, 
+    "Linux" => [ \&check_lsb,      \&check_debian,   \&check_caldera, \&check_suse, 
                  \&check_mandrake, \&check_linuxppc, \&check_redhat,  \&check_turbolinux,
                  \&check_slackware, \&check_gentoo],
-    # Isn't just "freebsd" enough?
-    "freebsdelf" => [ \&check_freebsd ],
-    "solaris"    => [ \&check_solaris ]
+    "FreeBSD" => [ \&check_freebsd ],
+    "SunOS"    => [ \&check_solaris ]
                );
   my $plat;
 


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