diff --git a/doc/04-schema.md b/doc/04-schema.md index 28d0b4ecd..ee61c14c5 100644 --- a/doc/04-schema.md +++ b/doc/04-schema.md @@ -442,9 +442,15 @@ that exact version, and not any other version, which would be incorrect. #### provide List of other packages that are provided by this package. This is mostly -useful for common interfaces. A package could depend on some virtual -`logger` package, any library that implements this logger interface would -simply list it in `provide`. +useful for implementations of common interfaces. A package could depend on +some virtual `logger-implementation` package, any library that implements +this logger interface would simply list it in `provide`. +Using `provide` with the name of an actual package rather than a virtual one +implies that the code of that package is also shipped, in which case `replace` +is generally a better choice. A common convention for packages providing an +interface and relying on other packages to provide an implementation (for +instance the PSR interfaces) is to use a `-implementation` suffix for the +name of the virtual package corresponding to the interface package. #### suggest diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index e6d4ed4eb..712ccd14f 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -176,8 +176,19 @@ EOT return 1; } + $channelString = $versionsUtil->getChannel(); + if (is_numeric($channelString)) { + $channelString .= '.x'; + } + if (Composer::VERSION === $updateVersion) { - $io->writeError(sprintf('You are already using composer version %s (%s channel).', $updateVersion, $versionsUtil->getChannel())); + $io->writeError( + sprintf( + 'You are already using composer version %s (%s channel).', + $updateVersion, + $channelString + ) + ); // remove all backups except for the most recent, if any if ($input->getOption('clean-backups')) { @@ -198,7 +209,7 @@ EOT $updatingToTag = !preg_match('{^[0-9a-f]{40}$}', $updateVersion); - $io->write(sprintf("Upgrading to version %s (%s channel).", $updateVersion, $versionsUtil->getChannel())); + $io->write(sprintf("Upgrading to version %s (%s channel).", $updateVersion, $channelString)); $remoteFilename = $baseUrl . ($updatingToTag ? "/download/{$updateVersion}/composer.phar" : '/composer.phar'); $signature = $httpDownloader->get($remoteFilename.'.sig')->getBody(); $io->writeError(' ', false); diff --git a/src/Composer/Package/Archiver/ArchivableFilesFinder.php b/src/Composer/Package/Archiver/ArchivableFilesFinder.php index 150e5f48e..4a8042abe 100644 --- a/src/Composer/Package/Archiver/ArchivableFilesFinder.php +++ b/src/Composer/Package/Archiver/ArchivableFilesFinder.php @@ -43,7 +43,7 @@ class ArchivableFilesFinder extends \FilterIterator { $fs = new Filesystem(); - $sources = $fs->normalizePath($sources); + $sources = $fs->normalizePath(realpath($sources)); if ($ignoreFilters) { $filters = array(); @@ -58,7 +58,7 @@ class ArchivableFilesFinder extends \FilterIterator $this->finder = new Finder(); $filter = function (\SplFileInfo $file) use ($sources, $filters, $fs) { - if ($file->isLink() && strpos($file->getLinkTarget(), $sources) !== 0) { + if ($file->isLink() && strpos($file->getRealPath(), $sources) !== 0) { return false; }