Browse Source

Skip duplicate tags quietly instead of blowing up

Jordi Boggiano 8 years ago
parent
commit
f30c10eb50
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/Packagist/WebBundle/Package/Updater.php

+ 7 - 0
src/Packagist/WebBundle/Package/Updater.php

@@ -179,6 +179,7 @@ class Updater
         }
 
         $lastUpdated = true;
+        $lastProcessed = null;
         foreach ($versions as $version) {
             if ($version instanceof AliasPackage) {
                 continue;
@@ -188,6 +189,12 @@ class Updater
                 continue;
             }
 
+            if ($lastProcessed && $lastProcessed->getVersion() === $version->getVersion()) {
+                $io->write('Skipping version '.$version->getPrettyVersion().' (duplicate of '.$lastProcessed->getPrettyVersion().')', true, IOInterface::VERBOSE);
+                continue;
+            }
+            $lastProcessed = $version;
+
             $lastUpdated = $this->updateInformation($package, $version, $flags);
             if ($lastUpdated) {
                 $em->flush();