cvs: php4 /pear/PEAR Builder.php

From: Date: Sun, 25 Aug 2002 18:29:32 +0000
Subject: cvs: php4 /pear/PEAR Builder.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-5961@lists.php.net to get a copy of this message
pajoye Sun Aug 25 14:29:32 2002 EDT Modified files: /php4/pear/PEAR Builder.php Log: Remove $_ENV usages, getenv() is used instead 'MAKE' and 'USER' are used, if 'USER' not found I set user to 'defaultuser' Index: php4/pear/PEAR/Builder.php diff -u php4/pear/PEAR/Builder.php:1.5 php4/pear/PEAR/Builder.php:1.6 --- php4/pear/PEAR/Builder.php:1.5 Sun Jul 7 16:47:57 2002 +++ php4/pear/PEAR/Builder.php Sun Aug 25 14:29:32 2002 @@ -16,7 +16,7 @@ // | Authors: Stig Sæther Bakken <ssb@fast.no> | // +----------------------------------------------------------------------+ // -// $Id: Builder.php,v 1.5 2002/07/07 20:47:57 shane Exp $ +// $Id: Builder.php,v 1.6 2002/08/25 18:29:32 pajoye Exp $ require_once 'PEAR/Common.php'; @@ -57,7 +57,7 @@ } // }}} - + // {{{ _build_win32() /** @@ -83,13 +83,13 @@ } // XXX TODO: make release build type configurable $command = 'msdev '.$dsp.' /MAKE "'.$info['package']. ' - Release"'; - + $this->current_callback = $callback; $err = $this->_runCommand($command, array(&$this, 'msdevCallback')); if (PEAR::isError($err)) { return $err; } - + // figure out the build platform and type $platform = 'Win32'; $buildtype = 'Release'; @@ -107,11 +107,11 @@ } else { return $this->raiseError("Did not understand the completion status returned from msdev.exe."); } - + // msdev doesn't tell us the output directory :/ // open the dsp, find /out and use that directory $dsptext = join(file($dsp),''); - + // this regex depends on the build platform and type having been // correctly identified above. $regex ='/.*?!IF\s+"\$\(CFG\)"\s+==\s+("'. @@ -129,7 +129,7 @@ if (@copy($outfile, "$dir/$out")) { $outfile = "$dir/$out"; } - + $built_files[] = array( 'file' => "$outfile", 'php_api' => $this->php_api_version, @@ -140,7 +140,7 @@ return $built_files; } // }}} - + // {{{ msdevCallback() function msdevCallback($what, $data) { @@ -149,7 +149,7 @@ $this->_lastline = $data; } // }}} - + // {{{ build() /** @@ -205,7 +205,7 @@ if (!$err) { return $this->raiseError("`phpize' failed"); } - + // start of interactive part $configure_command = "$dir/configure"; if (isset($info['configure_options'])) { @@ -223,9 +223,10 @@ } } // end of interactive part - + // make configurable - $build_basedir = "/var/tmp/pear-build-$_ENV[USER]"; + $user = getenv('USER')?getenv('USER'):'defaultuser'; + $build_basedir = "/var/tmp/pear-build-$user"; $build_dir = "$build_basedir/$info[package]-$info[version]"; $this->log(1, "building in $build_dir"); if (is_dir($build_dir)) { @@ -235,8 +236,8 @@ return $this->raiseError("could not create build dir: $build_dir"); } $this->addTempFile($build_dir); - if (isset($_ENV['MAKE'])) { - $make_command = $_ENV['MAKE']; + if (getenv('MAKE')) { + $make_command = getenv('MAKE'); } else { $make_command = 'make'; }

« previous php.pear.cvs (#5961) next »