Sync from SUSE:SLFO:Main apache-commons-cli revision 4d1395c8b4b17b309cd61ceb4e892508

This commit is contained in:
Adrian Schröter 2024-05-31 14:26:18 +02:00
parent 4451f39727
commit 8ffd410fb7
6 changed files with 157 additions and 31 deletions

View File

@ -6,11 +6,11 @@ CommitDate: Mon Jun 22 15:04:05 2015 +0200
[CLI-253] Prevent "Unrecognized option: --null" when handling long opts in PosixParser
Index: commons-cli-1.5.0-src/src/main/java/org/apache/commons/cli/Options.java
Index: commons-cli-1.7.0-src/src/main/java/org/apache/commons/cli/Options.java
===================================================================
--- commons-cli-1.5.0-src.orig/src/main/java/org/apache/commons/cli/Options.java
+++ commons-cli-1.5.0-src/src/main/java/org/apache/commons/cli/Options.java
@@ -186,6 +186,20 @@ public class Options implements Serializ
--- commons-cli-1.7.0-src.orig/src/main/java/org/apache/commons/cli/Options.java
+++ commons-cli-1.7.0-src/src/main/java/org/apache/commons/cli/Options.java
@@ -195,6 +195,20 @@ public class Options implements Serializ
return this;
}
@ -31,10 +31,10 @@ Index: commons-cli-1.5.0-src/src/main/java/org/apache/commons/cli/Options.java
/**
* Gets the options with a long name starting with the name specified.
*
Index: commons-cli-1.5.0-src/src/main/java/org/apache/commons/cli/PosixParser.java
Index: commons-cli-1.7.0-src/src/main/java/org/apache/commons/cli/PosixParser.java
===================================================================
--- commons-cli-1.5.0-src.orig/src/main/java/org/apache/commons/cli/PosixParser.java
+++ commons-cli-1.5.0-src/src/main/java/org/apache/commons/cli/PosixParser.java
--- commons-cli-1.7.0-src.orig/src/main/java/org/apache/commons/cli/PosixParser.java
+++ commons-cli-1.7.0-src/src/main/java/org/apache/commons/cli/PosixParser.java
@@ -145,7 +145,7 @@ public class PosixParser extends Parser
} else if (matchingOpts.size() > 1) {
throw new AmbiguousOptionException(opt, matchingOpts);
@ -44,10 +44,10 @@ Index: commons-cli-1.5.0-src/src/main/java/org/apache/commons/cli/PosixParser.ja
tokens.add("--" + currentOption.getLongOpt());
if (pos != -1) {
Index: commons-cli-1.5.0-src/src/test/java/org/apache/commons/cli/bug/BugCLI253Test.java
Index: commons-cli-1.7.0-src/src/test/java/org/apache/commons/cli/bug/BugCLI253Test.java
===================================================================
--- /dev/null
+++ commons-cli-1.5.0-src/src/test/java/org/apache/commons/cli/bug/BugCLI253Test.java
+++ commons-cli-1.7.0-src/src/test/java/org/apache/commons/cli/bug/BugCLI253Test.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -6,7 +6,15 @@
<!-- Build environment properties -->
<!-- ====================================================================== -->
<property name="build.finalName" value="commons-cli-1.5.0"/>
<property name="project.artifactId" value="commons-cli"/>
<property name="project.groupId" value="commons-cli"/>
<property name="project.version" value="1.7.0"/>
<property name="compiler.release" value="8"/>
<property name="compiler.source" value="1.${compiler.release}"/>
<property name="compiler.target" value="${compiler.source}"/>
<property name="build.finalName" value="${project.artifactId}-${project.version}"/>
<property name="build.dir" value="target"/>
<property name="build.outputDir" value="${build.dir}/classes"/>
<property name="build.srcDir" value="src/main/java"/>
@ -43,10 +51,11 @@
debug="true"
optimize="false"
deprecation="true"
target="8"
verbose="false"
fork="false"
source="8">
release="${compiler.release}"
target="${compiler.target}"
verbose="false"
fork="false"
source="${compiler.source}">
<src>
<pathelement location="${build.srcDir}"/>
</src>
@ -70,7 +79,6 @@
packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
old="false"
verbose="false"
encoding="iso-8859-1"
version="true"
@ -85,7 +93,7 @@
nonavbar="false"
serialwarn="false"
charset="ISO-8859-1"
source="8"
source="${compiler.source}"
linksource="true"
breakiterator="false">
<link href="http://java.sun.com/javase/7/docs/api/"/>
@ -110,17 +118,17 @@
<attribute name="Bundle-Name" value="Apache Commons CLI"/>
<attribute name="Bundle-SymbolicName" value="org.apache.commons.cli"/>
<attribute name="Bundle-Vendor" value="The Apache Software Foundation"/>
<attribute name="Bundle-Version" value="1.5.0"/>
<attribute name="Export-Package" value="org.apache.commons.cli;version=&quot;1.5.0&quot;"/>
<attribute name="Bundle-Version" value="${project.version}"/>
<attribute name="Export-Package" value="org.apache.commons.cli;version=&quot;${project.version}&quot;"/>
<attribute name="Implementation-Title" value="Apache Commons CLI"/>
<attribute name="Implementation-Vendor-Id" value="org.apache"/>
<attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Version" value="1.5.0"/>
<attribute name="Implementation-Version" value="${project.version}"/>
<attribute name="Include-Resource" value="META-INF/NOTICE.txt=NOTICE.txt,META-INF/LICENSE.txt=LICENSE.txt"/>
<attribute name="Require-Capability" value="osgi.ee;filter:=&quot;(&amp;(osgi.ee=JavaSE)(version=1.7))&quot;"/>
<attribute name="Require-Capability" value="osgi.ee;filter:=&quot;(&amp;(osgi.ee=JavaSE)(version=${compiler.target}))&quot;"/>
<attribute name="Specification-Title" value="Apache Commons CLI"/>
<attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<attribute name="Specification-Version" value="1.5.0"/>
<attribute name="Specification-Version" value="${project.version}"/>
</manifest>
</jar>
</target>

View File

@ -1,3 +1,121 @@
-------------------------------------------------------------------
Mon Apr 29 11:36:14 UTC 2024 - Gus Kenion <gus.kenion@suse.com>
- Rebased patch CLI-253-workaround.patch to new version.
- Updated apache-commons-cli-build.xml to new version.
- Update to 1.7:
* New features:
- Add and use a Converter interface and implementations without
using BeanUtils #216. Fixes CLI-321. Thanks to Claude Warren,
Gary Gregory.
- Add Maven property project.build.outputTimestamp for build
reproducibility. Thanks to Gary Gregory.
- Add '-' as an option char and implemented extensive tests
#217. Fixes CLI-322. Thanks to Claude Warren, Gary Gregory.
- Make adding OptionGroups and Options to existing Options
easier #230. Fixes CLI-324. Thanks to Claude Warren, Gary
Gregory.
- Added Supplier<T> defaults for getParsedOptionValue #229.
Fixes CLI-323. Thanks to Claude Warren, Gary Gregory.
- Make Option.getKey() public #239. Fixes CLI-326. Thanks to
Claude Warren, Gary Gregory.
- Add builder factory CommandLine#builder(). Thanks to Claude
Warren, Gary Gregory.
* Fixes:
- Inconsistent behavior in key/value pairs (Java property
style). Fixes CLI-312. Thanks to Claude Warren, Gary Gregory.
- Avoid NullPointerException in
Util.stripLeadingAndTrailingQuotes(String). Thanks to Gary
Gregory.
- Awkward behavior of Option.builder() for multiple optional
args. Fixes CLI-320. Thanks to Paul King, Claude Warren.
- Properties from multiple arguments with value separator.
#237. Fixes CLI-325. Thanks to Claude Warren.
- Fix for expected textual date values. #244. Fixes CLI-327.
Thanks to Claude Warren, Gary Gregory.
- Option.Builder.option("") should throw
IllegalArgumentException instead of
ArrayIndexOutOfBoundsException. Thanks to Gary Gregory.
- Avoid NullPointerException in
CommandLine.getOptionValues(Option|String). Thanks to Gary
Gregory.
* Updates:
- Bump commons-parent from 64 to 69 #256. Thanks to Gary
Gregory.
- Update the tests to JUnit 5 #238. Thanks to Elric, Gary
Gregory.
- Bump tests commons-io:commons-io from 2.16.0 to 2.16.1 #258.
Thanks to Dependabot, Gary Gregory.
- Includes changes from version 1.6:
* Fixes:
- [StepSecurity] ci: Harden GitHub Actions #176. Thanks to
step-security-bot, Gary Gregory.
- Inconsistent date format in changes report. Fixes CLI-318.
Thanks to Alexander Veit, Gary Gregory.
- Fix NPE in CommandLine.resolveOption(String). Fixes CLI-283.
Thanks to Dilraj Singh, Gary Gregory.
- CommandLine.addOption(Option) should not allow a null Option.
Fixes CLI-283. Thanks to Dilraj Singh, Gary Gregory.
- CommandLine.addArgs(String) should not allow a null String.
Fixes CLI-283. Thanks to Gary Gregory.
- Site docs: "Usage Scenarios" refers to deprecated methods.
Fixes CLI-303. Thanks to Julian Schilling, Gary Gregory.
- NullPointerException thrown by CommandLineParser.parse().
Fixes CLI-317. Thanks to Philippe Bastiani, Sruteesh Kumar
Paramata, Gary Gregory.
- StringIndexOutOfBoundsException thrown by
CommandLineParser.parse(). Fixes CLI-313. Thanks to Dominik
Stadler, HUNG LU, Sruteesh Kumar Paramata.
* Updates:
- Fix SpotBugs Error: Medium: Method intentionally throws
RuntimeException. [org.apache.commons.cli.Option] At
Option.java:[lines 417-423]
THROWS_METHOD_THROWS_RUNTIMEEXCEPTION Thanks to Gary Gregory.
- Fix SpotBugs Error: Medium: Method intentionally throws
RuntimeException. [org.apache.commons.cli.Option] At
Option.java:[lines 446-450]
THROWS_METHOD_THROWS_RUNTIMEEXCEPTION Thanks to Gary Gregory.
- Fix SpotBugs Error: Medium: Method intentionally throws
RuntimeException. [org.apache.commons.cli.Option] At
Option.java:[lines 474-478]
THROWS_METHOD_THROWS_RUNTIMEEXCEPTION Thanks to Gary Gregory.
- Use EMPTY_STRING_ARRAY constant. #102. Thanks to Ken Dombeck.
- Fix site links that are broken #155. Thanks to Arturo Bernal.
- Use Math.max() #111. Delete unused assignment #112. Thanks to
Arturo Bernal.
- Add github/codeql-action. Thanks to Dependabot, Gary Gregory.
- Bump Java from 7 to 8. Thanks to Gary Gregory.
- Bump actions/cache from 2.1.7 to 3.0.10 #97, #130, #132.
Thanks to Dependabot, Gary Gregory.
- Bump actions/checkout from 3 to 3.1.0 #133. Thanks to Gary
Gregory, Dependabot.
- Bump actions/setup-java from 2 to 3.6.0 #136. Thanks to Gary
Gregory.
- Bump spotbugs from 4.5.3 to 4.7.3 #96, #107, #113, #125,
#138. Thanks to Gary Gregory, Dependabot.
- Bump spotbugs-maven-plugin from 4.5.3.0 to 4.7.3.0 #98, #108,
#115, #117, #126, #145. Thanks to Dependabot.
- Bump commons-parent from 52 to 64 #100, #128, #151, #158.
Thanks to Dependabot, Gary Gregory.
- Bump maven-antrun-plugin from 3.0.0 to 3.1.0 #103. Thanks to
Dependabot.
- Bump maven-javadoc-plugin from 3.3.2 to 3.4.1 #105, #120.
Thanks to Dependabot.
- Bump maven-pmd-plugin from 3.16.0 to 3.19.0 #110, #124.
Thanks to Dependabot.
- Bump jacoco-maven-plugin from 0.8.7 to 0.8.8. Thanks to Gary
Gregory.
- Bump maven-checkstyle-plugin from 3.1.2 to 3.2.0 #121. Thanks
to Gary Gregory.
- Bump japicmp-maven-plugin from 0.15.4 to 0.16.0. Thanks to
Gary Gregory.
- Update JUnit 4 to 5 vintage. Thanks to Gary Gregory.
-------------------------------------------------------------------
Tue Feb 20 10:25:28 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
- Use %patch -P N instead of deprecated %patchN.
-------------------------------------------------------------------
Thu Sep 21 05:39:25 UTC 2023 - Fridrich Strba <fstrba@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package apache-commons-cli
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -19,19 +19,19 @@
%global base_name cli
%global short_name commons-%{base_name}
Name: apache-commons-cli
Version: 1.5.0
Version: 1.7.0
Release: 0
Summary: Command Line Interface Library for Java
License: Apache-2.0
Group: Development/Libraries/Java
URL: https://commons.apache.org/%{base_name}/
Source0: https://dlcdn.apache.org/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
Source0: https://archive.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
Source1: %{name}-build.xml
Source2: apache-commons-cli-rpmlintrc
Patch0: CLI-253-workaround.patch
BuildRequires: ant
BuildRequires: fdupes
BuildRequires: javapackages-local
BuildRequires: javapackages-local >= 6
Provides: jakarta-%{short_name} = %{version}-%{release}
Obsoletes: jakarta-%{short_name} < %{version}-%{release}
Provides: apache-cli = %{version}-%{release}
@ -54,12 +54,12 @@ This package contains the API documentation for %{name}.
%prep
%setup -q -n %{short_name}-%{version}-src
cp %{SOURCE1} build.xml
%patch0 -p1
%patch -P 0 -p1
%pom_remove_parent
%build
%ant package javadoc
%{ant} package javadoc
%install
# jars
@ -68,7 +68,7 @@ ln -sf %{short_name}.jar %{buildroot}%{_javadir}/%{name}.jar
# pom
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/%{short_name}.pom
%{mvn_install_pom} pom.xml %{buildroot}%{_mavenpomdir}/%{short_name}.pom
%add_maven_depmap %{short_name}.pom %{short_name}.jar -a "org.apache.commons:%{short_name}"
# javadoc

BIN
commons-cli-1.5.0-src.tar.gz (Stored with Git LFS)

Binary file not shown.

BIN
commons-cli-1.7.0-src.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.