summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarlosg <carlosg>2006-08-23 16:48:44 +0000
committercarlosg <carlosg>2006-08-23 16:48:44 +0000
commitb0adf05df6a4bb2f35ec5e0fe47fdf87b7bde49b (patch)
tree15c3ab2fe1718227534f5c182040172a78d20fb0
parent4809e8c59beda3ed7c472456cf3fe331cff9348c (diff)
2006-08-23 Carlos Garnacho <carlosg@gnome.org>
* Utils/Platform.pm (check_file_exists): fix distro detection in the Gentoo case. (set_platform), (ensure_platform): code improvements.
-rw-r--r--ChangeLog6
-rw-r--r--Utils/Platform.pm26
2 files changed, 15 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index a91fdfb..58b4b58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-08-23 Carlos Garnacho <carlosg@gnome.org>
+
+ * Utils/Platform.pm (check_file_exists): fix distro detection in the
+ Gentoo case.
+ (set_platform), (ensure_platform): code improvements.
+
2006-08-12 Carlos Garnacho <carlosg@gnome.org>
* Release 1.9.3
diff --git a/Utils/Platform.pm b/Utils/Platform.pm
index 6e23588..9f343d0 100644
--- a/Utils/Platform.pm
+++ b/Utils/Platform.pm
@@ -304,7 +304,7 @@ sub check_file_exists
{
my ($file, $distro) = @_;
- return $distro if &Utils::File::exists ($file);
+ return $distro if stat ("$gst_prefix/$file");
return -1;
}
@@ -320,17 +320,15 @@ sub set_platform
my ($platform) = @_;
my ($p);
- foreach $p (keys %$PLATFORM_INFO)
+
+ if (&ensure_platform ($platform))
{
- if ($p eq $platform)
- {
- $platform = &ensure_distro_map ($platform);
+ $platform = &ensure_distro_map ($platform);
- $Utils::Backend::tool{"platform"} = $gst_dist = $platform;
- &Utils::Report::do_report ("platform_success", $platform);
- &Utils::Report::end ();
- return;
- }
+ $Utils::Backend::tool{"platform"} = $gst_dist = $platform;
+ &Utils::Report::do_report ("platform_success", $platform);
+ &Utils::Report::end ();
+ return;
}
&set_platform_unsupported ($object);
@@ -349,13 +347,8 @@ sub set_platform_unsupported
sub ensure_platform
{
my ($platform) = @_;
- my ($p);
-
- foreach $p (keys %$PLATFORM_INFO)
- {
- return $platform if ($p eq $platform);
- }
+ return $platform if ($$PLATFORM_INFO{$platform} ne undef);
return undef;
}
@@ -400,7 +393,6 @@ sub guess
$func = shift (@$check);
$dist = &$func (@$check);
- # FIXME: is necessary ensure_platform?
if ($dist != -1 && &ensure_platform ($dist))
{
$dist = &ensure_distro_map ($dist);