1
0
Fork 0

Change update to upgrade for package update operations which are upgrades, refs #8594

pull/8566/head
Jordi Boggiano 2020-02-11 13:43:38 +01:00
parent 12a6375548
commit 9609729de7
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
37 changed files with 63 additions and 63 deletions

View File

@ -159,7 +159,7 @@ php composer.phar update
> if the `composer.lock` has not been updated since changes were made to the > if the `composer.lock` has not been updated since changes were made to the
> `composer.json` that might affect dependency resolution. > `composer.json` that might affect dependency resolution.
If you only want to install or update one dependency, you can whitelist them: If you only want to install, upgrade or remove one dependency, you can whitelist them:
```sh ```sh
php composer.phar update monolog/monolog [...] php composer.phar update monolog/monolog [...]

View File

@ -154,7 +154,7 @@ EOT
$updatingToTag = !preg_match('{^[0-9a-f]{40}$}', $updateVersion); $updatingToTag = !preg_match('{^[0-9a-f]{40}$}', $updateVersion);
$io->write(sprintf("Updating to version <info>%s</info> (%s channel).", $updateVersion, $versionsUtil->getChannel())); $io->write(sprintf("Upgrading to version <info>%s</info> (%s channel).", $updateVersion, $versionsUtil->getChannel()));
$remoteFilename = $baseUrl . ($updatingToTag ? "/download/{$updateVersion}/composer.phar" : '/composer.phar'); $remoteFilename = $baseUrl . ($updatingToTag ? "/download/{$updateVersion}/composer.phar" : '/composer.phar');
$signature = $httpDownloader->get($remoteFilename.'.sig')->getBody(); $signature = $httpDownloader->get($remoteFilename.'.sig')->getBody();
$io->writeError(' ', false); $io->writeError(' ', false);

View File

@ -86,7 +86,7 @@ class UpdateOperation extends SolverOperation
$toVersion = $this->targetPackage->getFullPrettyVersion(true, PackageInterface::DISPLAY_DIST_REF); $toVersion = $this->targetPackage->getFullPrettyVersion(true, PackageInterface::DISPLAY_DIST_REF);
} }
$actionName = VersionParser::isUpgrade($this->initialPackage->getVersion(), $this->targetPackage->getVersion()) ? 'Updating' : 'Downgrading'; $actionName = VersionParser::isUpgrade($this->initialPackage->getVersion(), $this->targetPackage->getVersion()) ? 'Upgrading' : 'Downgrading';
return $actionName.' '.$this->initialPackage->getPrettyName().' ('.$fromVersion.' => '.$toVersion.')'; return $actionName.' '.$this->initialPackage->getPrettyName().' ('.$fromVersion.' => '.$toVersion.')';
} }

View File

@ -55,13 +55,13 @@ update a/a b/b --with-dependencies
Loading composer repositories with package information Loading composer repositories with package information
Updating dependencies Updating dependencies
Lock file operations: 0 installs, 2 updates, 0 removals Lock file operations: 0 installs, 2 updates, 0 removals
- Updating a/a (1.0.0 => 1.1.0) - Upgrading a/a (1.0.0 => 1.1.0)
- Updating b/b (1.0.0 => 1.1.0) - Upgrading b/b (1.0.0 => 1.1.0)
Writing lock file Writing lock file
Installing dependencies from lock file (including require-dev) Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals Package operations: 0 installs, 2 updates, 0 removals
Generating autoload files Generating autoload files
--EXPECT-- --EXPECT--
Updating a/a (1.0.0 => 1.1.0) Upgrading a/a (1.0.0 => 1.1.0)
Updating b/b (1.0.0 => 1.1.0) Upgrading b/b (1.0.0 => 1.1.0)

View File

@ -41,4 +41,4 @@ Install from a lock file that deleted a package
install install
--EXPECT-- --EXPECT--
Uninstalling old-dependency (1.0.0) Uninstalling old-dependency (1.0.0)
Updating whitelisted (1.0.0 => 1.1.0) Upgrading whitelisted (1.0.0 => 1.1.0)

View File

