Bug 1230193

Summary: javapackages-tools: %add_maven_depmap can produce incorrect metadata
Product: [Fedora] Fedora Reporter: Michal Srb <msrb>
Component: javapackages-toolsAssignee: Michal Srb <msrb>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: java-sig-commits, mat.booth, mizdebsk, msimacek, msrb
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: javapackages-tools-4.6.0-1.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-16 12:04:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Srb 2015-06-10 12:21:26 UTC
Description of problem:

Consider following code snippet from spec file:

for libname in catalina-ha util-scan; do
  %{__cp} -a %{name}-$libname.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP.%{name}-$libname.pom
  %add_maven_depmap JPP.%{name}-$libname.pom %{name}/$libname.jar -f "tomcat-lib"
done

Let's say that the file %{name}/$libname.jar exists if $libname is equal to "catalina-ha".
Then if file for $libname equal to "util-scan" *doesn't* exist, %add_maven_depmap will silently create incorrect mapping between artifact coordinates from JPP.%{name}-util-scan.pom and JAR file %{name}/catalina-ha.jar (i.e. JAR file from previous successful iteration).

Version-Release number of selected component (if applicable):
javapackages-tools-4.5.0-3.fc23.noarch

How reproducible:
always

Steps to Reproduce:
1. rebuild tomcat from c2e91f9 in Rawhide
2.
3.

Actual results:
incorrect information in metadata

Expected results:
the macro should fail if given file doesn't exist

Additional info:

Comment 1 Michal Srb 2015-06-11 05:23:09 UTC
Shoudl be fixed upstream, in 4958236. Test case added in 18bca97.

Comment 2 Michal Srb 2015-06-16 12:04:56 UTC
Fixed in Rawhide.