From 57ed58346a10d7d1a4dbc823e23cd3f2b698ad38 Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Mon, 26 Jun 2017 17:48:19 +0200 Subject: [PATCH 1/3] Be strict and return non-zero exit code for outdated packages when showing all --- src/Composer/Command/ShowCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index c27f084a3..fb4d49e99 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -353,7 +353,7 @@ EOT } if ($input->getOption('outdated') && $latestPackage && $latestPackage->getFullPrettyVersion() === $package->getFullPrettyVersion() && !$latestPackage->isAbandoned()) { continue; - } elseif ($input->getOption('outdated')) { + } elseif ($input->getOption('outdated') || $input->getOption('strict')) { $hasOutdatedPackages = true; } From 9afbddab6ba14cf4b90146d3ecfe8455be2895bd Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 6 Aug 2017 16:54:17 +0200 Subject: [PATCH 2/3] Only update dist references when one existed already, fixes #6363 --- src/Composer/Installer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 122a4e9f0..10744d541 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -1187,10 +1187,12 @@ class Installer } $package->setSourceReference($reference); - $package->setDistReference($reference); if (preg_match('{^https?://(?:(?:www\.)?bitbucket\.org|(api\.)?github\.com)/}i', $package->getDistUrl())) { + $package->setDistReference($reference); $package->setDistUrl(preg_replace('{(?<=/)[a-f0-9]{40}(?=/|$)}i', $reference, $package->getDistUrl())); + } else if ($package->getDistReference()) { // update the dist reference if there was one, but if none was provided ignore it + $package->setDistReference($reference); } } From bf940fb21b0dcc830e8c8430a3cc9d7f3ac607c0 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 6 Aug 2017 17:21:04 +0200 Subject: [PATCH 3/3] Fix exclude-from-classmap when a package is installed as a symlink, fixes #6397 --- src/Composer/Autoload/ClassMapGenerator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Composer/Autoload/ClassMapGenerator.php b/src/Composer/Autoload/ClassMapGenerator.php index d4d2b0b6e..649c700c8 100644 --- a/src/Composer/Autoload/ClassMapGenerator.php +++ b/src/Composer/Autoload/ClassMapGenerator.php @@ -90,7 +90,8 @@ class ClassMapGenerator $filePath = preg_replace('{[\\\\/]{2,}}', '/', $filePath); } - if ($blacklist && preg_match($blacklist, strtr($filePath, '\\', '/'))) { + // check the realpath of the file against the blacklist as the path might be a symlink and the blacklist is realpath'd so symlink are resolved + if ($blacklist && preg_match($blacklist, strtr(realpath($filePath), '\\', '/'))) { continue; }