1
0
Fork 0

Fix handling of composer repos with v1 version_normalized format

pull/8684/head
Jordi Boggiano 2020-03-11 16:11:12 +01:00
parent a7a975ec1c
commit d13ce20b6e
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 0 deletions

View File

@ -560,6 +560,9 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
if (!isset($versionsToLoad[$version['uid']])) { if (!isset($versionsToLoad[$version['uid']])) {
if (!isset($version['version_normalized'])) { if (!isset($version['version_normalized'])) {
$version['version_normalized'] = $this->versionParser->normalize($version['version']); $version['version_normalized'] = $this->versionParser->normalize($version['version']);
} elseif ($version['version_normalized'] === '9999999-dev') {
// handling of existing repos which need to remain composer v1 compatible, in case the version_normalized contained 9999999-dev, we renormalize it
$version['version_normalized'] = $this->versionParser->normalize($version['version']);
} }
if ($this->isVersionAcceptable($acceptableStabilities, $stabilityFlags, null, $normalizedName, $version)) { if ($this->isVersionAcceptable($acceptableStabilities, $stabilityFlags, null, $normalizedName, $version)) {
@ -678,6 +681,9 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
foreach ($versions as $version) { foreach ($versions as $version) {
if (!isset($version['version_normalized'])) { if (!isset($version['version_normalized'])) {
$version['version_normalized'] = $repo->versionParser->normalize($version['version']); $version['version_normalized'] = $repo->versionParser->normalize($version['version']);
} elseif ($version['version_normalized'] === '9999999-dev') {
// handling of existing repos which need to remain composer v1 compatible, in case the version_normalized contained 9999999-dev, we renormalize it
$version['version_normalized'] = $this->versionParser->normalize($version['version']);
} }
if ($repo->isVersionAcceptable($acceptableStabilities, $stabilityFlags, $constraint, $realName, $version)) { if ($repo->isVersionAcceptable($acceptableStabilities, $stabilityFlags, $constraint, $realName, $version)) {