dependency: Undefined variable 'type_string'. Closes #156

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
pull/157/head
Igor Gnatenko 10 years ago
parent 474f438675
commit a9303a450e
  1. 10
      dependencies.py

@ -93,10 +93,10 @@ class PkgConfigDependency(Dependency):
if "pkgconfig" not in environment.cross_info: if "pkgconfig" not in environment.cross_info:
raise DependencyException('Pkg-config binary missing from cross file.') raise DependencyException('Pkg-config binary missing from cross file.')
pkgbin = environment.cross_info['pkgconfig'] pkgbin = environment.cross_info['pkgconfig']
type_string = 'Cross' self.type_string = 'Cross'
else: else:
pkgbin = 'pkg-config' pkgbin = 'pkg-config'
type_string = 'Native' self.type_string = 'Native'
self.pkgbin = pkgbin self.pkgbin = pkgbin
p = subprocess.Popen([pkgbin, '--modversion', name], p = subprocess.Popen([pkgbin, '--modversion', name],
@ -105,13 +105,13 @@ class PkgConfigDependency(Dependency):
out = p.communicate()[0] out = p.communicate()[0]
if p.returncode != 0: if p.returncode != 0:
if self.required: if self.required:
raise DependencyException('%s dependency %s not found.' % (type_string, name)) raise DependencyException('%s dependency %s not found.' % (self.type_string, name))
self.modversion = 'none' self.modversion = 'none'
self.cargs = [] self.cargs = []
self.libs = [] self.libs = []
else: else:
self.modversion = out.decode().strip() self.modversion = out.decode().strip()
mlog.log('%s dependency' % type_string, mlog.bold(name), 'found:', mlog.log('%s dependency' % self.type_string, mlog.bold(name), 'found:',
mlog.green('YES'), self.modversion) mlog.green('YES'), self.modversion)
version_requirement = kwargs.get('version', None) version_requirement = kwargs.get('version', None)
if version_requirement is None: if version_requirement is None:
@ -161,7 +161,7 @@ class PkgConfigDependency(Dependency):
if p.returncode != 0: if p.returncode != 0:
if self.required: if self.required:
raise DependencyException('%s dependency %s not found.' % raise DependencyException('%s dependency %s not found.' %
(type_string, self.name)) (self.type_string, self.name))
else: else:
variable = out.decode().strip() variable = out.decode().strip()
mlog.debug('return of subprocess : %s' % variable) mlog.debug('return of subprocess : %s' % variable)

Loading…
Cancel
Save