mirror of
https://git.launchpad.net/livecd-rootfs
synced 2026-02-12 13:03:43 +00:00
do not truncate xorriso invocation in output
This commit is contained in:
parent
acd63ee3e4
commit
9add6d4ab8
@ -79,7 +79,7 @@ class Logger:
|
|||||||
if done_msg is not None:
|
if done_msg is not None:
|
||||||
self.log(done_msg)
|
self.log(done_msg)
|
||||||
|
|
||||||
def msg_for_cmd(self, cmd, cwd=None) -> str:
|
def msg_for_cmd(self, cmd, limit_length=True, cwd=None) -> str:
|
||||||
if cwd is None:
|
if cwd is None:
|
||||||
_cwd = pathlib.Path().cwd()
|
_cwd = pathlib.Path().cwd()
|
||||||
else:
|
else:
|
||||||
@ -92,15 +92,19 @@ class Logger:
|
|||||||
arg = str(arg)
|
arg = str(arg)
|
||||||
fmted_cmd.append(shlex.quote(arg))
|
fmted_cmd.append(shlex.quote(arg))
|
||||||
fmted_cmd_str = " ".join(fmted_cmd)
|
fmted_cmd_str = " ".join(fmted_cmd)
|
||||||
if len(fmted_cmd_str) > MAX_CMD_DISPLAY_LENGTH:
|
if len(fmted_cmd_str) > MAX_CMD_DISPLAY_LENGTH and limit_length:
|
||||||
fmted_cmd_str = fmted_cmd_str[:MAX_CMD_DISPLAY_LENGTH] + "..."
|
fmted_cmd_str = fmted_cmd_str[:MAX_CMD_DISPLAY_LENGTH] + "..."
|
||||||
msg = f"running `{fmted_cmd_str}`"
|
msg = f"running `{fmted_cmd_str}`"
|
||||||
if cwd is not None:
|
if cwd is not None:
|
||||||
msg += f" in {cwd}"
|
msg += f" in {cwd}"
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def run(self, cmd: list[str | pathlib.Path], *args, check=True, **kw):
|
def run(
|
||||||
with self.logged(self.msg_for_cmd(cmd, kw.get("cwd"))):
|
self, cmd: list[str | pathlib.Path], *args, limit_length=True, check=True, **kw
|
||||||
|
):
|
||||||
|
with self.logged(
|
||||||
|
self.msg_for_cmd(cmd, cwd=kw.get("cwd"), limit_length=limit_length)
|
||||||
|
):
|
||||||
return subprocess.run(cmd, *args, check=check, **kw)
|
return subprocess.run(cmd, *args, check=check, **kw)
|
||||||
|
|
||||||
|
|
||||||
@ -362,4 +366,4 @@ class ISOBuilder:
|
|||||||
cmd += ["-V", volid]
|
cmd += ["-V", volid]
|
||||||
cmd += mkisofs_opts + [self.iso_root, "-o", dest]
|
cmd += mkisofs_opts + [self.iso_root, "-o", dest]
|
||||||
with self.logger.logged("running xorriso"):
|
with self.logger.logged("running xorriso"):
|
||||||
self.logger.run(cmd, cwd=self.workdir, check=True)
|
self.logger.run(cmd, cwd=self.workdir, check=True, limit_length=False)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user