Commit:    7846591b76a38f5e4f2c4768de5baaa69e205602
Author:    Anatol Belski <[email protected]>         Fri, 8 May 2015 23:44:30 +0200
Parents:   9ca036c6a2d925b7c3e034acfb201c066927cf3b
Branches:  master pecl_legacy

Link:       
http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=7846591b76a38f5e4f2c4768de5baaa69e205602

Log:
basic fixes for vendor/name handling

Changed paths:
  M  client/bin/pickle_build_next.bat
  M  client/include/PickleExt.php
  M  client/script/pickle.php


Diff:
diff --git a/client/bin/pickle_build_next.bat b/client/bin/pickle_build_next.bat
index ec70c25..f496de4 100644
--- a/client/bin/pickle_build_next.bat
+++ b/client/bin/pickle_build_next.bat
@@ -3,6 +3,10 @@
 rem pick the next pickle pkg and pass to pickle_build_all.bat 
 rem first try releases, if there aren't any, look for snaps
 
+rem in contrary to pecl, the pickle build bot doesn't download
+rem the releases itself, but get the job files created by the
+rem peclweb job script
+
 SET BAT_DIR=%~dp0
 
 
diff --git a/client/include/PickleExt.php b/client/include/PickleExt.php
index a63b61d..b17b15d 100644
--- a/client/include/PickleExt.php
+++ b/client/include/PickleExt.php
@@ -5,6 +5,7 @@ namespace rmtools;
 class PickleExt
 {
        protected $name;
+       protected $vendor;
        protected $version;
        protected $pkg_uri;
        protected $lic_fnames = array();
@@ -39,7 +40,7 @@ class PickleExt
                if (!preg_match(",Package name\s+\|\s+([^\s]+)\s+\|,", 
$ret["log"], $m)) {
                        throw new \Exception("Couldn't parse extension name");
                }
-               $this->name = $m[1];
+               $this->setupNames($m[1]);
 
                if (!preg_match(",Package 
version.+\|\s+([a-z0-9\.\-]+)\s+\|,i", $ret["log"], $m)) {
                        throw new \Exception("Couldn't parse extension 
version");
@@ -52,6 +53,11 @@ class PickleExt
                return $this->name;
        }
 
+       public function getVendor()
+       {
+               return $this->vendor;
+       }
+
        public function getVersion()
        {
                return $this->version;
@@ -299,6 +305,16 @@ if (!function_exists('rmtools\combinations')) {
 
                return $ret;
        }
-}
 
+       protected function setupNames($full_name)
+       {
+               if (preg_match(",(.+)/(.+),", $full_name, $m)) {
+                       $this->name = $m[2];
+                       $this->vendor = $m[1];
+               } else {
+                       $this->name = $full_name;
+                       $this->vendor = "novendor";
+               }
+       }
+}
 
diff --git a/client/script/pickle.php b/client/script/pickle.php
index f9301a1..6548701 100644
--- a/client/script/pickle.php
+++ b/client/script/pickle.php
@@ -125,7 +125,8 @@ foreach ($builds as $build_name) {
        if ($upload) {
                try {
                        $root = $is_snap ? 'snaps' : 'releases';
-                       $target = '/' . $root . '/' .  $ext->getName() . '/' . 
$ext->getVersion();
+                       $frag = is_null($ext->getVendor()) ? $ext->getName() : 
$ext->getVendor() . "/" . $ext->getName();
+                       $target = '/' . $root . '/' .  $frag . '/' . 
$ext->getVersion();
 
                        $pkgs_to_upload = $build_error ? array() : 
array($pkg_file);


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to