Commit:    ec835e36b316f360a59501f6c79633657f01b39b
Author:    Anatol Belski <[email protected]>         Thu, 12 Sep 2013 14:18:13 +0200
Parents:   5f7e5f5bedec922f3ecb23a2fffdd9e4969133ce
Branches:  master

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

Log:
fixed namings, preparing for different pkg types

Changed paths:
  M  client/include/PeclExt.php
  M  client/script/pecl.php


Diff:
diff --git a/client/include/PeclExt.php b/client/include/PeclExt.php
index 93bebcd..d64a10f 100644
--- a/client/include/PeclExt.php
+++ b/client/include/PeclExt.php
@@ -7,7 +7,7 @@ include_once __DIR__ . '/../include/PeclBranch.php';
 
 class PeclExt
 {
-       protected $tgz_path;
+       protected $pgk_path;
        protected $name;
        protected $version;
        protected $build;
@@ -20,15 +20,15 @@ class PeclExt
        protected $package_xml = NULL;
        protected $configure_data = NULL;
 
-       public function __construct($tgz_path, $build)
+       public function __construct($pgk_path, $build)
        {
-               if (!file_exists($tgz_path)) {
-                       throw new \Exception("'$tgz_path' does not exist");
-               } else if ('.tgz' != substr($tgz_path, -4)) {
+               if (!file_exists($pgk_path)) {
+                       throw new \Exception("'$pgk_path' does not exist");
+               } else if ('.tgz' != substr($pgk_path, -4)) {
                        throw new \Exception("Pecl package should end with 
.tgz");
                }
 
-               $this->tgz_path = $tgz_path;
+               $this->pgk_path = $pgk_path;
                $this->build = $build;
 
                $this->unpack();
@@ -42,7 +42,7 @@ class PeclExt
 
                if (!$this->name || !$this->version) {
                        /* This is the fallback if there's no package.xml  */
-                       $tmp = explode('-', basename($tgz_path, '.tgz'));
+                       $tmp = explode('-', basename($pgk_path, '.tgz'));
                        $this->name = !$this->name ? $tmp[0] : $this->name;
                        $this->version = !$this->version ? $tmp[1] : 
$this->version;
 
@@ -92,12 +92,12 @@ class PeclExt
                        throw new \Exception("Couldn't create temporary dir");
                }
 
-               $tmp_name =  $tmp_path . '/' . basename($this->tgz_path);
-               if (!copy($this->tgz_path, $tmp_name)) {
+               $tmp_name =  $tmp_path . '/' . basename($this->pgk_path);
+               if (!copy($this->pgk_path, $tmp_name)) {
                        throw new \Exception("Couldn't move the tarball to 
'$tmp_name'");
                }
 
-               $tar_name =  basename($this->tgz_path, '.tgz') . '.tar';
+               $tar_name =  basename($this->pgk_path, '.tgz') . '.tar';
 
                /* The tar/gzip versions from the msys package won't work 
properly with
                the windows paths, but they will if running those just in the 
current dir.*/
@@ -105,7 +105,7 @@ class PeclExt
 
                chdir($tmp_path);
 
-               $gzip_cmd = $this->gzip_cmd . ' -df ' . 
basename($this->tgz_path);
+               $gzip_cmd = $this->gzip_cmd . ' -df ' . 
basename($this->pgk_path);
                system($gzip_cmd, $ret);
                if ($ret) {
                        throw new \Exception("Failed to guzip the tarball");
@@ -120,7 +120,7 @@ class PeclExt
 
                chdir($old_cwd);
 
-               $this->tmp_extract_path = realpath($tmp_path . '/' .  
basename($this->tgz_path, '.tgz'));
+               $this->tmp_extract_path = realpath($tmp_path . '/' .  
basename($this->pgk_path, '.tgz'));
 
                $package_xml_path = NULL;
                if (file_exists($tmp_path . DIRECTORY_SEPARATOR . 
'package.xml')) {
@@ -133,7 +133,7 @@ class PeclExt
                        $this->package_xml = new 
\SimpleXMLElement($package_xml_path, 0, true);
                }
 
-               $this->tgz_path = NULL;
+               $this->pgk_path = NULL;
 
                return $this->tmp_extract_path;
        }
diff --git a/client/script/pecl.php b/client/script/pecl.php
index b85aa9f..47f6d91 100644
--- a/client/script/pecl.php
+++ b/client/script/pecl.php
@@ -13,12 +13,12 @@ $longopts = array("config:", "package:", "mail", "upload", 
"is-snap");
 $options = getopt($shortopts, $longopts);
 
 $branch_name = isset($options['config']) ? $options['config'] : NULL;
-$ext_tgz = isset($options['package']) ? $options['package'] : NULL;
+$pkg_path = isset($options['package']) ? $options['package'] : NULL;
 $mail_maintainers = isset($options['mail']);
 $upload = isset($options['upload']);
 $is_snap = isset($options['is-snap']);
 
-if (NULL == $branch_name || NULL == $ext_tgz) {
+if (NULL == $branch_name || NULL == $pkg_path) {
        echo "Usage: pecl.php [OPTION] ..." . PHP_EOL;
        echo "  --config     Configuration file name without suffix, required." 
. PHP_EOL;
        echo "  --package    Path to the PECL package, required." . PHP_EOL;
@@ -52,7 +52,7 @@ $builds = $branch->getBuildList('windows');
 /* be optimistic */
 $was_errors = false;
 
-echo "Using <$ext_tgz>" . PHP_EOL;
+echo "Using <$pkg_path>" . PHP_EOL;
 
 /* Each windows configuration from the ini for the given PHP version will be 
built */
 foreach ($builds as $build_name) {
@@ -68,14 +68,14 @@ foreach ($builds as $build_name) {
        $build->setSourceDir($build_src_path);
 
        try {
-               $ext = new rm\PeclExt($ext_tgz, $build);
+               $ext = new rm\PeclExt($pkg_path, $build);
        } catch (Exception $e) {
                echo $e->getMessage() . PHP_EOL;
 
                rm\xmail(
                        'pecl@windows',
                        '[email protected]', /* XXX try to get dev mails from the 
package.xml */
-                       '[PECL-DEV] Windows build: ' . basename($ext_tgz),
+                       '[PECL-DEV] Windows build: ' . basename($pkg_path),
                        "PECL build failed before it could start for the 
reasons below:\n\n" . $e->getMessage()
                );


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

Reply via email to