From f70b3b01522394e918c764b33d8f56b6803da552 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 9 Apr 2020 16:25:10 +0200 Subject: [PATCH 1/4] Avoid warning about --2 usage when no channel is requested --- src/Composer/Command/SelfUpdateCommand.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index daaab2b97..9984f1547 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -84,8 +84,10 @@ EOT $versionsUtil = new Versions($config, $remoteFilesystem); // switch channel if requested + $requestedChannel = null; foreach (Versions::CHANNELS as $channel) { if ($input->getOption($channel)) { + $requestedChannel = $channel; $versionsUtil->setChannel($channel); break; } @@ -130,8 +132,8 @@ EOT $latestVersion = $latest['version']; $updateVersion = $input->getArgument('version') ?: $latestVersion; - if (is_numeric($channel) && substr($latestStable['version'], 0, 1) !== $channel) { - $io->writeError('Warning: You forced the install of '.$latestVersion.' via --'.$channel.', but '.$latestStable['version'].' is the latest stable version. Updating to it via composer self-update --stable is recommended.'); + if ($requestedChannel && is_numeric($requestedChannel) && substr($latestStable['version'], 0, 1) !== $requestedChannel) { + $io->writeError('Warning: You forced the install of '.$latestVersion.' via --'.$requestedChannel.', but '.$latestStable['version'].' is the latest stable version. Updating to it via composer self-update --stable is recommended.'); } if (preg_match('{^[0-9a-f]{40}$}', $updateVersion) && $updateVersion !== $latestVersion) { From 0001635016a2b8f9c3323cb751d5351f187aecfa Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 9 Apr 2020 16:26:26 +0200 Subject: [PATCH 2/4] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5178e417..e92df4918 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### [1.10.3] 2020-04-09 + + * Fixed invalid --2 flag warning in `self-update` when no channel is requested + ### [1.10.2] 2020-04-09 * Added --1 flag to `self-update` command which can be added to automated self-update runs to make sure it won't automatically jump to 2.0 once that is released @@ -833,6 +837,7 @@ * Initial release +[1.10.3]: https://github.com/composer/composer/compare/1.10.2...1.10.3 [1.10.2]: https://github.com/composer/composer/compare/1.10.1...1.10.2 [1.10.1]: https://github.com/composer/composer/compare/1.10.0...1.10.1 [1.10.0]: https://github.com/composer/composer/compare/1.10.0-RC...1.10.0 From e121de35a3231764dadb42f43ffa813262f46b18 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 9 Apr 2020 17:01:33 +0200 Subject: [PATCH 3/4] Fix variable used for symlinking absolute paths, refs #8700 --- src/Composer/Downloader/PathDownloader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Downloader/PathDownloader.php b/src/Composer/Downloader/PathDownloader.php index d7f0c06ee..1e614b6bd 100644 --- a/src/Composer/Downloader/PathDownloader.php +++ b/src/Composer/Downloader/PathDownloader.php @@ -129,7 +129,7 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter if ($transportOptions['relative']) { $fileSystem->symlink($shortestPath, $path); } else { - $fileSystem->symlink($absolutePath, $path); + $fileSystem->symlink($realUrl, $path); } } } catch (IOException $e) { From eb314c5971cf32d3c32d901fa83ad01e1abdf485 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 9 Apr 2020 17:05:43 +0200 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e92df4918..39f4a70e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### [1.10.4] 2020-04-09 + + * Fixed 1.10.2 regression in path symlinking with absolute path repos + ### [1.10.3] 2020-04-09 * Fixed invalid --2 flag warning in `self-update` when no channel is requested @@ -837,6 +841,7 @@ * Initial release +[1.10.4]: https://github.com/composer/composer/compare/1.10.3...1.10.4 [1.10.3]: https://github.com/composer/composer/compare/1.10.2...1.10.3 [1.10.2]: https://github.com/composer/composer/compare/1.10.1...1.10.2 [1.10.1]: https://github.com/composer/composer/compare/1.10.0...1.10.1