code: protected function formatPackagesUnique($pool, array $packages)
      {
          $prepared = array();
          foreach ($packages as $package) {
              if (!is_object($package)) {
                  $package = $pool->literalToPackage($package);
              }
              $prepared[$package->getName()]['name'] = $package->getPrettyName();
              $prepared[$package->getName()]['versions'][$package->getVersion()] = $package->getPrettyVersion();
          }
          foreach ($prepared as $name => $package) {
              $prepared[$name] = $package['name'].'['.implode(', ', $package['versions']).']';
          }
  
          return implode(', ', $prepared);
      }
docs: @param Pool  $pool
  @param array $packages
  
  @return string