@ -93,5 +93,5 @@ update b/b
"platform-dev": [] "platform-dev": []
} }
--EXPECT-- --EXPECT--
Updating a/a (dev-master oldmaster-a => dev-master newmaster-a) Upgrading a/a (dev-master oldmaster-a => dev-master newmaster-a)
Updating b/b (dev-master oldmaster-b => dev-master newmaster-b2) Upgrading b/b (dev-master oldmaster-b => dev-master newmaster-b2)

View File

@ -74,7 +74,7 @@ update b/unstable
"platform-dev": [] "platform-dev": []
} }
--EXPECT-- --EXPECT--
Updating a/old (0.9.0 => 1.0.0) Upgrading a/old (0.9.0 => 1.0.0)
Downgrading b/unstable (1.1.0-alpha => 1.0.0) Downgrading b/unstable (1.1.0-alpha => 1.0.0)
Downgrading c/uptodate (2.0.0 => 1.0.0) Downgrading c/uptodate (2.0.0 => 1.0.0)
Installing d/removed (1.0.0) Installing d/removed (1.0.0)

View File

@ -97,9 +97,9 @@ update b/b
"platform-dev": [] "platform-dev": []
} }
--EXPECT-- --EXPECT--
Updating a/a (dev-master oldmaster-a => dev-master newmaster-a) Upgrading a/a (dev-master oldmaster-a => dev-master newmaster-a)
Marking a/a (2.2.x-dev newmaster-a) as installed, alias of a/a (dev-master newmaster-a) Marking a/a (2.2.x-dev newmaster-a) as installed, alias of a/a (dev-master newmaster-a)
Updating b/b (dev-master oldmaster-b => dev-master newmaster-b2) Upgrading b/b (dev-master oldmaster-b => dev-master newmaster-b2)
Marking b/b (2.3.x-dev newmaster-b2) as installed, alias of b/b (dev-master newmaster-b2) Marking b/b (2.3.x-dev newmaster-b2) as installed, alias of b/b (dev-master newmaster-b2)
Marking a/a (2.1.x-dev oldmaster-a) as uninstalled, alias of a/a (dev-master oldmaster-a) Marking a/a (2.1.x-dev oldmaster-a) as uninstalled, alias of a/a (dev-master oldmaster-a)
Marking b/b (2.1.x-dev oldmaster-b) as uninstalled, alias of b/b (dev-master oldmaster-b) Marking b/b (2.1.x-dev oldmaster-b) as uninstalled, alias of b/b (dev-master oldmaster-b)

View File

@ -38,4 +38,4 @@ The locked version will not get overwritten by an install
--RUN-- --RUN--
install install
--EXPECT-- --EXPECT--
Updating foo/baz (1.0.0 => 2.0.0) Upgrading foo/baz (1.0.0 => 2.0.0)

View File

@ -59,4 +59,4 @@ update
"platform-dev": [] "platform-dev": []
} }
--EXPECT-- --EXPECT--
Updating a/a (dev-master 1234 => dev-master master) Upgrading a/a (dev-master 1234 => dev-master master)

View File

@ -33,5 +33,5 @@ Update aliased package to non-aliased version
--RUN-- --RUN--
update update
--EXPECT-- --EXPECT--
Updating a/a (dev-master master => dev-foo foo) Upgrading a/a (dev-master master => dev-foo foo)
Marking a/a (1.0.x-dev master) as uninstalled, alias of a/a (dev-master master) Marking a/a (1.0.x-dev master) as uninstalled, alias of a/a (dev-master master)

View File

@ -44,6 +44,6 @@ Lock file operations: 3 installs, 0 updates, 0 removals
- Locking a/c (1.0.0) - Locking a/c (1.0.0)
Installing dependencies from lock file (including require-dev) Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals Package operations: 0 installs, 2 updates, 0 removals
- Updating a/a (1.0.0 => 1.0.1) - Upgrading a/a (1.0.0 => 1.0.1)
- Updating a/b (1.0.0 => 2.0.0) - Upgrading a/b (1.0.0 => 2.0.0)
--EXPECT-- --EXPECT--

