aboutsummaryrefslogtreecommitdiffstats
path: root/debian/lib/python/debian_linux/utils.py
diff options
context:
space:
mode:
authorBen Hutchings <benh@debian.org>2013-08-17 11:18:34 +0000
committerBen Hutchings <benh@debian.org>2013-08-17 11:18:34 +0000
commit03fab0311a014fda8488e70323c4b3c5a7a2a1ea (patch)
treeefd0ad947fbfeda174e648006a86a908ee0c5d6f /debian/lib/python/debian_linux/utils.py
parentd58ea92ffd8202663a890c34533b3abd3df57468 (diff)
downloadkernel_replicant_linux-03fab0311a014fda8488e70323c4b3c5a7a2a1ea.tar.gz
kernel_replicant_linux-03fab0311a014fda8488e70323c4b3c5a7a2a1ea.tar.bz2
kernel_replicant_linux-03fab0311a014fda8488e70323c4b3c5a7a2a1ea.zip
Don't require '.in' suffix on templates
The PO files processed by debconf-updatepo, which in our case are templates, must have names ending in .po rather than .in. So look for un-suffixed template files after looking for files with the .in suffix. svn path=/dists/trunk/linux/; revision=20504
Diffstat (limited to 'debian/lib/python/debian_linux/utils.py')
-rw-r--r--debian/lib/python/debian_linux/utils.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/debian/lib/python/debian_linux/utils.py b/debian/lib/python/debian_linux/utils.py
index 563104ed3dce..454d7c8e8e7b 100644
--- a/debian/lib/python/debian_linux/utils.py
+++ b/debian/lib/python/debian_linux/utils.py
@@ -19,13 +19,14 @@ class Templates(object):
def _read(self, name):
prefix, id = name.split('.', 1)
- for dir in self.dirs:
- filename = "%s/%s.in" % (dir, name)
- if os.path.exists(filename):
- f = codecs.open(filename, 'r', 'utf-8')
- if prefix == 'control':
- return read_control(f)
- return f.read()
+ for suffix in ['.in', '']:
+ for dir in self.dirs:
+ filename = "%s/%s%s" % (dir, name, suffix)
+ if os.path.exists(filename):
+ f = codecs.open(filename, 'r', 'utf-8')
+ if prefix == 'control':
+ return read_control(f)
+ return f.read()
def get(self, key, default=None):
if key in self._cache: