From 8a93de0607ba23001c6ce83e3577648ac4b15fc8 Mon Sep 17 00:00:00 2001 From: zhkag Date: Tue, 23 May 2023 17:18:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20linux=20=E4=B8=8A=E8=A7=A3?= =?UTF-8?q?=E5=8E=8B=E8=BD=AF=E4=BB=B6=E5=8C=85=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archive.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/archive.py b/archive.py index 376ad1fe..f644d170 100644 --- a/archive.py +++ b/archive.py @@ -92,16 +92,15 @@ def handle_zip_package(archive_filename, bsp_package_path, package_name, package for item in arch.namelist(): arch.extract(item, package_temp_path) if not os.path.isdir(os.path.join(package_temp_path, item)): - if is_windows(): - right_path = item.replace('/', '\\') - else: - right_path = item - # Gets the folder name and changed folder name only once if flag: - package_folder_name = right_path.split('\\')[0] + package_folder_name = item.split('/')[0] package_name_with_version = package_name + '-' + package_version flag = False + if is_windows(): + right_path = item.replace('/', '\\') + else: + right_path = item right_name_to_db = right_path.replace(package_folder_name, package_name_with_version, 1) right_path = os.path.join("package_temp", right_path)