Commit:    a253b3d4d941b068951a65e6deb93b500ec75ed8
Author:    Christoph M. Becker <[email protected]>         Mon, 25 Jan 2021 
19:31:19 +0100
Parents:   1336ebfa65e76718c4f0589e3ab10a5c58e7347c
Branches:  master

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

Log:
Upload real_name packages to proper location

We need to do this (and also have to rename the packages), so that they
are linked as DLLs.  We do not rename the log files, though.

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


Diff:
diff --git a/include/PeclExt.php b/include/PeclExt.php
index 4478479..dc94a07 100644
--- a/include/PeclExt.php
+++ b/include/PeclExt.php
@@ -11,6 +11,7 @@ class PeclExt
        protected $pkg_basename;
        protected $pkg_fmt;
        protected $name;
+       protected $unreal_name; // if real_name is configured, this is the 
package name
        protected $version;
        protected $build;
        protected $tar_cmd;
@@ -161,6 +162,7 @@ class PeclExt
                                }
 
                                $this->tmp_extract_path = $new_path;
+                               $this->unreal_name = $this->name;
                                $this->name = $config['real_name'];
                        }
                }
@@ -169,10 +171,11 @@ class PeclExt
                $this->version = strtolower($this->version);
        }
 
-       public function getPackageName()
+       public function getPackageName($unreal = false)
        {
                // looks like php_http-2.0.0beta4-5.3-nts-vc9-x86
-               return 'php_' . $this->name
+               // or like php_pecl_http-2.0.0beta4-5.3-nts-vc9-x86 for 
$unreal===true
+               return 'php_' . ($unreal ? $this->unreal_name : $this->name)
                        . '-' . $this->version 
                        . '-' . $this->build->branch->config->getBranch()
                        . '-' . ($this->build->thread_safe ? 'ts' : 'nts')
@@ -180,6 +183,14 @@ class PeclExt
                        . '-' . $this->build->architecture;
        }
 
+       public function getUnrealName()
+       {
+               if (isset($this->unreal_name)) {
+                       return $this->unreal_name;
+               }
+               return $this->name;
+       }
+
        protected function createTmpUnpackDir()
        {
                $tmp_path = tempnam(TMP_DIR, 'pecl');
diff --git a/script/pecl.php b/script/pecl.php
index 37994f3..855e91a 100644
--- a/script/pecl.php
+++ b/script/pecl.php
@@ -327,7 +327,13 @@ foreach ($builds as $build_name) {
        if ($upload) {
                try {
                        $root = $is_snap ? 'snaps' : 'releases';
-                       $target = '/' . $root . '/' .  $ext->getName() . '/' . 
$ext->getVersion();
+                       $target = '/' . $root . '/' .  $ext->getUnrealName() . 
'/' . $ext->getVersion();
+
+                       if ($ext->getName() != $ext->getUnrealName()) {
+                               $real_pkg_file = $pkg_file;
+                               $pkg_file = dirname($pkg_file) . 
DIRECTORY_SEPARATOR . $ext->getPackageName(true) . '.zip';
+                               rename($real_pkg_file, $pkg_file);
+                       }
 
                        $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