Pass arch to scrubInstRoot().

This commit is contained in:
David Cantrell 2008-10-08 14:34:33 -10:00
parent 7d513f07ed
commit 7b75b130c7
1 changed files with 10 additions and 1 deletions

View File

@ -96,7 +96,7 @@ def createInstRoot(yumconf=None, arch=None, treedir=None, updates=None):
sys.stderr.write("ERROR: Could not install packages.\n") sys.stderr.write("ERROR: Could not install packages.\n")
sys.exit(1) sys.exit(1)
if not scrubInstRoot(destdir=destdir, libdir=libdir): if not scrubInstRoot(destdir=destdir, libdir=libdir, arch=arch):
sys.stderr.write("ERROR: Could not scrub instroot.\n") sys.stderr.write("ERROR: Could not scrub instroot.\n")
sys.exit(1) sys.exit(1)
@ -127,6 +127,8 @@ def installPackages(yumconf=None, destdir=None, packages=None):
arglist += ['install', '-y'] + packages arglist += ['install', '-y'] + packages
# do some prep work on the destdir before calling yum # do some prep work on the destdir before calling yum
os.makedirs(os.path.join(destdir, 'usr', 'lib', 'debug'))
os.makedirs(os.path.join(destdir, 'usr', 'src', 'debug'))
os.makedirs(os.path.join(destdir, 'tmp')) os.makedirs(os.path.join(destdir, 'tmp'))
os.makedirs(os.path.join(destdir, 'var', 'log')) os.makedirs(os.path.join(destdir, 'var', 'log'))
os.makedirs(os.path.join(destdir, 'var', 'lib')) os.makedirs(os.path.join(destdir, 'var', 'lib'))
@ -360,6 +362,13 @@ def scrubInstRoot(destdir=None, libdir='lib', arch=None):
shutil.rmtree(bootpath, ignore_errors=True) shutil.rmtree(bootpath, ignore_errors=True)
shutil.copytree(src, bootpath) shutil.copytree(src, bootpath)
# move the yum repos configuration directory
src = os.path.join(destdir, 'etc', 'yum.repos.d')
dst = os.path.join(destdir, 'etc', 'anaconda.repos.d')
if os.path.isdir(src):
shutil.rmtree(dst, ignore_errors=True)
shutil.move(src, dst)
# remove things we do not want in the instroot # remove things we do not want in the instroot
for subdir in ['boot', 'home', 'root', 'tmp']: for subdir in ['boot', 'home', 'root', 'tmp']:
shutil.rmtree(os.path.join(destdir, subdir), ignore_errors=True) shutil.rmtree(os.path.join(destdir, subdir), ignore_errors=True)