Commit:    a9e5de8067a9e14bb6d54c49bf48275b14aa9755
Author:    Anatol Belski <[email protected]>         Wed, 12 Jul 2017 21:29:18 +0200
Parents:   3fcac8012ac059f00b89bc825e4bd53d1ae7a183
Branches:  master

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

Log:
fix tool paths and exclude pickle generation for now

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


Diff:
diff --git a/include/PeclExt.php b/include/PeclExt.php
index 6f33805..53213ec 100644
--- a/include/PeclExt.php
+++ b/include/PeclExt.php
@@ -13,14 +13,14 @@ class PeclExt
        protected $name;
        protected $version;
        protected $build;
-       protected $tar_cmd = 'c:\apps\git\bin\tar.exe';
-       protected $bsdtar_cmd = 'c:\apps\bsdtar\bin\bsdtar.exe';
-       protected $gzip_cmd = 'c:\apps\git\bin\gzip.exe';
-       protected $bzip2_cmd = 'c:\apps\git\bin\bzip2.exe';
-       protected $xz_cmd = 'c:\apps\xzutils\xz.exe';
-       protected $zip_cmd = 'c:\php-sdk\bin\zip.exe';
-       protected $unzip_cmd = 'c:\php-sdk\bin\unzip.exe';
-       protected $deplister_cmd = 'c:\apps\bin\deplister.exe';
+       protected $tar_cmd;
+       protected $bsdtar_cmd;
+       protected $gzip_cmd;
+       protected $bzip2_cmd;
+       protected $xz_cmd;
+       protected $zip_cmd;
+       protected $unzip_cmd;
+       protected $deplister_cmd;
        protected $tmp_extract_path = NULL;
        protected $ext_dir_in_src_path = NULL;
        protected $package_xml = NULL;
@@ -35,6 +35,16 @@ class PeclExt
 
        public function __construct($pkg_path, $build)
        {
+               $this->tar_cmd = $this->getToolFilepath("tar.exe");
+               $this->bsdtar_cmd = $this->getToolFilepath("bsdtar.exe");
+               $this->gzip_cmd = $this->getToolFilepath("gzip.exe");
+               $this->bzip2_cmd = $this->getToolFilepath("bzip2.exe");
+               $this->xz_cmd = $this->getToolFilepath("xz.exe");
+               $this->zip_cmd = $this->getToolFilepath("zip.exe");
+               $this->unzip_cmd = $this->getToolFilepath("unzip.exe");
+               $this->deplister_cmd = $this->getToolFilepath("deplister.exe");
+               /* XXX handle pickle, for later */
+
                if (!file_exists($pkg_path)) {
                        throw new \Exception("'$pkg_path' does not exist");
                } 
@@ -322,6 +332,7 @@ class PeclExt
                if (file_exists($tmp_path . DIRECTORY_SEPARATOR . 
'composer.json')) {
                        $this->composer_json_path = $tmp_path . 
DIRECTORY_SEPARATOR . 'composer.json';
                } else if ($this->package_xml_path) {
+                       if (0) {
                        $package_xml_dir = dirname($this->package_xml_path);
                        $cmd = PHP_BINARY . " $this->pickle_phar convert " . 
$package_xml_dir;
                        $pickle_convert_out = shell_exec($cmd);
@@ -337,6 +348,7 @@ class PeclExt
                                        $pickle_convert_out
                                );
                        }
+                       }
                }
 
                $this->pkg_path = NULL;
@@ -1187,5 +1199,16 @@ nodoc:
 
                return $config && isset($config['ignore']);
        }
+
+       protected function getToolFilepath($tool, $hard_error = true)
+       {
+               $path = `where $tool`;
+
+               if (!$path && $hard_error) {
+                       throw new \Exception("'$tool' not found.");
+               }
+
+               return $path;
+       }
 }
 
diff --git a/script/pecl.php b/script/pecl.php
index cd2a627..556e8d7 100644
--- a/script/pecl.php
+++ b/script/pecl.php
@@ -130,7 +130,7 @@ foreach ($builds as $build_name) {
                $build->setSourceDir($build_src_path);
        } catch (Exception $e) {
                echo 'Error: ' . $e->getMessage() . PHP_EOL;
-               $build && $build->clean();
+               isset($build) && $build->clean();
                $was_errors = true;
 
                unset($build);


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

Reply via email to