Bug 1006508

Summary: javapackages-tools: Some POM macros silently fail on whitespaces in XML tags
Product: [Fedora] Fedora Reporter: Mikolaj Izdebski <mizdebsk>
Component: javapackages-toolsAssignee: Mikolaj Izdebski <mizdebsk>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: java-sig-commits, mizdebsk, msimacek, msrb, sochotni
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.3.1-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-08 18:18:57 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:

Description Mikolaj Izdebski 2013-09-10 18:09:13 UTC
Description of problem:
%pom_remove_dep foo:bar should fail with "Operation on POM has no effect" with the following POM, but it silently succeeds.

    <project />

But the following POM correctly causes macro failure.

    <project />

Version-Release number of selected component (if applicable):
3.0.2-2

Reproducer:

$ . /usr/share/java-utils/pom_editor.sh

$ cat 1
<project />

$ (pom_remove_dep : 1)

$ cat 2
<project/>

$ (pom_remove_dep : 2)
Operation on POM has no effect.
=== Backtrace: ===
22 _pom_patch /usr/share/java-utils/pom_editor.sh
18 _pom_disable_gaid /usr/share/java-utils/pom_editor.sh
260 pom_remove_dep /usr/share/java-utils/pom_editor.sh


Additional info:
Tested in rawhide only, but may affect older releases too.

Comment 1 Mikolaj Izdebski 2013-09-10 18:10:26 UTC
(In reply to Mikolaj Izdebski from comment #0)
> But the following POM correctly causes macro failure.
> 
>     <project />

There is a typo. There should be no space before the slash.

Comment 2 Michael Simacek 2013-09-12 08:20:07 UTC
Moreover, it didn't add namespace to the empty project tag.

Should be fixed in commit bc8d9c1

Comment 3 Mikolaj Izdebski 2013-10-08 18:03:16 UTC
Fixed in javapackages-tools-3.3.1-1

Comment 4 Mikolaj Izdebski 2013-10-08 18:18:57 UTC
I believe that this bug is fixed in javapackages-tools-3.3.1-1,
which is available in Fedora Rawhide, so I am closing this bug now.

The build containing the fix can be found at Koji:
http://koji.fedoraproject.org/koji/buildinfo?buildID=469008