Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #9688 [PATCH] Fix build of PECL extensions
Submitted: 2006-12-24 11:13 UTC
From: techtonik Assigned: cellog
Status: Closed Package: PEAR (version 1.4.11)
PHP Version: 4.4.4 OS: Windows
Roadmaps: (Not assigned)    
Subscription  


 [2006-12-24 11:13 UTC] techtonik (anatoly techtonik)
Description: ------------ This patch fixes "pecl build" on windows platforms and log misbehaviour when not all lines of command output were trapped by corresponding callback function. http://pastebin.co.uk/7775 Test script: --------------- --- Builder_old.php Sun Dec 24 21:43:00 2006 +++ Builder.php Mon Dec 25 01:47:34 2006 @@ -19,6 +19,9 @@ * @version CVS: $Id: Builder.php,v 1.27 2006/01/06 04:47:36 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 + * + * TODO: log output parameters in PECL command line + * TODO: msdev path in configuration */ /** @@ -50,6 +53,10 @@ var $extensions_built = array(); + /** + * @var string Used for reporting when it is not possible to pass function + * via extra parameter, e.g. log, msdevCallback + */ var $current_callback = null; // used for msdev builds @@ -83,6 +90,7 @@ { if (is_object($descfile)) { $pkg = $descfile; + $descfile = $pkg->getPackageFile(); } else { $pf = &new PEAR_PackageFile($this->config, $this->debug); $pkg = &$pf->fromPackageFile($descfile, PEAR_VALIDATE_NORMAL); @@ -90,12 +98,16 @@ return $pkg; } } - $dir = dirname($pkg->getArchiveFile()); + $dir = dirname($descfile); $old_cwd = getcwd(); - if (!@chdir($dir)) { return $this->raiseError("could not chdir to $dir"); } + $vdir = $pkg->getPackage() . '-' . $pkg->getVersion(); + if (is_dir($vdir)) { + chdir($vdir); + } + $dir = getcwd(); $this->log(2, "building in $dir"); $dsp = $pkg->getPackage().'.dsp'; @@ -103,9 +115,8 @@ return $this->raiseError("The DSP $dsp does not exist."); } // XXX TODO: make release build type configurable - $command = 'msdev '.$dsp.' /MAKE "'.$info['package']. ' - Release"'; + $command = 'msdev '.$dsp.' /MAKE "'.$pkg->getPackage(). ' - Release"'; - $this->current_callback = $callback; $err = $this->_runCommand($command, array(&$this, 'msdevCallback')); if (PEAR::isError($err)) { return $err; @@ -168,6 +179,7 @@ if (!$this->_firstline) $this->_firstline = $data; $this->_lastline = $data; + call_user_func($this->current_callback, $what, $data); } // }}} @@ -241,6 +253,7 @@ */ function build($descfile, $callback = null) { + $this->current_callback = $callback; if (PEAR_OS == "Windows") { return $this->_build_win32($descfile,$callback); } @@ -268,7 +281,6 @@ } $dir = getcwd(); $this->log(2, "building in $dir"); - $this->current_callback = $callback; putenv('PATH=' . $this->config->get('bin_dir') . ':' . getenv('PATH')); $err = $this->_runCommand("phpize", array(&$this, 'phpizeCallback')); if (PEAR::isError($err)) {

Comments

 [2007-01-07 16:11 UTC] cellog (Greg Beaver)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.