cvs: pear-core /PEAR Builder.php

From: Date: Sun, 05 Mar 2006 21:09:18 +0000
Subject: cvs: pear-core /PEAR Builder.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-4606@lists.php.net to get a copy of this message
cellog Sun Mar 5 21:09:18 2006 UTC Modified files: /pear-core/PEAR Builder.php Log: remove err suppression @ http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Builder.php?r1=1.28&r2=1.29&diff_format=u Index: pear-core/PEAR/Builder.php diff -u pear-core/PEAR/Builder.php:1.28 pear-core/PEAR/Builder.php:1.29 --- pear-core/PEAR/Builder.php:1.28 Sun Mar 5 21:03:39 2006 +++ pear-core/PEAR/Builder.php Sun Mar 5 21:09:18 2006 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Builder.php,v 1.28 2006/03/05 21:03:39 cellog Exp $ + * @version CVS: $Id: Builder.php,v 1.29 2006/03/05 21:09:18 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -260,7 +260,7 @@ } $dir = dirname($descfile); $old_cwd = getcwd(); - if (!@chdir($dir)) { + if (!file_exists($dir) || !is_dir($dir) || !chdir($dir)) { return $this->raiseError("could not chdir to $dir"); } $vdir = $pkg->getPackage() . '-' . $pkg->getVersion(); @@ -284,10 +284,11 @@ $configure_options = $pkg->getConfigureOptions(); if ($configure_options) { foreach ($configure_options as $o) { + $default = array_key_exists($o['default']) ? $o['default'] : null; list($r) = $this->ui->userDialog('build', array($o['prompt']), array('text'), - array(@$o['default'])); + array($default)); if (substr($o['name'], 0, 5) == 'with-' && ($r == 'yes' || $r == 'autodetect')) { $configure_command .= " --$o[name]"; @@ -329,7 +330,7 @@ "$make_command INSTALL_ROOT=\"$inst_dir\" install", "find \"$inst_dir\" -ls" ); - if (!@chdir($build_dir)) { + if (!file_exists($build_dir) || !is_dir($build_dir) || !chdir($build_dir)) { return $this->raiseError("could not chdir to $build_dir"); } putenv('PHP_PEAR_VERSION=@PEAR-VER@'); @@ -413,7 +414,7 @@ function _runCommand($command, $callback = null) { $this->log(1, "running: $command"); - $pp = @popen("$command 2>&1", "r"); + $pp = popen("$command 2>&1", "r"); if (!$pp) { return $this->raiseError("failed to run `$command'"); } @@ -432,7 +433,11 @@ if ($callback && isset($olddbg)) { $callback[0]->debug = $olddbg; } - $exitcode = @pclose($pp); + if (is_resource($pp)) { + $exitcode = pclose($pp); + } else { + $exitcode = -1; + } return ($exitcode == 0); }

« previous php.pear.core (#4606) next »