Make the cleanup() function just remove the tmpdir location.

This commit is contained in:
David Cantrell 2008-10-04 20:59:46 -10:00
parent fe8b541620
commit 3ec372e546
2 changed files with 9 additions and 9 deletions

View File

@ -130,5 +130,4 @@ if __name__ == "__main__":
sys.stderr.write("Error writing %s/.discinfo file.\n" % (output,))
# clean up
trash = [yumconf, treedir, buildinstdir]
pylorax.cleanup(trash)
pylorax.cleanup()

View File

@ -201,13 +201,14 @@ def cleanup(trash=[]):
"""
if trash is []:
return
if trash != []:
for item in trash:
if os.path.isdir(item):
shutil.rmtree(item, ignore_errors=True)
else:
os.unlink(item)
for item in trash:
if os.path.isdir(item):
shutil.rmtree(item, ignore_errors=True)
else:
os.unlink(item)
if os.path.isdir(conf['tmpdir']):
shutil.rmtree(conf['tmpdir'], ignore_errors=True)
return