Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 552332 - java-pkg-2.eclass: java-pkg-2_supports-test() makes use of in-line python code to parse xml
Summary: java-pkg-2.eclass: java-pkg-2_supports-test() makes use of in-line python cod...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-16 21:20 UTC by Patrice Clement
Modified: 2015-06-17 09:48 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
java-pkg-2_supports-test.patch (java-pkg-2_supports-test.patch,1.16 KB, patch)
2015-06-16 22:24 UTC, James Le Cuirot
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrice Clement gentoo-dev 2015-06-16 21:20:46 UTC
# @FUNCTION: java-pkg-2_supports-test
# @INTERNAL                    
# @DESCRIPTION:                
# test whether a build.xml has a test target.
                               
java-pkg-2_supports-test() {                                                                                                      
    python << EOF              
from xml.dom.minidom import parse
import sys                     
dom = parse("${1}")            
for elem in dom.getElementsByTagName('target'):
    if elem.getAttribute('name') == 'test':
            sys.exit(0)        
sys.exit(1)                    
EOF                            
    return $?                  
} 

As per bug 479838 and explained by mgorny, this shouldn't be allowed.

Reproducible: Always
Comment 1 James Le Cuirot gentoo-dev 2015-06-16 22:24:11 UTC
Created attachment 405254 [details, diff]
java-pkg-2_supports-test.patch

How about this? Please ack and I'll get it merged.
Comment 2 Patrice Clement gentoo-dev 2015-06-17 05:01:08 UTC
LGTM. Go ahead.
Comment 3 James Le Cuirot gentoo-dev 2015-06-17 09:48:25 UTC
Merged.