From 57c97b576c4a6cab42b19c2d528d03c3e2babef6 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Sat, 4 Oct 2008 21:48:18 -1000 Subject: [PATCH] Do prep work before letting yum lay down packages. Create some directories and symlinks like upd-instroot does before calling yum. --- src/pylorax/instroot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pylorax/instroot.py b/src/pylorax/instroot.py index 98118c1c..b56b3323 100644 --- a/src/pylorax/instroot.py +++ b/src/pylorax/instroot.py @@ -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)