Selaa lähdekoodia

Updated vendors to Symfony 2.0.10

Christophe Coevoet 13 vuotta sitten
vanhempi
commit
9f488ad774
3 muutettua tiedostoa jossa 80 lisäystä ja 54 poistoa
  1. 53 28
      bin/vendors
  2. 9 8
      deps
  3. 18 18
      deps.lock

+ 53 - 28
bin/vendors

@@ -24,14 +24,14 @@ Specify a command to run:
 
  install: install vendors as specified in deps or deps.lock (recommended)
  update:  update vendors to their latest versions (as specified in deps)
-
+ lock:  lock vendors to their current versions
 
 EOF
     );
 }
 
-if (!in_array($command = array_shift($argv), array('install', 'update'))) {
-    exit(sprintf("Command \"%s\" does not exist.\n", $command));
+if (!in_array($command = array_shift($argv), array('install', 'update', 'lock'))) {
+    exit(sprintf('Command "%s" does not exist.', $command).PHP_EOL);
 }
 
 /*
@@ -59,7 +59,7 @@ if ('install' === $command && file_exists($rootDir.'/deps.lock')) {
     foreach (file($rootDir.'/deps.lock', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) as $line) {
         $parts = array_values(array_filter(explode(' ', $line)));
         if (2 !== count($parts)) {
-            exit(sprintf('The deps version file is not valid (near "%s")', $line));
+            exit(sprintf('The deps version file is not valid (near "%s")', $line).PHP_EOL);
         }
         $versions[$parts[0]] = $parts[1];
     }
@@ -68,56 +68,81 @@ if ('install' === $command && file_exists($rootDir.'/deps.lock')) {
 $newversions = array();
 $deps = parse_ini_file($rootDir.'/deps', true, INI_SCANNER_RAW);
 if (false === $deps) {
-    exit("The deps file is not valid ini syntax. Perhaps missing a trailing newline?\n");
+    exit('The deps file is not valid ini syntax. Perhaps missing a trailing newline?'.PHP_EOL);
 }
 foreach ($deps as $name => $dep) {
     $dep = array_map('trim', $dep);
 
-    // revision
-    if (isset($versions[$name])) {
-        $rev = $versions[$name];
-    } else {
-        $rev = isset($dep['version']) ? $dep['version'] : 'origin/HEAD';
-    }
-
     // install dir
     $installDir = isset($dep['target']) ? $vendorDir.'/'.$dep['target'] : $vendorDir.'/'.$name;
     if (in_array('--reinstall', $argv)) {
-        if (PHP_OS == 'WINNT') {
+        if (defined('PHP_WINDOWS_VERSION_BUILD')) {
             system(sprintf('rmdir /S /Q %s', escapeshellarg(realpath($installDir))));
         } else {
             system(sprintf('rm -rf %s', escapeshellarg($installDir)));
         }
     }
 
-    echo "> Installing/Updating $name\n";
+    if ('install' === $command || 'update' === $command) {
+        echo '> Installing/Updating '.$name.PHP_EOL;
 
-    // url
-    if (!isset($dep['git'])) {
-        exit(sprintf('The "git" value for the "%s" dependency must be set.', $name));
-    }
-    $url = $dep['git'];
+        // url
+        if (!isset($dep['git'])) {
+            exit(sprintf('The "git" value for the "%s" dependency must be set.', $name).PHP_EOL);
+        }
+        $url = $dep['git'];
 
-    if (!is_dir($installDir)) {
-        system(sprintf('git clone %s %s', escapeshellarg($url), escapeshellarg($installDir)));
-    }
+        if (!is_dir($installDir)) {
+            system(sprintf('git clone %s %s', escapeshellarg($url), escapeshellarg($installDir)));
+        }
+
+        // revision
+        if (isset($versions[$name])) {
+            $rev = $versions[$name];
+        } else {
+            $rev = isset($dep['version']) ? $dep['version'] : 'origin/HEAD';
+        }
 
-    system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
+        $status = system(sprintf('cd %s && git status --porcelain', escapeshellarg($installDir)));
+        if (!empty($status)) {
+            exit(sprintf('"%s" has local modifications. Please revert or commit/push them before running this command again.', $name).PHP_EOL);
+        }
+        $current_rev = system(sprintf('cd %s && git rev-list --max-count=1 HEAD', escapeshellarg($installDir)));
+        if ($current_rev === $rev) {
+            continue;
+        }
 
-    if ('update' === $command) {
+        system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
+    }
+
+    if ('update' === $command || 'lock' === $command) {
         ob_start();
         system(sprintf('cd %s && git log -n 1 --format=%%H', escapeshellarg($installDir)));
-        $newversions[] = trim($name.' '.ob_get_clean());
+        $newversion = trim(ob_get_clean());
+
+        ob_start();
+        system(sprintf('cd %s && git name-rev --tags --name-only %s', escapeshellarg($installDir), $newversion));
+        // remove trailing ^0 from tags, those are the tags themselves
+        $niceversion = preg_replace('/\^0$/', '', trim(ob_get_clean()));
+
+        // undefined is returned in case no name-rev could be found
+        if ('undefined' !== $niceversion) {
+            $newversions[] = $name.' '.$niceversion;
+        } else {
+            $newversions[] = $name.' '.$newversion;
+        }
     }
 }
 
 // update?
-if ('update' === $command) {
-    file_put_contents($rootDir.'/deps.lock', implode("\n", $newversions));
+if ('update' === $command || 'lock' === $command) {
+    echo '> Updating deps.lock'.PHP_EOL;
+
+    file_put_contents($rootDir.'/deps.lock', implode("\n", $newversions)."\n");
 }
 
 // php on windows can't use the shebang line from system()
-$interpreter = PHP_OS == 'WINNT' ? 'php.exe' : '';
+$interpreter = defined('PHP_WINDOWS_VERSION_BUILD') ? 'php.exe' : '';
 
 // Update the bootstrap files
 system(sprintf('%s %s %s', $interpreter, escapeshellarg($rootDir.'/vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php'), escapeshellarg($rootDir)));

+ 9 - 8
deps

@@ -1,10 +1,10 @@
 [symfony]
     git=http://github.com/symfony/symfony.git
-    version=v2.0.6
+    version=v2.0.10
 
 [twig]
     git=http://github.com/fabpot/Twig.git
-    version=v1.1.2
+    version=v1.6.0
 
 [monolog]
     git=http://github.com/Seldaek/monolog.git
@@ -12,19 +12,19 @@
 
 [doctrine-common]
     git=http://github.com/doctrine/common.git
-    version=2.1.2
+    version=2.1.4
 
 [doctrine-dbal]
     git=http://github.com/doctrine/dbal.git
-    version=2.1.3
+    version=2.1.6
 
 [doctrine]
     git=http://github.com/doctrine/doctrine2.git
-    version=2.1.2
+    version=2.1.6
 
 [swiftmailer]
     git=http://github.com/swiftmailer/swiftmailer.git
-    version=v4.1.3
+    version=v4.1.5
 
 [assetic]
     git=http://github.com/kriswallsmith/assetic.git
@@ -49,11 +49,12 @@
 [SensioDistributionBundle]
     git=http://github.com/sensio/SensioDistributionBundle.git
     target=/bundles/Sensio/Bundle/DistributionBundle
-    version=origin/1.0
+    version=origin/2.0
 
 [SensioGeneratorBundle]
     git=http://github.com/sensio/SensioGeneratorBundle.git
     target=/bundles/Sensio/Bundle/GeneratorBundle
+    version=origin/2.0
 
 [AsseticBundle]
     git=http://github.com/symfony/AsseticBundle.git
@@ -63,7 +64,7 @@
 [FOSUserBundle]
     git=git://github.com/FriendsOfSymfony/FOSUserBundle.git
     target=/bundles/FOS/UserBundle
-    version=1.0.0
+    version=1.1.0
 
 [WhiteOctoberPagerfanta]
     git=http://github.com/whiteoctober/Pagerfanta.git

+ 18 - 18
deps.lock

@@ -1,20 +1,20 @@
-symfony b55a43813e8fbcf4facd19ce1da0cd7acc67ce9b
-twig 396435ecd05556adb0a8bd05b14641cb4f8a8aa5
-monolog b704c49a3051536f67f2d39f13568f74615b9922
-doctrine-common b385ca770888248241bd3086a40d5b3bd082a706
-doctrine-dbal e0b69790ab1ffd646fd70a04fdb91e5dfbb3ccf1
-doctrine 144d0de0ab61dffc738d7fb590cff8d77919f553
-swiftmailer daaff2b8515390fbb10882647311f476b89a67e6
-assetic f829ad23d23c87480151a21faad49fefe7c09e5d
-twig-extensions 560990d47ba3fefea18420f9951b54d490715b19
-metadata 8717ad2a5689480765d9ffafe925cd8a2457e582
-composer 126c57d07cdc5d0c749cd5ca0bc691804b5d4bf0
-SensioFrameworkExtraBundle 1c7e92f466d11f83130b0c1271f44d067a2c3b31
+symfony v2.0.10
+twig v1.6.0
+monolog 1.0.2
+doctrine-common 2.1.4
+doctrine-dbal 2.1.6
+doctrine 2.1.6
+swiftmailer v4.1.5
+assetic v1.0.2
+twig-extensions 1dfff8e793f50f651c4f74f796c2c68a4aee3147
+metadata 1.0.0
+composer 15dddf44fa283efd7deb4d7f5671975634261664
+SensioFrameworkExtraBundle 638f545b7020b9e9d5944a7e3167f60ed848250d
 SensioDistributionBundle 20b66a408084ad8752f98e50f10533f5245310bf
-SensioGeneratorBundle 87fe88c4c8dc09cb197ba4b2d6d5b834e2c64980
-AsseticBundle 41b5913b5086a0909af92adcb4a6005ee0051b16
-FOSUserBundle 67300def4b2628512197c1fe05cd25727c309e20
-WhiteOctoberPagerfanta a061ad2f464192e72d82fd2aa793d3eb8e397d76
+SensioGeneratorBundle dd37fc4487bc09ac01bdcf89e0ff4ee4484b7fab
+AsseticBundle v1.0.1
+FOSUserBundle 1.1.0
+WhiteOctoberPagerfanta c490684def33e992241e7fad33bcbd03d9d18643
 WhiteOctoberPagerfantaBundle 9c1d1bd119cde420ca3fd1ba2011594446d6d825
-solarium 672d77be590bdbbd919fd4e3bfdcdd6107d08807
-NelmioSolariumBundle a9b40e09ad80d1d7f0626bd4da3f701220bd7676
+solarium 2.3.0-RC1
+NelmioSolariumBundle f1f0c436e727e28acd209c5c9e1176a8ae306ea6