View File

@ -36,5 +36,5 @@ Updates updateable packages
--RUN-- --RUN--
update update
--EXPECT-- --EXPECT--
Updating a/a (1.0.0 => 1.0.1) Upgrading a/a (1.0.0 => 1.0.1)
Updating a/b (1.0.0 => 2.0.0) Upgrading a/b (1.0.0 => 2.0.0)

View File

@ -214,7 +214,7 @@ g/g is dev and installed in a different ref than the #ref, so it gets updated an
--RUN-- --RUN--
update a/a b/b d/d g/g update a/a b/b d/d g/g
--EXPECT-- --EXPECT--
Updating a/a (dev-master 1111111 => dev-master 2222222) Upgrading a/a (dev-master 1111111 => dev-master 2222222)
Updating b/b (2.0.3 1111111 => 2.0.3 2222222) Upgrading b/b (2.0.3 1111111 => 2.0.3 2222222)
Installing e/e (dev-master 1111111) Installing e/e (dev-master 1111111)
Updating g/g (dev-master 0000000 => dev-master 1111111) Upgrading g/g (dev-master 0000000 => dev-master 1111111)

View File

@ -35,4 +35,4 @@ Updating a dev package selects its newest version but no providers
--RUN-- --RUN--
update update
--EXPECT-- --EXPECT--
Updating a/installed (dev-master oldref => dev-master newref) Upgrading a/installed (dev-master oldref => dev-master newref)

View File

@ -93,4 +93,4 @@ update
"platform-dev": [] "platform-dev": []
} }
--EXPECT-- --EXPECT--
Updating a/a (dev-master oldmaster => dev-master newmaster) Upgrading a/a (dev-master oldmaster => dev-master newmaster)

View File

@ -38,4 +38,4 @@ Updating a dev package to its latest ref should pick up new dependencies
update update
--EXPECT-- --EXPECT--
Installing a/dependency (dev-master ref) Installing a/dependency (dev-master ref)
Updating a/devpackage (dev-master oldref => dev-master newref) Upgrading a/devpackage (dev-master oldref => dev-master newref)

View File

@ -23,4 +23,4 @@ Update in ignore-platform-reqs mode
--RUN-- --RUN--
update --ignore-platform-reqs update --ignore-platform-reqs
--EXPECT-- --EXPECT--
Updating a/a (1.0.0 => 1.0.1) Upgrading a/a (1.0.0 => 1.0.1)

View File

@ -28,4 +28,4 @@ Updating a dev package forcing it's reference should not do anything if the refe
--RUN-- --RUN--
update update
--EXPECT-- --EXPECT--
Updating a/a (dev-master def000 => dev-master ) Upgrading a/a (dev-master def000 => dev-master )

View File

@ -61,8 +61,8 @@ Updates with --no-dev but we still end up with a complete lock file including de
update --no-dev update --no-dev
--EXPECT-- --EXPECT--
Uninstalling a/b (1.0.0) Uninstalling a/b (1.0.0)
Updating a/a (1.0.0 => 1.0.1) Upgrading a/a (1.0.0 => 1.0.1)
Installing a/c (1.0.0) Installing a/c (1.0.0)
Updating dev/pkg (dev-master old => dev-master new) Upgrading dev/pkg (dev-master old => dev-master new)
Marking dev/pkg (1.1.x-dev new) as installed, alias of dev/pkg (dev-master new) Marking dev/pkg (1.1.x-dev new) as installed, alias of dev/pkg (dev-master new)
Marking dev/pkg (1.0.x-dev old) as uninstalled, alias of dev/pkg (dev-master old) Marking dev/pkg (1.0.x-dev old) as uninstalled, alias of dev/pkg (dev-master old)

View File

@ -62,4 +62,4 @@ update mirrors
"platform-dev": [] "platform-dev": []
} }
--EXPECT-- --EXPECT--
Updating a/a (1.0.0 old-hg-ref => 1.0.0 new-git-ref) Upgrading a/a (1.0.0 old-hg-ref => 1.0.0 new-git-ref)

View File

