Put all temp files in to the same subdirectory.
Use the system default temp directory (can override with TMPDIR env var), but make a lorax subdirectory in that directory for all of the lorax trees.
This commit is contained in:
parent
e6aebb1c3d
commit
eda4c740fa
@ -37,6 +37,7 @@ import instroot
|
|||||||
|
|
||||||
conf = {}
|
conf = {}
|
||||||
conf['confdir'] = '/etc/lorax'
|
conf['confdir'] = '/etc/lorax'
|
||||||
|
conf['tmpdir'] = tempfile.gettempdir()
|
||||||
|
|
||||||
def show_version(prog):
|
def show_version(prog):
|
||||||
"""show_version(prog)
|
"""show_version(prog)
|
||||||
@ -89,10 +90,10 @@ def initializeDirs(output):
|
|||||||
if not os.path.isdir(output):
|
if not os.path.isdir(output):
|
||||||
os.makedirs(output, mode=0755)
|
os.makedirs(output, mode=0755)
|
||||||
|
|
||||||
tmpdir = tempfile.gettempdir()
|
conf['tmpdir'] = tempfile.mkdtemp('XXXXXX', 'lorax.tmp.', conf['tmpdir'])
|
||||||
buildinstdir = tempfile.mkdtemp('XXXXXX', 'buildinstall.tree.', tmpdir)
|
buildinstdir = tempfile.mkdtemp('XXXXXX', 'buildinstall.tree.', conf['tmpdir'])
|
||||||
treedir = tempfile.mkdtemp('XXXXXX', 'treedir.', tmpdir)
|
treedir = tempfile.mkdtemp('XXXXXX', 'treedir.', conf['tmpdir'])
|
||||||
cachedir = tempfile.mkdtemp('XXXXXX', 'yumcache.', tmpdir)
|
cachedir = tempfile.mkdtemp('XXXXXX', 'yumcache.', conf['tmpdir'])
|
||||||
|
|
||||||
return buildinstdir, treedir, cachedir
|
return buildinstdir, treedir, cachedir
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user