mirror of https://gitlab.com/ita1024/waf.git
intltool: move some code outside a loop in intltool_in
It's fine to execute this code just one time since the environment variables won't change throughout the different source files.
This commit is contained in:
parent
2b5cab25d0
commit
c0314641b7
|
@ -71,23 +71,23 @@ def apply_intltool_in_f(self):
|
|||
|
||||
self.ensure_localedir()
|
||||
|
||||
podir = getattr(self, 'podir', '.')
|
||||
podirnode = self.path.find_dir(podir)
|
||||
if not podirnode:
|
||||
error("could not find the podir %r" % podir)
|
||||
return
|
||||
|
||||
cache = getattr(self, 'intlcache', '.intlcache')
|
||||
self.env.INTLCACHE = [os.path.join(str(self.path.get_bld()), podir, cache)]
|
||||
self.env.INTLPODIR = podirnode.bldpath()
|
||||
self.env.INTLFLAGS = getattr(self, 'flags', self.env.INTLFLAGS_DEFAULT)
|
||||
if '-c' in self.env.INTLFLAGS:
|
||||
Logs.warn('Redundant -c flag in intltool task %r' % self)
|
||||
self.env.INTLFLAGS.remove('-c')
|
||||
|
||||
for i in self.to_list(self.source):
|
||||
node = self.path.find_resource(i)
|
||||
|
||||
podir = getattr(self, 'podir', '.')
|
||||
podirnode = self.path.find_dir(podir)
|
||||
if not podirnode:
|
||||
error("could not find the podir %r" % podir)
|
||||
continue
|
||||
|
||||
cache = getattr(self, 'intlcache', '.intlcache')
|
||||
self.env.INTLCACHE = [os.path.join(str(self.path.get_bld()), podir, cache)]
|
||||
self.env.INTLPODIR = podirnode.bldpath()
|
||||
self.env.INTLFLAGS = getattr(self, 'flags', self.env.INTLFLAGS_DEFAULT)
|
||||
if '-c' in self.env.INTLFLAGS:
|
||||
Logs.warn('Redundant -c flag in intltool task %r' % self)
|
||||
self.env.INTLFLAGS.remove('-c')
|
||||
|
||||
task = self.create_task('intltool', node, node.change_ext(''))
|
||||
inst = getattr(self, 'install_path', None)
|
||||
if inst:
|
||||
|
|
Loading…
Reference in New Issue