Refactor code so it works cross-platform, refs #2825
parent
01bf61fede
commit
07b8fe8109
|
@ -47,13 +47,15 @@ class SvnDownloader extends VcsDownloader
|
||||||
throw new \RuntimeException('The .svn directory is missing from '.$path.', see http://getcomposer.org/commit-deps for more information');
|
throw new \RuntimeException('The .svn directory is missing from '.$path.', see http://getcomposer.org/commit-deps for more information');
|
||||||
}
|
}
|
||||||
|
|
||||||
$ignoreAncestryCommand = "";
|
$flags = "";
|
||||||
if ((int)$this->process->execute("svn --version | egrep 'version [0-9\.]+' -o | tr -d 'version .'") >= 170) {
|
if (0 === $this->process->execute('svn --version', $output)) {
|
||||||
$ignoreAncestryCommand = " --ignore-ancestry";
|
if (preg_match('{(\d+(?:\.\d+)+)}', $output, $match) && version_compare($match[1], '1.7.0', '>=')) {
|
||||||
|
$flags .= ' --ignore-ancestry';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->io->write(" Checking out " . $ref);
|
$this->io->write(" Checking out " . $ref);
|
||||||
$this->execute($url, "svn switch" . $ignoreAncestry, sprintf("%s/%s", $url, $ref), $path);
|
$this->execute($url, "svn switch" . $flags, sprintf("%s/%s", $url, $ref), $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue