Created
July 2, 2011 18:01
-
-
Save till/1061465 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: PEAR/Builder.php | |
=================================================================== | |
--- PEAR/Builder.php (revision 312817) | |
+++ PEAR/Builder.php (working copy) | |
@@ -288,12 +288,24 @@ | |
} | |
// Find config. outside of normal path - e.g. config.m4 | |
+ $tempDir = ''; | |
foreach (array_keys($pkg->getInstallationFileList()) as $item) { | |
- if (stristr($item, 'config.')) { | |
- $dir .= DIRECTORY_SEPARATOR . dirname($item); | |
+ $fileBaseName = basename($item); | |
+ | |
+ // the next line is more or less or guess | |
+ if (!stristr($fileBaseName, 'config.')) { | |
+ continue; | |
+ } | |
+ $tempDir = DIRECTORY_SEPARATOR . dirname($item); | |
+ | |
+ // If the file is not config.m4, we keep looking. | |
+ if (strtolower($fileBaseName) == 'config.m4') { | |
break; | |
} | |
} | |
+ if (!empty($tempDir)) { | |
+ $dir .= $tempDir; | |
+ } | |
$old_cwd = getcwd(); | |
if (!file_exists($dir) || !is_dir($dir) || !chdir($dir)) { | |
@@ -513,4 +525,4 @@ | |
} | |
return PEAR_Common::log($level, $msg); | |
} | |
-} | |
\ No newline at end of file | |
+} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment