Add pretty constraint to links in PlatformRepository

fixes #9210
main
Michael Telgmann 4 years ago
parent e3c6b213e7
commit 4f4c299015
No known key found for this signature in database
GPG Key ID: 58B3260258E8D84B

@ -548,7 +548,9 @@ class PlatformRepository extends ArrayRepository
$ext->setDescription('The '.$name.' PHP extension'.$extraDescription);
if ($name === 'uuid') {
$ext->setReplaces(array(new Link('ext-uuid', 'lib-uuid', new Constraint('=', $version))));
$ext->setReplaces(array(
new Link('ext-uuid', 'lib-uuid', new Constraint('=', $version), 'replaces', $ext->getPrettyVersion())
));
}
$this->addPackage($ext);
@ -585,8 +587,8 @@ class PlatformRepository extends ArrayRepository
$lib = new CompletePackage('lib-'.$name, $version, $prettyVersion);
$lib->setDescription($description);
$links = function ($alias) use ($name, $version) {
return new Link('lib-'.$name, 'lib-'.$alias, new Constraint('=', $version));
$links = function ($alias) use ($name, $version, $lib) {
return new Link('lib-'.$name, 'lib-'.$alias, new Constraint('=', $version), 'replaces', $lib->getPrettyVersion());
};
$lib->setReplaces(array_map($links, $replaces));
$lib->setProvides(array_map($links, $provides));

Loading…
Cancel
Save