From 36a4b687c86cdcb3a3990a73f23d8a488374730b Mon Sep 17 00:00:00 2001 From: zyb Date: Sat, 20 Jul 2024 14:01:59 +0800 Subject: [PATCH] modified: patch.py --- patch.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/patch.py b/patch.py index 60a836b..5c2d8dc 100644 --- a/patch.py +++ b/patch.py @@ -284,8 +284,7 @@ def patch_npk_package(package,key_dict): extract_dir = 'squashfs-root' open(squashfs_file,'wb').write(package[NpkPartID.SQUASHFS].data) print(f"extract {squashfs_file} ...") - _, stderr = run_shell_command(f"unsquashfs -d {extract_dir} {squashfs_file}") - print(stderr.decode()) + run_shell_command(f"unsquashfs -d {extract_dir} {squashfs_file}") patch_squashfs(extract_dir,key_dict) keygen = os.path.join(extract_dir,'bin/keygen') if 'ARCH' in os.environ and os.environ['ARCH'] =='': @@ -299,8 +298,7 @@ def patch_npk_package(package,key_dict): run_shell_command(f"sudo sed -i '8s#.*# elseif@live.cn https://github.com/elseif/MikroTikPatch#' {logo}") print(f"pack {extract_dir} ...") run_shell_command(f"rm -f {squashfs_file}") - _, stderr = run_shell_command(f"mksquashfs {extract_dir} {squashfs_file} -quiet -comp xz -no-xattrs -b 256k") - print(stderr.decode()) + run_shell_command(f"mksquashfs {extract_dir} {squashfs_file} -quiet -comp xz -no-xattrs -b 256k") except Exception as e: print(e) print(f"clean ...")