~ubuntu-branches/ubuntu/saucy/xxdiff/saucy

« back to all changes in this revision

Viewing changes to debian/patches/08_516143_xml_is_text.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Y Giridhar Appaji Nag
  • Date: 2009-02-24 14:51:19 UTC
  • Revision ID: james.westby@ubuntu.com-20090224145119-gxqpvlgd96g2ru1i
Tags: 1:3.2-9
* Update Maintainer to official Debian ID
* Remove DM-Upload-Allowed: yes
* Patch 08_516143_xml_is_text to classify XML files as text, thanks to
  "J.P. Delport" <jpdelport@csir.co.za> for the patch (Closes: #516143)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 08_516143_xml_is_text.dpatch by Y Giridhar Appaji Nag <appaji@debian.org>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: Don't classify XML files as non-text, thanks "J.P. Delport"
 
6
## DP: <jpdelport@csir.co.za> for the bug report #516143 and the patch.
 
7
 
 
8
@DPATCH@
 
9
diff -urNad xxdiff-3.2~/lib/python/xxdiff/utils.py xxdiff-3.2/lib/python/xxdiff/utils.py
 
10
--- xxdiff-3.2~/lib/python/xxdiff/utils.py      2008-09-30 18:03:57.000000000 +0530
 
11
+++ xxdiff-3.2/lib/python/xxdiff/utils.py       2009-02-24 14:48:08.000000000 +0530
 
12
@@ -59,6 +59,7 @@
 
13
 # options were taken from Ian F. Darwin's file implementation.
 
14
 guesscmd = ['file', '-b', '-L']
 
15
 text_re = re.compile('\\btext\\b')
 
16
+xml_re = re.compile('\\bXML\\b')
 
17
 empty_re = re.compile('^empty$')
 
18
 
 
19
 def istextfile(fn):
 
20
@@ -75,7 +76,7 @@
 
21
     if p.returncode != 0 or stderr or stdout.startswith('cannot open'):
 
22
         raise RuntimeError("Error: Running 'file' on '%s'." % fn)
 
23
 
 
24
-    return bool(text_re.search(stdout) or empty_re.match(stdout))
 
25
+    return bool(text_re.search(stdout) or xml_re.search(stdout) or empty_re.match(stdout))
 
26
 
 
27
 
 
28
 #-------------------------------------------------------------------------------