8000 minor #19240 [travis] Fix deps=low/high patching (nicolas-grekas) · symfony/symfony@3ef96b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3ef96b9

Browse files
minor #19240 [travis] Fix deps=low/high patching (nicolas-grekas)
This PR was merged into the 2.7 branch. Discussion ---------- [travis] Fix deps=low/high patching | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Deps=low/high are broken since we added depth=1 to the git checkout on travis... This fixes the situation and ensures it won't happen again by adding a missing error check. Commits ------- 5ec92e8 [travis] Fix deps=low/high patching
2 parents 79fbbde + 5ec92e8 commit 3ef96b9

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.travis.php renamed to .github/travis.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
<?php
22

33
if (4 > $_SERVER['argc']) {
4-
echo "Usage: branch dir1 dir2 ... dirN\n";
4+
echo "Usage: branch version dir1 dir2 ... dirN\n";
55
exit(1);
66
}
77

88
$dirs = $_SERVER['argv'];
99
array_shift($dirs);
1010
$branch = array_shift($dirs);
11+
$version = array_shift($dirs);
1112

1213
$packages = array();
1314
$flags = PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
1415

1516
foreach ($dirs as $dir) {
16-
if (!`git diff --name-only $branch...HEAD -- $dir`) {
17+
if (!system("git diff --name-only $branch...HEAD -- $dir", $exitStatus)) {
18+
if ($exitStatus) {
19+
exit($exitStatus);
20+
}
1721
continue;
1822
}
1923
echo "$dir\n";
@@ -32,7 +36,7 @@
3236
file_put_contents($dir.'/composer.json', $json);
3337
passthru("cd $dir && tar -cf package.tar --exclude='package.tar' *");
3438

35-
$package->version = $branch.'.x-dev';
39+
$package->version = $version.'.x-dev';
3640
$package->dist['type'] = 'tar';
3741
$package->dist['url'] = 'file://'.__DIR__."/$dir/package.tar";
3842

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ before_install:
6464
install:
6565
- if [[ ! $skip ]]; then COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi
6666
# Create local composer packages for each patched components and reference them in composer.json files when cross-testing components
67-
- if [[ ! $skip && $deps ]]; then php .travis.php $TRAVIS_BRANCH $COMPONENTS; fi
67+
- if [[ ! $skip && $deps ]]; then git fetch origin $TRAVIS_BRANCH && php .github/travis.php FETCH_HEAD $TRAVIS_BRANCH $COMPONENTS; fi
6868
# For the master branch when deps=high, the version before master is checked out and tested with the locally patched components
6969
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//); else SYMFONY_VERSION=$(cat composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*'); fi
7070
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); ./phpunit install; fi

0 commit comments

Comments
 (0)
0