@ -36,5 +36,5 @@ Updates packages to their lowest stable version
--RUN-- --RUN--
update --prefer-lowest --prefer-stable update --prefer-lowest --prefer-stable
--EXPECT-- --EXPECT--
Updating a/a (1.0.0-rc1 => 1.0.1) Upgrading a/a (1.0.0-rc1 => 1.0.1)
Downgrading a/b (1.0.1 => 1.0.0) Downgrading a/b (1.0.1 => 1.0.0)

View File

@ -28,4 +28,4 @@ Updating a dev package should update to the latest available reference
--RUN-- --RUN--
update update
--EXPECT-- --EXPECT--
Updating a/a (dev-master def000 => dev-master abc123) Upgrading a/a (dev-master def000 => dev-master abc123)

View File

@ -27,4 +27,4 @@ Updates a dev package forcing it's reference
--RUN-- --RUN--
install install
--EXPECT-- --EXPECT--
Updating a/a (dev-master abc123 => dev-master def000) Upgrading a/a (dev-master abc123 => dev-master def000)

View File

@ -49,5 +49,5 @@ Update with a package whitelist only updates those packages if they are not pres
--RUN-- --RUN--
update whitelisted dependency update whitelisted dependency
--EXPECT-- --EXPECT--
Updating dependency (1.0.0 => 1.1.0) Upgrading dependency (1.0.0 => 1.1.0)
Updating whitelisted (1.0.0 => 1.1.0) Upgrading whitelisted (1.0.0 => 1.1.0)

View File

@ -60,6 +60,6 @@ Update with a package whitelist pattern and all-dependencies flag updates packag
--RUN-- --RUN--
update whitelisted-* --with-all-dependencies update whitelisted-* --with-all-dependencies
--EXPECT-- --EXPECT--
Updating whitelisted-component1 (1.0.0 => 1.1.0) Upgrading whitelisted-component1 (1.0.0 => 1.1.0)
Updating dependency (1.0.0 => 1.1.0) Upgrading dependency (1.0.0 => 1.1.0)
Updating whitelisted-component2 (1.0.0 => 1.1.0) Upgrading whitelisted-component2 (1.0.0 => 1.1.0)

View File

@ -62,6 +62,6 @@ Update with a package whitelist only updates those packages and their dependenci
--RUN-- --RUN--
update whitelisted-* --with-dependencies update whitelisted-* --with-dependencies
--EXPECT-- --EXPECT--
Updating whitelisted-component1 (1.0.0 => 1.1.0) Upgrading whitelisted-component1 (1.0.0 => 1.1.0)
Updating dependency (1.0.0 => 1.1.0) Upgrading dependency (1.0.0 => 1.1.0)
Updating whitelisted-component2 (1.0.0 => 1.1.0) Upgrading whitelisted-component2 (1.0.0 => 1.1.0)

View File

@ -72,6 +72,6 @@ Update with a package whitelist only updates those packages and their dependenci
--RUN-- --RUN--
update whitelisted-* --with-dependencies update whitelisted-* --with-dependencies
--EXPECT-- --EXPECT--
Updating dependency (1.0.0 => 1.1.0) Upgrading dependency (1.0.0 => 1.1.0)
Updating whitelisted-component2 (1.0.0 => 1.1.0) Upgrading whitelisted-component2 (1.0.0 => 1.1.0)
Updating whitelisted-component1 (1.0.0 => 1.1.0) Upgrading whitelisted-component1 (1.0.0 => 1.1.0)

View File

@ -57,5 +57,5 @@ Update with a package whitelist only updates those packages matching the pattern
--RUN-- --RUN--
update whitelisted-* update whitelisted-*
--EXPECT-- --EXPECT--
Updating whitelisted-component1 (1.0.0 => 1.1.0) Upgrading whitelisted-component1 (1.0.0 => 1.1.0)
Updating whitelisted-component2 (1.0.0 => 1.1.0) Upgrading whitelisted-component2 (1.0.0 => 1.1.0)

View File

