1
0
Fork 0

Clean up svn environment to fix OSX issues, fixes #2708, refs #2146

pull/2722/merge
Jordi Boggiano 2014-02-19 10:55:00 +01:00
parent 5d4900e79d
commit 432ace33d4
4 changed files with 15 additions and 2 deletions

View File

@ -26,6 +26,7 @@ class SvnDownloader extends VcsDownloader
*/
public function doDownload(PackageInterface $package, $path)
{
SvnUtil::cleanEnv();
$url = $package->getSourceUrl();
$ref = $package->getSourceReference();
@ -38,6 +39,7 @@ class SvnDownloader extends VcsDownloader
*/
public function doUpdate(PackageInterface $initial, PackageInterface $target, $path)
{
SvnUtil::cleanEnv();
$url = $target->getSourceUrl();
$ref = $target->getSourceReference();

View File

@ -22,6 +22,7 @@ use Composer\Repository\Vcs\HgDriver;
use Composer\IO\NullIO;
use Composer\Util\ProcessExecutor;
use Composer\Util\Git as GitUtil;
use Composer\Util\Svn as SvnUtil;
/**
* ArrayLoader built for the sole purpose of loading the root package
@ -303,6 +304,8 @@ class RootPackageLoader extends ArrayLoader
private function guessSvnVersion(array $config)
{
SvnUtil::cleanEnv();
// try to fetch current version from svn
if (0 === $this->process->execute('svn info --xml', $output)) {
$trunkPath = isset($config['trunk-path']) ? preg_quote($config['trunk-path'], '#') : 'trunk';

View File

@ -51,6 +51,8 @@ class SvnDriver extends VcsDriver
{
$this->url = $this->baseUrl = rtrim(self::normalizeUrl($this->url), '/');
SvnUtil::cleanEnv();
if (isset($this->repoConfig['trunk-path'])) {
$this->trunkPath = $this->repoConfig['trunk-path'];
}

View File

@ -69,6 +69,12 @@ class Svn
$this->process = $process ?: new ProcessExecutor;
}
public static function cleanEnv()
{
// clean up env for OSX, see https://github.com/composer/composer/issues/2146#issuecomment-35478940
putenv("DYLD_LIBRARY_PATH");
}
/**
* Execute an SVN command and try to fix up the process with credentials
* if necessary.