[josm-plugins] 256/369: Trying to automatically patch build.xml files.

Bas Couwenberg sebastic at xs4all.nl
Sat Oct 18 12:03:49 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastic-guest pushed a commit to branch master
in repository josm-plugins.

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.
---
 debian/fix_build_xml.py | 36 ++++++++++++++++++++++++++++++++++++
 debian/rules            |  8 ++++++++
 2 files changed, 44 insertions(+)

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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/josm-plugins.git



More information about the Pkg-grass-devel mailing list