From: <nau...@os...> - 2005-12-21 21:50:29
|
Author: naughton Date: 2005-12-21 14:50:26 -0500 (Wed, 21 Dec 2005) New Revision: 4076 Modified: trunk/scripts/oscar_wizard Log: + change things to get the VERSION from scripty-foo since no longer have static VERSION file with the latest incarnation of the build system. [ Duplicate code warning!!! see also install_cluster. :( ] Modified: trunk/scripts/oscar_wizard =================================================================== --- trunk/scripts/oscar_wizard 2005-12-21 19:49:27 UTC (rev 4075) +++ trunk/scripts/oscar_wizard 2005-12-21 19:50:26 UTC (rev 4076) @@ -88,20 +88,29 @@ chomp(my $shostname = `hostname -s`); $window->title("OSCAR Installation Wizard - $shostname"); -# Get the version -# -my $version; -if( -e "$ENV{OSCAR_HOME}/VERSION" && open( F, "<$ENV{OSCAR_HOME}/VERSION" ) ) { - $version = <F>; - close F; -} elsif( -e "$ENV{OSCAR_HOME}/dist/VERSION" ) { - $version = `$ENV{OSCAR_HOME}/dist/get-oscar-version.sh $ENV{OSCAR_HOME} --full 2>/dev/null`; -} else { - $version = `svnversion . 2>/dev/null`; + +# Get OSCAR's version + +my $oscar_version; +my $oscar_version_script = $ENV{OSCAR_HOME} ."/" . "dist/get-oscar-version.sh"; +my $oscar_version_file = $ENV{OSCAR_HOME} . "/" . "VERSION"; + +# Use the scripty-foo to get oscar version information. + +if ( -e "$oscar_version_file" ) { + my $cmd = "$oscar_version_script $oscar_version_file --full"; + + open(CMD, "$cmd|") or die "ERROR: failed to get oscar version '$cmd' - $!"; + $oscar_version = <CMD>; + chomp($oscar_version); + + close(CMD); } -chomp $version; -$version ||= "[Unknown]"; +else { + die("ERROR: OSCAR VERSION file missing '$oscar_version_file' - aborting!"); +} + # Define the main buttons # @@ -113,7 +122,7 @@ -background=>"white"); my $GIF_t2=$window->Label(-image=> $window->Photo(-file=>$image), -background=>"white"); -my $Title_l=$window->Label(-text=>"Welcome to the OSCAR Wizard!\n\nOSCAR Version: $version", +my $Title_l=$window->Label(-text=>"Welcome to the OSCAR Wizard!\n\nOSCAR Version: $oscar_version", -background=>"white"); $GIF_t->grid($Title_l,"-",-sticky=>"nsew"); |