Commit f246ca80 authored by unknown's avatar unknown

- Some small Perl enhancements for Do-compile: use more Perl builtins.


Build-tools/Do-compile:
   - use more Perl builtins (e.g. hostname(), basename()) instead of forking
     subprocesses
parent 2cdf95db
#!/usr/bin/perl -w
use File::Basename;
use Getopt::Long;
use Sys::Hostname;
@config_options= ();
@make_options= ();
......@@ -75,7 +77,7 @@ if (@config_env > 0)
$opt_config_env= join(" ", @config_env);
}
chomp($host=`hostname`);
$host= hostname();
chomp($uname=`uname`);
$full_host_name=$host;
$connect_option= ($opt_tcpip ? "--host=$host" : "");
......@@ -83,7 +85,7 @@ $host =~ /^([^.-]*)/;
$host=$1 . $opt_suffix;
$email="$opt_user\@mysql.com";
chomp($pwd = `pwd`);
$VER= `basename $opt_distribution`; chop $VER;
$VER= basename($opt_distribution);
$VER=~ /mysql.*-([1-9]\.[0-9]{1,2}\.[0-9]{1,2}.*)\.tar*/; $version=$1;
($major, $minor, $release) = split(/\./,$version);
$log="$pwd/Logs/$host-$major.$minor$opt_version_suffix.log";
......@@ -110,7 +112,7 @@ if (defined($gcc_version) && ! $opt_config_env)
$new_opt_tmp=0;
if ($opt_tmp)
{
if (! -d $opt_tmp)
unless (-d $opt_tmp)
{
safe_system("mkdir $opt_tmp");
$new_opt_tmp=1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment