update Console_Getopt to 1.4.3

drop patches merged upstream
This commit is contained in:
Remi Collet 2019-11-21 09:07:14 +01:00
parent a25878954a
commit 6d77419306
5 changed files with 9 additions and 96 deletions

1
.gitignore vendored
View File

@ -50,3 +50,4 @@ clog
/Archive_Tar-1.4.7.tgz
/Archive_Tar-1.4.8.tgz
/PEAR-1.10.10.tgz
/Console_Getopt-1.4.3.tgz

66
4.patch
View File

@ -1,66 +0,0 @@
From f37ba4a4f42a1f1173fe7de28fb9b71a54c2ff63 Mon Sep 17 00:00:00 2001
From: Jack Cherng <jfcherng@gmail.com>
Date: Wed, 7 Aug 2019 07:32:38 +0800
Subject: [PATCH] Fix PHP 7.4 deprecation: array/string curly braces access
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
---
Console/Getopt.php | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/Console/Getopt.php b/Console/Getopt.php
index f8df71c..29f86bb 100644
--- a/Console/Getopt.php
+++ b/Console/Getopt.php
@@ -138,10 +138,10 @@ public static function doGetopt($version, $args, $short_options, $long_options =
break;
}
- if ($arg{0} != '-' || (strlen($arg) > 1 && $arg{1} == '-' && !$long_options)) {
+ if ($arg[0] != '-' || (strlen($arg) > 1 && $arg[1] == '-' && !$long_options)) {
$non_opts = array_merge($non_opts, array_slice($args, $i));
break;
- } elseif (strlen($arg) > 1 && $arg{1} == '-') {
+ } elseif (strlen($arg) > 1 && $arg[1] == '-') {
$error = Console_Getopt::_parseLongOption(substr($arg, 2),
$long_options,
$opts,
@@ -186,11 +186,11 @@ public static function doGetopt($version, $args, $short_options, $long_options =
protected static function _parseShortOption($arg, $short_options, &$opts, &$argIdx, $args, $skip_unknown)
{
for ($i = 0; $i < strlen($arg); $i++) {
- $opt = $arg{$i};
+ $opt = $arg[$i];
$opt_arg = null;
/* Try to find the short option in the specifier string. */
- if (($spec = strstr($short_options, $opt)) === false || $arg{$i} == ':') {
+ if (($spec = strstr($short_options, $opt)) === false || $arg[$i] == ':') {
if ($skip_unknown === true) {
break;
}
@@ -199,8 +199,8 @@ protected static function _parseShortOption($arg, $short_options, &$opts, &$argI
return PEAR::raiseError($msg);
}
- if (strlen($spec) > 1 && $spec{1} == ':') {
- if (strlen($spec) > 2 && $spec{2} == ':') {
+ if (strlen($spec) > 1 && $spec[1] == ':') {
+ if (strlen($spec) > 2 && $spec[2] == ':') {
if ($i + 1 < strlen($arg)) {
/* Option takes an optional argument. Use the remainder of
the arg string if there is anything left. */
@@ -296,11 +296,11 @@ protected static function _parseLongOption($arg, $long_options, &$opts, &$argIdx
$next_option_rest = '';
}
- if ($opt_rest != '' && $opt{0} != '=' &&
+ if ($opt_rest != '' && $opt[0] != '=' &&
$i + 1 < count($long_options) &&
$opt == substr($long_options[$i+1], 0, $opt_len) &&
$next_option_rest != '' &&
- $next_option_rest{0} != '=') {
+ $next_option_rest[0] != '=') {
$msg = "Console_Getopt: option --$opt is ambiguous";
return PEAR::raiseError($msg);

22
5.patch
View File

@ -1,22 +0,0 @@
From ed634fd44250abab4f6ad85ae7849d0811a3d128 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 18 Nov 2019 12:58:50 +0100
Subject: [PATCH] fix phplint warnings
---
Console/Getopt.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Console/Getopt.php b/Console/Getopt.php
index 29f86bb..e5793bb 100644
--- a/Console/Getopt.php
+++ b/Console/Getopt.php
@@ -123,7 +123,7 @@ public static function doGetopt($version, $args, $short_options, $long_options =
* erroneous POSIX fix.
*/
if ($version < 2) {
- if (isset($args[0]{0}) && $args[0]{0} != '-') {
+ if (isset($args[0][0]) && $args[0][0] != '-') {
array_shift($args);
}
}

View File

@ -8,7 +8,7 @@
%global peardir %{_datadir}/pear
%global metadir %{_localstatedir}/lib/pear
%global getoptver 1.4.2
%global getoptver 1.4.3
%global arctarver 1.4.8
# https://pear.php.net/bugs/bug.php?id=19367
# Structures_Graph 1.0.4 - incorrect FSF address
@ -27,7 +27,7 @@
Summary: PHP Extension and Application Repository framework
Name: php-pear
Version: 1.10.10
Release: 1%{?dist}
Release: 2%{?dist}
Epoch: 1
# PEAR, PEAR_Manpages, Archive_Tar, XML_Util, Console_Getopt are BSD
# Structures_Graph is LGPLv3+
@ -47,9 +47,6 @@ Source23: http://pear.php.net/get/Structures_Graph-%{structver}.tgz
Source24: http://pear.php.net/get/XML_Util-%{xmlutil}.tgz
Source25: http://pear.php.net/get/PEAR_Manpages-%{manpages}.tgz
Patch0: https://patch-diff.githubusercontent.com/raw/pear/Console_Getopt/pull/4.patch
Patch1: https://patch-diff.githubusercontent.com/raw/pear/Console_Getopt/pull/5.patch
BuildArch: noarch
BuildRequires: php(language) > 5.4
BuildRequires: php-cli
@ -222,8 +219,7 @@ install -m 644 -D macros.pear \
# apply patches on installed PEAR tree
pushd %{buildroot}%{peardir}
patch -p1 <%{PATCH0}
patch -p1 <%{PATCH1}
: no patch
popd
# Why this file here ?
@ -337,6 +333,10 @@ fi
%changelog
* Thu Nov 21 2019 Remi Collet <remi@remirepo.net> - 1:1.10.10-2
- update Console_Getopt to 1.4.3
- drop patches merged upstream
* Wed Nov 20 2019 Remi Collet <remi@remirepo.net> - 1:1.10.10-1
- update PEAR to 1.10.10

View File

@ -1,5 +1,5 @@
SHA512 (Archive_Tar-1.4.8.tgz) = b4fe4944a6f261de0c9e28aeee7f50fc7220400c6abad3093c81b1b3b98cbb179abb17b53e90071af6f2fb0f13dfabb24a51d826f4bc632631f1e60e038728e1
SHA512 (Console_Getopt-1.4.2.tgz) = eb8ae099b423d37afaa41c50a2d8db1750de49b3b54872f26ac0ae9ae68b85d3dae936fe7cf0896e1ea80ad86b16fc8f60ac09593eb0d924009b25b3f67b1bdf
SHA512 (Console_Getopt-1.4.3.tgz) = 7803e063576e9dac6833064b5a1479d22ca31c2a8ef8036ae530271e4e824fedb94e54d63266be8929f90f8df745b3ada7185dc98319b331f8dc5e9cac5445a0
SHA512 (PEAR-1.10.10.tgz) = a05296dd5831c3290ab514cf128f48ecf3d60a0de5c46e22653ac552aea64eabdc536ec51487d062f7402cb653862e104b70e341be6b10d4ab5097357ab95628
SHA512 (PEAR_Manpages-1.10.0.tgz) = 41bb2397c381d6315a355d01554c3c0e1ce38f30c25a56044fa8e0955baac04a39cea2bf1b0398a47c56c381c5373d78864862086ebf6958aed693521f822833
SHA512 (Structures_Graph-1.1.1.tgz) = cd4feb265e1aa05de348645dfc0b8e336486cb02c553dd8fcacb0a1eab452bf54108e07864395d55e0c92f4ffd338a5ae846b2dc28804bb23f03c91864ef0284