1
0
Fork 0

Always dump packages, even if only an alias is added, fixes #1809

pull/1840/merge
Jordi Boggiano 2013-04-28 13:29:15 +02:00
parent 606f5839f1
commit 33af9eea95
2 changed files with 13 additions and 5 deletions

View File

@ -197,6 +197,10 @@ EOF;
$packageMap = array(array($mainPackage, ''));
foreach ($packages as $package) {
// unfold aliased packages
while ($package instanceof AliasPackage && !in_array($package->getAliasOf(), $packages, true)) {
$package = $package->getAliasOf();
}
if ($package instanceof AliasPackage) {
continue;
}

View File

@ -76,15 +76,19 @@ class FilesystemRepository extends ArrayRepository implements WritableRepository
*/
public function write()
{
$packages = array();
$data = array();
$dumper = new ArrayDumper();
foreach ($this->getPackages() as $package) {
$packages = $this->getPackages();
foreach ($packages as $package) {
// unfold aliased packages
while ($package instanceof AliasPackage && !in_array($package->getAliasOf(), $packages, true)) {
$package = $package->getAliasOf();
}
if (!$package instanceof AliasPackage) {
$data = $dumper->dump($package);
$packages[] = $data;
$data[] = $dumper->dump($package);
}
}
$this->file->write($packages);
$this->file->write($data);
}
}