Skip to content

Commit

Permalink
java-ant-2.eclass: Drop unused and banned java-ant_remove-taskdefs
Browse files Browse the repository at this point in the history
It's been on the scrapheap long enough now.
  • Loading branch information
chewi committed Mar 24, 2018
1 parent 4cd964d commit 7113278
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions eclass/java-ant-2.eclass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2004-2017 Gentoo Foundation
# Copyright 2004-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: java-ant-2.eclass
Expand Down Expand Up @@ -359,40 +359,6 @@ java-ant_rewrite-classpath() {
fi
}

# @FUNCTION: java-ant_remove-taskdefs
# @USAGE: [--name NAME] [path/to/build.xml]
# @DESCRIPTION:
# Removes (named) taskdef elements from the build.xml file.
# When --name NAME is specified, only remove taskdef with name NAME. Otherwise,
# all taskdefs are removed.
# The file to rewrite defaults to build.xml when not specified.
java-ant_remove-taskdefs() {
debug-print-function ${FUNCNAME} $*

die "${FUNCNAME} has been banned, see bug #479838."

local task_name
if [[ "${1}" == --name ]]; then
task_name="${2}"
shift 2
fi
local file="${1:-build.xml}"
echo "Removing taskdefs from ${file}"
python <<EOF
import sys
from xml.dom.minidom import parse
dom = parse("${file}")
for elem in dom.getElementsByTagName('taskdef'):
if (len("${task_name}") == 0 or elem.getAttribute("name") == "${task_name}"):
elem.parentNode.removeChild(elem)
elem.unlink()
f = open("${file}", "w")
dom.writexml(f)
f.close()
EOF
[[ $? != 0 ]] && die "Removing taskdefs failed"
}

# @FUNCTION: java-ant_ignore-system-classes
# @USAGE: [path/to/build.xml]
# @DESCRIPTION:
Expand Down

0 comments on commit 7113278

Please sign in to comment.