aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbland <bland@FreeBSD.org>2006-10-20 00:30:20 +0800
committerbland <bland@FreeBSD.org>2006-10-20 00:30:20 +0800
commit3783a722bf2dd4fc1683f237e2cd7bd9fe7763f3 (patch)
tree7d34c3df9be18024b278dd81414b3a0859857ad8
parent825e35bffb37447de4b83999f56436ce0713a53a (diff)
downloadfreebsd-ports-gnome-3783a722bf2dd4fc1683f237e2cd7bd9fe7763f3.tar.gz
freebsd-ports-gnome-3783a722bf2dd4fc1683f237e2cd7bd9fe7763f3.tar.zst
freebsd-ports-gnome-3783a722bf2dd4fc1683f237e2cd7bd9fe7763f3.zip
Fix performance bug in xml2po whcih may save users a few hours of
build time. Approved by: portmgr (marcus)
-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)