Do prep work before letting yum lay down packages.
Create some directories and symlinks like upd-instroot does before calling yum.
This commit is contained in:
parent
e39a759cf1
commit
57c97b576c
@ -118,10 +118,18 @@ def installPackages(yumconf=None, destdir=None, packages=None):
|
|||||||
if yumconf is None or destdir is None or packages is None or packages == []:
|
if yumconf is None or destdir is None or packages is None or packages == []:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# build the list of arguments to pass to yum
|
||||||
arglist = ['-c', yumconf]
|
arglist = ['-c', yumconf]
|
||||||
arglist.append("--installroot=%s" % (destdir,))
|
arglist.append("--installroot=%s" % (destdir,))
|
||||||
arglist += ['install', '-y'] + packages
|
arglist += ['install', '-y'] + packages
|
||||||
|
|
||||||
|
# do some prep work on the destdir before calling yum
|
||||||
|
os.makedirs(os.path.join(destdir, 'var', 'lib'))
|
||||||
|
os.makedirs(os.path.join(destdir, 'tmp'))
|
||||||
|
os.makedirs(os.path.join(destdir, 'var', 'log'))
|
||||||
|
os.makedirs(os.path.join(destdir, 'var', 'lib', 'yum'))
|
||||||
|
os.symlink(os.path.join(os.path.sep, 'tmp'), os.path.join(destdir, 'var', 'lib', 'xkb'))
|
||||||
|
|
||||||
# XXX: sort through yum errcodes and return False for actual bad things
|
# XXX: sort through yum errcodes and return False for actual bad things
|
||||||
# we care about
|
# we care about
|
||||||
errcode = yummain.user_main(arglist, exit_code=False)
|
errcode = yummain.user_main(arglist, exit_code=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user