Skip to content

Instantly share code, notes, and snippets.

@till
Created July 2, 2011 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save till/1061465 to your computer and use it in GitHub Desktop.
Save till/1061465 to your computer and use it in GitHub Desktop.
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