1
0
Fork 0

Fix handling of aliases in streamable repos, fixes #1776, fixes #1749

pull/1781/head
Jordi Boggiano 2013-04-08 15:37:29 +02:00
parent e82cf6835e
commit a0d1d59868
1 changed files with 6 additions and 3 deletions

View File

@ -112,7 +112,7 @@ class Pool
$this->packages[] = $package; $this->packages[] = $package;
foreach ($names as $provided) { foreach ($names as $provided) {
$this->packageByName[$provided][] =& $this->packages[$this->id - 2]; $this->packageByName[$provided][$package['id']] = $this->packages[$this->id - 2];
} }
// handle root package aliases // handle root package aliases
@ -134,7 +134,7 @@ class Pool
$this->packages[] = $alias; $this->packages[] = $alias;
foreach ($names as $provided) { foreach ($names as $provided) {
$this->packageByName[$provided][] =& $this->packages[$this->id - 2]; $this->packageByName[$provided][$alias['id']] = $this->packages[$this->id - 2];
} }
} }
@ -149,7 +149,7 @@ class Pool
$this->packages[] = $alias; $this->packages[] = $alias;
foreach ($names as $provided) { foreach ($names as $provided) {
$this->packageByName[$provided][] =& $this->packages[$this->id - 2]; $this->packageByName[$provided][$alias['id']] = $this->packages[$this->id - 2];
} }
} }
} }
@ -349,6 +349,9 @@ class Pool
$package = $this->packages[$data['id'] - 1] = $data['repo']->loadPackage($data); $package = $this->packages[$data['id'] - 1] = $data['repo']->loadPackage($data);
} }
foreach ($package->getNames() as $name) {
$this->packageByName[$name][$data['id']] = $package;
}
$package->setId($data['id']); $package->setId($data['id']);
$data = $package; $data = $package;
} }