Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package javapackages-tools for openSUSE:Factory checked in at 2023-10-05 20:02:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/javapackages-tools (Old) and /work/SRC/openSUSE:Factory/.javapackages-tools.new.28202 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "javapackages-tools" Thu Oct 5 20:02:50 2023 rev:40 rq:1115402 version:6.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/javapackages-tools/javapackages-tools.changes 2023-09-13 20:44:24.553750326 +0200 +++ /work/SRC/openSUSE:Factory/.javapackages-tools.new.28202/javapackages-tools.changes 2023-10-05 20:03:02.850484100 +0200 @@ -1,0 +2,13 @@ +Wed Oct 4 07:18:58 UTC 2023 - Fridrich Strba <fst...@suse.com> + +- Added patches: + * 0005-Interpolate-properties-also-in-the-current-artifact.patch + + interpolate variables also in current artifactId, groupId and + version + * 0006-Test-variable-expansion-in-artifactId.patch + + test previous changes + * 0007-Test-that-we-don-t-bomb-on-relativePath.patch + + test gracious handling of empty <relativePath/> in parent + reference of a pom file + +------------------------------------------------------------------- New: ---- 0005-Interpolate-properties-also-in-the-current-artifact.patch 0006-Test-variable-expansion-in-artifactId.patch 0007-Test-that-we-don-t-bomb-on-relativePath.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ javapackages-tools.spec ++++++ --- /var/tmp/diff_new_pack.6cl1nJ/_old 2023-10-05 20:03:04.530544795 +0200 +++ /var/tmp/diff_new_pack.6cl1nJ/_new 2023-10-05 20:03:04.534544940 +0200 @@ -53,6 +53,12 @@ Patch5: 0003-Reproducible-exclusions-order-in-maven-metadata.patch #PATCH-FIX-UPSTREAM: make the aliases and dependencies lists so that the order is kept Patch6: 0004-Reproducible-builds-keep-order-of-aliases-and-depend.patch +#PATCH-FIX-UPSTREAM: substitute variables like _${scala.binary.version} in artifact coordinates +Patch7: 0005-Interpolate-properties-also-in-the-current-artifact.patch +#PATCH-FIX-UPSTREAM: test changes from previous patch +Patch8: 0006-Test-variable-expansion-in-artifactId.patch +#PATCH-FIX-UPSTREAM: test gracious handling of <relativePath/> construct +Patch9: 0007-Test-that-we-don-t-bomb-on-relativePath.patch BuildRequires: asciidoc BuildRequires: fdupes BuildRequires: perl ++++++ 0005-Interpolate-properties-also-in-the-current-artifact.patch ++++++ >From d458bce49270bccfa40e9c4e288b3c9550aff741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.st...@bluewin.ch> Date: Wed, 4 Oct 2023 04:07:58 +0200 Subject: [PATCH 5/5] Interpolate properties also in the current artifact --- java-utils/install_pom.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/java-utils/install_pom.py b/java-utils/install_pom.py index e0282773..5f9fd741 100644 --- a/java-utils/install_pom.py +++ b/java-utils/install_pom.py @@ -31,6 +31,7 @@ # Authors: Michal Srb <m...@redhat.com> from javapackages.maven.pom import POM, PomLoadingException +from javapackages.maven.artifact import Artifact from javapackages.xmvn.xmvn_resolve import (XMvnResolve, ResolutionRequest, XMvnResolveException) @@ -164,7 +165,7 @@ def gather_dependencies(pom_path): # only deps with scope "compile" or "runtime" are interesting deps = [x for x in deps if x.scope in ["", "compile", "runtime"]] - return deps + return deps, props def _get_dependencies(pom): @@ -215,21 +216,23 @@ def _main(): if uart.packaging and uart.packaging.lower() == 'pom': tree = ElementTree.parse(args[0]) else: + mvn_deps, props = gather_dependencies(pom_path) + mvn_art = Artifact.from_mvn_str(str(uart)) + mvn_art.interpolate(props) result_pom = "<?xml version='1.0' encoding='UTF-8'?>\n" result_pom += "<project xmlns=\"http://maven.apache.org/POM/4.0.0\">\n" result_pom += " <modelVersion>4.0.0</modelVersion>\n" - result_pom += (" <groupId>{0}</groupId>\n" ).format(uart.groupId) - result_pom += (" <artifactId>{0}</artifactId>\n" ).format(uart.artifactId) - result_pom += (" <version>{0}</version>\n").format(uart.version) + result_pom += (" <groupId>{0}</groupId>\n" ).format(mvn_art.groupId) + result_pom += (" <artifactId>{0}</artifactId>\n" ).format(mvn_art.artifactId) + result_pom += (" <version>{0}</version>\n").format(mvn_art.version) if hasattr(uart, "packaging") and uart.packaging != 'jar': result_pom += (" <packaging>{0}</packaging>\n").format(uart.packaging) if hasattr(uart, "extension") and uart.extension != 'jar': result_pom += (" <extension>{0}</extension>\n").format(uart.extension) - if hasattr(uart, "classifier") and uart.classifiler != '': + if hasattr(uart, "classifier") and uart.classifier != '': result_pom += (" <classifier>{0}</classifier>\n").format(uart.classifier) - mvn_deps = gather_dependencies(pom_path) if mvn_deps: result_pom += " <dependencies>\n" for d in mvn_deps: -- 2.42.0 ++++++ 0006-Test-variable-expansion-in-artifactId.patch ++++++ ++++ 714 lines (skipped) ++++++ 0007-Test-that-we-don-t-bomb-on-relativePath.patch ++++++ >From 3a32ce8695f891d8051cccd5273758d3cd9ce54c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.st...@bluewin.ch> Date: Wed, 4 Oct 2023 08:32:33 +0200 Subject: [PATCH 7/7] Test that we don't bomb on <relativePath/> --- test/data/install_pom/empty_relpath.pom | 182 ++++++++++++++++++ .../install_pom/test_empty_relpath-want.xml | 39 ++++ test/install_pom_test.py | 7 + 3 files changed, 228 insertions(+) create mode 100644 test/data/install_pom/empty_relpath.pom create mode 100644 test/data/install_pom/test_empty_relpath-want.xml diff --git a/test/data/install_pom/empty_relpath.pom b/test/data/install_pom/empty_relpath.pom new file mode 100644 index 00000000..785b9710 --- /dev/null +++ b/test/data/install_pom/empty_relpath.pom @@ -0,0 +1,182 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-shared-components</artifactId> + <version>39</version> + <relativePath /> + </parent> + + <artifactId>maven-filtering</artifactId> + <version>3.3.1</version> + + <name>Apache Maven Filtering</name> + <description>A component to assist in filtering of resource files with properties from a Maven project.</description> + + <contributors> + <contributor> + <name>Graham Leggett</name> + </contributor> + </contributors> + + <scm> + <connection>scm:git:https://gitbox.apache.org/repos/asf/maven-filtering.git</connection> + <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-filtering.git</developerConnection> + <tag>maven-filtering-3.3.1</tag> + <url>https://github.com/apache/maven-filtering/tree/${project.scm.tag}</url> + </scm> + <issueManagement> + <system>JIRA</system> + <url>https://issues.apache.org/jira/issues/?jql=project%20%3D%20MSHARED%20AND%20component%20%3D%20maven-filtering</url> + </issueManagement> + <ciManagement> + <system>Jenkins</system> + <url>https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-filtering/</url> + </ciManagement> + <distributionManagement> + <site> + <id>apache.website</id> + <url>scm:svn:https://svn.apache.org/repos/asf/maven/website/components/${maven.site.path}</url> + </site> + </distributionManagement> + + <properties> + <javaVersion>8</javaVersion> + <mavenVersion>3.2.5</mavenVersion> + <slf4jVersion>1.7.36</slf4jVersion> + <plexusBuildApiVersion>0.0.7</plexusBuildApiVersion> + <project.build.outputTimestamp>2023-03-21T10:53:39Z</project.build.outputTimestamp> + </properties> + + <dependencies> + <dependency> + <groupId>javax.inject</groupId> + <artifactId>javax.inject</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>${slf4jVersion}</version> + </dependency> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-build-api</artifactId> + <version>${plexusBuildApiVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-core</artifactId> + <version>${mavenVersion}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-model</artifactId> + <version>${mavenVersion}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-settings</artifactId> + <version>${mavenVersion}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>3.5.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-interpolation</artifactId> + <version>1.26</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>2.11.0</version> + </dependency> + + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <version>4.7.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.13.2</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-core</artifactId> + <version>2.2</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-simple</artifactId> + <version>${slf4jVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-build-api</artifactId> + <version>${plexusBuildApiVersion}</version> + <classifier>tests</classifier> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.eclipse.sisu</groupId> + <artifactId>org.eclipse.sisu.plexus</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.eclipse.sisu</groupId> + <artifactId>org.eclipse.sisu.inject</artifactId> + <scope>test</scope> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.rat</groupId> + <artifactId>apache-rat-plugin</artifactId> + <configuration> + <excludes combine.children="append"> + <exclude>src/test/units-files/**</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <groupId>org.eclipse.sisu</groupId> + <artifactId>sisu-maven-plugin</artifactId> + </plugin> + </plugins> + </build> +</project> diff --git a/test/data/install_pom/test_empty_relpath-want.xml b/test/data/install_pom/test_empty_relpath-want.xml new file mode 100644 index 00000000..03bd1115 --- /dev/null +++ b/test/data/install_pom/test_empty_relpath-want.xml @@ -0,0 +1,39 @@ +<?xml version='1.0' encoding='UTF-8'?> +<project xmlns="http://maven.apache.org/POM/4.0.0"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-filtering</artifactId> + <version>3.3.1</version> + <dependencies> + <dependency> + <groupId>javax.inject</groupId> + <artifactId>javax.inject</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.7.36</version> + </dependency> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-build-api</artifactId> + <version>0.0.7</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>3.5.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-interpolation</artifactId> + <version>1.26</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>2.11.0</version> + </dependency> + </dependencies> +</project> \ No newline at end of file diff --git a/test/install_pom_test.py b/test/install_pom_test.py index db79c001..a39f3aa4 100644 --- a/test/install_pom_test.py +++ b/test/install_pom_test.py @@ -103,6 +103,13 @@ class TestInstallPom(unittest.TestCase): result) self.assertEqual(report, '', report) + @install_pom('empty_relpath.pom') + def test_empty_relpath(self, stdout, stderr, return_value, result): + self.assertEqual(return_value, 0, stderr) + report = self.check_result(inspect.currentframe().f_code.co_name, + result) + self.assertEqual(report, '', report) + @install_pom(os.path.join('xmvn', 'xmvn-tools', 'xmvn-install', 'pom.xml')) def test_parent_chain(self, stdout, stderr, return_value, result): self.assertEqual(return_value, 0, stderr) -- 2.42.0