[Pkg-osm-commits] [SCM] josm-plugins branch, master, updated. debian/0.0.svn25935-1-15-g6d31e36
Giovanni Mascellani
gio at debian.org
Sat Sep 10 10:45:11 UTC 2011
The following commit has been merged in the master branch:
commit 04dfe748967e6d6f1b56831425b3db8eca51154c
Author: Giovanni Mascellani <gio at debian.org>
Date: Sat Sep 10 00:30:55 2011 +0200
Trying to automatically patch build.xml files.
diff --git a/debian/fix_build_xml.py b/debian/fix_build_xml.py
new file mode 100755
index 0000000..52839ae
--- /dev/null
+++ b/debian/fix_build_xml.py
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+
+import sys
+import shutil
+import codecs
+import xml.dom.minidom as minidom
+
+def main():
+
+ # Read the command line
+ try:
+ orig_filename = sys.argv[1]
+ bak_filename = sys.argv[2]
+ except IndexError:
+ print >> sys.stderr, "Please specify XML filename and backup filename"
+
+ # Parse the XML build.xml file
+ doc = minidom.parse(orig_filename)
+
+ # Remove Internet access in revision target
+ [revision_target] = [target for target in doc.getElementsByTagName('target')
+ if target.attributes['name'].value == 'revision']
+ revision_target.childNodes = []
+ #revision_target.childNodes = [node for node in revision_target.childNodes
+ # if node.nodeName != 'exec' and node.nodeName != 'delete']
+ #[xmlproperty_node] = [node for node in revision_target.childNodes
+ # if node.nodeName == 'xmlproperty']
+ #xmlproperty_node.attributes['file'].value = 'svn-info.xml'
+
+ # Make a backup copy of the build.xml file
+ shutil.copyfile(orig_filename, bak_filename)
+ with codecs.open(orig_filename, 'w', 'utf-8') as orig_file:
+ doc.writexml(orig_file)
+
+if __name__ == '__main__':
+ main()
diff --git a/debian/rules b/debian/rules
index 2a6bf0a..9d66110 100755
--- a/debian/rules
+++ b/debian/rules
@@ -18,11 +18,19 @@ DESTTGZ := ../tarballs/josm-plugins_${VERSION}.orig.tar.gz
%:
dh $@
+override_dh_auto_configure:
+ for plugin in ${PLUGINS}; do \
+ python ./debian/fix_build_xml.py $$plugin/build.xml $$plugin/build.xml.bak ; \
+ done
+
override_dh_auto_build:
dh_auto_build -Sant -- -f $(CURDIR)/debian/master.xml build
override_dh_auto_clean:
dh_auto_clean -Sant -- -f $(CURDIR)/debian/master.xml
+ for plugin in ${PLUGINS}; do \
+ [ -f $$plugin/build.xml.bak ] && mv $$plugin/build.xml.bak $$plugin/build.xml || true ; \
+ done
get-orig-source:
dh_testdir
--
Plugins for JOSM
More information about the Pkg-osm-commits
mailing list