@ -63,7 +63,7 @@ Update with a package whitelist only updates those corresponding to the pattern
--RUN-- --RUN--
update vendor/Test* exact/Test-Package notexact/Test all/* no/reg?xp update vendor/Test* exact/Test-Package notexact/Test all/* no/reg?xp
--EXPECT-- --EXPECT--
Updating all/Package1 (1.0 => 2.0) Upgrading all/Package1 (1.0 => 2.0)
Updating all/Package2 (1.0 => 2.0) Upgrading all/Package2 (1.0 => 2.0)
Updating exact/Test-Package (1.0 => 2.0) Upgrading exact/Test-Package (1.0 => 2.0)
Updating vendor/Test-Package (1.0 => 2.0) Upgrading vendor/Test-Package (1.0 => 2.0)

View File

@ -43,6 +43,6 @@ Limited update takes rules from lock if available, and not from the installed re
--RUN-- --RUN--
update toupdate/installed update toupdate/installed
--EXPECT-- --EXPECT--
Updating old/installed (0.9.0 => 1.0.0) Upgrading old/installed (0.9.0 => 1.0.0)
Updating toupdate/installed (1.0.0 => 1.1.0) Upgrading toupdate/installed (1.0.0 => 1.1.0)
Installing toupdate/notinstalled (1.0.0) Installing toupdate/notinstalled (1.0.0)

View File

@ -45,4 +45,4 @@ Update with a package whitelist removes unused packages
update --with-dependencies whitelisted update --with-dependencies whitelisted
--EXPECT-- --EXPECT--
Uninstalling old-dependency (1.0.0) Uninstalling old-dependency (1.0.0)
Updating whitelisted (1.0.0 => 1.1.0) Upgrading whitelisted (1.0.0 => 1.1.0)

View File

@ -52,5 +52,5 @@ Update with a package whitelist only updates those packages and their dependenci
--RUN-- --RUN--
update whitelisted --with-dependencies update whitelisted --with-dependencies
--EXPECT-- --EXPECT--
Updating dependency (1.0.0 => 1.1.0) Upgrading dependency (1.0.0 => 1.1.0)
Updating whitelisted (1.0.0 => 1.1.0) Upgrading whitelisted (1.0.0 => 1.1.0)

View File

@ -54,4 +54,4 @@ Update with a package whitelist only updates those packages listed as command ar
--RUN-- --RUN--
update whitelisted update whitelisted
--EXPECT-- --EXPECT--
Updating whitelisted (1.0.0 => 1.1.0) Upgrading whitelisted (1.0.0 => 1.1.0)

View File

@ -50,13 +50,13 @@ update b/b --with-all-dependencies
Loading composer repositories with package information Loading composer repositories with package information
Updating dependencies Updating dependencies
Lock file operations: 0 installs, 2 updates, 0 removals Lock file operations: 0 installs, 2 updates, 0 removals
- Updating a/a (1.0.0 => 1.1.0) - Upgrading a/a (1.0.0 => 1.1.0)
- Updating b/b (1.0.0 => 1.1.0) - Upgrading b/b (1.0.0 => 1.1.0)
Writing lock file Writing lock file
Installing dependencies from lock file (including require-dev) Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals Package operations: 0 installs, 2 updates, 0 removals
Generating autoload files Generating autoload files
--EXPECT-- --EXPECT--
Updating a/a (1.0.0 => 1.1.0) Upgrading a/a (1.0.0 => 1.1.0)
Updating b/b (1.0.0 => 1.1.0) Upgrading b/b (1.0.0 => 1.1.0)

View File

@ -42,4 +42,4 @@ Installing locked dev packages should remove old dependencies
install install
--EXPECT-- --EXPECT--
Uninstalling a/dependency (dev-master ref) Uninstalling a/dependency (dev-master ref)
Updating a/devpackage (dev-master oldref => dev-master newref) Upgrading a/devpackage (dev-master oldref => dev-master newref)

View File

@ -65,4 +65,4 @@ update
"platform-dev": [] "platform-dev": []
} }
--EXPECT-- --EXPECT--
Updating a/a (dev-master oldref => dev-master newref) Upgrading a/a (dev-master oldref => dev-master newref)