svn: /pear/pear-core/trunk/PEAR/ Builder.php

[email protected] (Helgi Þormar Þorbjörnsson) Tue, 31 May 2011 02:55:54 +0000
Newsgroups php.pear.cvs,php.pear.core
Message-ID <[email protected]>
--55336d8c722a8715d0bf3c4e0c039e5e5cc91842
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

dufuz                                    Tue, 31 May 2011 02:55:54 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=311616

Log:
Fixed a bug with extensions not providing their config.m4 and co in the root directory of their pecl package but rather in a sub directory, such as xhprof. [dufuz]

# Merge from tag PEAR-1.9.3

Changed paths:
    U   pear/pear-core/trunk/PEAR/Builder.php

Modified: pear/pear-core/trunk/PEAR/Builder.php
===================================================================
--- pear/pear-core/trunk/PEAR/Builder.php	2011-05-31 02:55:30 UTC (rev 311615)
+++ pear/pear-core/trunk/PEAR/Builder.php	2011-05-31 02:55:54 UTC (rev 311616)
@@ -287,6 +287,14 @@
             $dir = dirname($descfile);
         }

+        // Find config. outside of normal path - e.g. config.m4
+        foreach (array_keys($pkg->getInstallationFileList()) as $item) {
+          if (stristr($item, 'config.')) {
+            $dir .= DIRECTORY_SEPARATOR . dirname($item);
+            break;
+          }
+        }
+
         $old_cwd = getcwd();
         if (!file_exists($dir) || !is_dir($dir) || !chdir($dir)) {
             return $this->raiseError("could not chdir to $dir");
@@ -412,6 +420,7 @@
                         . "php-config" .
                        $this->config->get('php_suffix') . " --prefix");
         $this->_harvestInstDir($prefix, $inst_dir . DIRECTORY_SEPARATOR . $prefix, $built_files);
+
         chdir($old_cwd);
         return $built_files;
     }
@@ -433,10 +442,12 @@
         if ($what != 'cmdoutput') {
             return;
         }
+
         $this->log(1, rtrim($data));
         if (preg_match('/You should update your .aclocal.m4/', $data)) {
             return;
         }
+
         $matches = array();
         if (preg_match('/^\s+(\S[^:]+):\s+(\d{8})/', $data, $matches)) {
             $member = preg_replace('/[^a-z]/', '_', strtolower($matches[1]));

--55336d8c722a8715d0bf3c4e0c039e5e5cc91842--