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:
David Cantrell 2008-10-04 21:48:18 -10:00
parent e39a759cf1
commit 57c97b576c
1 changed files with 8 additions and 0 deletions

View File

@ -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 == []:
return False
# build the list of arguments to pass to yum
arglist = ['-c', yumconf]
arglist.append("--installroot=%s" % (destdir,))
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
# we care about
errcode = yummain.user_main(arglist, exit_code=False)