Support change of the patch-iso temp dir

This is useful when running pungi-patch-iso on VM with low amount of
memory but higher disk space. Without this option the operation will
fail because /tmp is tmpfs filesystem.

Signed-off-by: Jiri Konecny <jkonecny@redhat.com>
This commit is contained in:
Jiri Konecny 2020-09-15 14:28:01 +02:00
parent 22efe15379
commit 59727f84b1
No known key found for this signature in database
GPG Key ID: 38F52F0E5C3FAD25
2 changed files with 4 additions and 1 deletions

View File

@ -33,6 +33,9 @@ def main(args=None):
parser.add_argument( parser.add_argument(
"--force-arch", help="Treat the ISO as bootable on given architecture" "--force-arch", help="Treat the ISO as bootable on given architecture"
) )
parser.add_argument(
"--work-dir", help="Set custom working directory. Default: /tmp/", default=None
)
parser.add_argument( parser.add_argument(
"target", metavar="TARGET_ISO", help="which file to write the result to" "target", metavar="TARGET_ISO", help="which file to write the result to"
) )

View File

@ -79,7 +79,7 @@ def run(log, opts):
log.info("Mounting %s", opts.source) log.info("Mounting %s", opts.source)
target = os.path.abspath(opts.target) target = os.path.abspath(opts.target)
with util.temp_dir(prefix="patch-iso-") as work_dir: with util.temp_dir(prefix="patch-iso-", dir=opts.work_dir) as work_dir:
with iso.mount(opts.source) as source_iso_dir: with iso.mount(opts.source) as source_iso_dir:
util.copy_all(source_iso_dir, work_dir) util.copy_all(source_iso_dir, work_dir)