summaryrefslogtreecommitdiff
path: root/textproc
diff options
context:
space:
mode:
authorAlexander Nedotsukov <bland@FreeBSD.org>2006-10-19 16:30:20 +0000
committerAlexander Nedotsukov <bland@FreeBSD.org>2006-10-19 16:30:20 +0000
commit5667504a846f1822a2a9ecd6c3d1ff0f375d17aa (patch)
tree3cada625aacb41c8766ed8ab63966c56b2470b34 /textproc
parentUpdate to 4.6.10 to address security issues. (diff)
Fix performance bug in xml2po whcih may save users a few hours of
build time. Approved by: portmgr (marcus)
Notes
Notes: svn path=/head/; revision=175406
Diffstat (limited to 'textproc')
-rw-r--r--textproc/gnome-doc-utils/Makefile1
-rw-r--r--textproc/gnome-doc-utils/files/patch-xml2po__xml2po.py41
2 files changed, 42 insertions, 0 deletions
diff --git a/textproc/gnome-doc-utils/Makefile b/textproc/gnome-doc-utils/Makefile
index 2891a55846c1..ec389ff83990 100644
--- a/textproc/gnome-doc-utils/Makefile
+++ b/textproc/gnome-doc-utils/Makefile
@@ -7,6 +7,7 @@
PORTNAME= gnome-doc-utils
PORTVERSION= 0.7.2
+PORTREVISION= 1
CATEGORIES= textproc gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/gnome-doc-utils/0.7
diff --git a/textproc/gnome-doc-utils/files/patch-xml2po__xml2po.py b/textproc/gnome-doc-utils/files/patch-xml2po__xml2po.py
new file mode 100644
index 000000000000..e0620056fab5
--- /dev/null
+++ b/textproc/gnome-doc-utils/files/patch-xml2po__xml2po.py
@@ -0,0 +1,41 @@
+--- xml2po/xml2po.py.orig Sun Apr 2 03:47:17 2006
++++ xml2po/xml2po.py Fri Oct 20 00:57:46 2006
+@@ -242,14 +242,10 @@
+ text = normalizeString(text, not spacepreserve)
+ if (text.strip() == ''):
+ return text
+- file = open(mofile, "rb")
+- if file:
+- myfallback = NoneTranslations()
+- gt = gettext.GNUTranslations(file)
+- gt.add_fallback(myfallback)
+- if gt:
+- res = gt.ugettext(text.decode('utf-8'))
+- return res
++ global gt
++ if gt:
++ res = gt.ugettext(text.decode('utf-8'))
++ return res
+
+ return text
+
+@@ -648,6 +644,7 @@
+ filename = ''
+ origxml = ''
+ mofile = ''
++gt = None
+ ultimate = [ ]
+ ignored = [ ]
+ filenames = [ ]
+@@ -763,6 +760,11 @@
+ if mode=='merge' and mofile=='':
+ print >> sys.stderr, "Error: You must specify MO file when merging translations."
+ sys.exit(3)
++
++file = open(mofile, "rb")
++if file:
++ gt = gettext.GNUTranslations(file)
++ gt.add_fallback(NoneTranslations())
+
+ ultimate_tags = read_finaltags(ultimate)
+ ignored_tags = read_ignoredtags(ignored)