Add changes for dib feature/v2 branch
With diskimage-builder v2 branch, lib is nested on diskimage_builder directory, so add this to the search of paths to get that env var. Change-Id: If69ffd4885c9da447c3483b186344914cfed22c2
This commit is contained in:
parent
bb442cb4bf
commit
3925605aec
|
@ -97,12 +97,17 @@ def set_environment(tmp_dir):
|
|||
os.environ['PATH'] = "%s:/usr/local/bin" % os.environ['PATH']
|
||||
os.environ.setdefault('DIB_DEFAULT_INSTALLTYPE', 'package')
|
||||
|
||||
if os.path.exists('/usr/share/diskimage-builder/lib'):
|
||||
os.environ['_LIB'] = '/usr/share/diskimage-builder/lib'
|
||||
elif os.path.exists('diskimage-builder/lib'):
|
||||
os.environ['_LIB'] = 'diskimage-builder/lib'
|
||||
else:
|
||||
raise Exception("Can't detect diskimage-builder lib directory.")
|
||||
# first try to get it with paths tooling from dib
|
||||
try:
|
||||
import diskimage_builder.paths
|
||||
os.environ['_LIB'] = diskimage_builder.paths.get_path("lib")
|
||||
except ImportError:
|
||||
if os.path.exists('/usr/share/diskimage-builder/lib'):
|
||||
os.environ['_LIB'] = '/usr/share/diskimage-builder/lib'
|
||||
elif os.path.exists('diskimage-builder/lib'):
|
||||
os.environ['_LIB'] = 'diskimage-builder/lib'
|
||||
else:
|
||||
raise Exception("Can't detect diskimage-builder lib directory.")
|
||||
|
||||
os.environ['TARGET_ROOT'] = '/'
|
||||
if platform.processor() == 'x86_64':
|
||||
|
|
Loading…
Reference in New Issue