From a94f70a12c9dfd6617296fa11df4923738249f24 Mon Sep 17 00:00:00 2001 From: Caleb Smith Date: Fri, 1 Nov 2019 13:28:04 -0500 Subject: [PATCH] Fix for partial pack creation --- bcml/data/version.txt | 2 +- bcml/install.py | 12 ++++++++---- installer.cfg | 2 +- setup.py | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/bcml/data/version.txt b/bcml/data/version.txt index 69fbbd08..d027c852 100644 --- a/bcml/data/version.txt +++ b/bcml/data/version.txt @@ -1 +1 @@ -version='2.4.8' +version='2.4.9' diff --git a/bcml/install.py b/bcml/install.py index f3a86b14..362caad9 100644 --- a/bcml/install.py +++ b/bcml/install.py @@ -572,7 +572,6 @@ def _clean_sarc(file: Path, hashes: dict, tmp_dir: Path): if not old_sarc: return old_files = set(old_sarc.list_files()) - del old_sarc if canon not in hashes: return with file.open('rb') as s_file: @@ -584,13 +583,18 @@ def _clean_sarc(file: Path, hashes: dict, tmp_dir: Path): for nest_file in base_sarc.list_files(): canon = nest_file.replace('.s', '.') ext = Path(canon).suffix - file_data = base_sarc.get_file_data(nest_file).tobytes() - xhash = xxhash.xxh32(util.unyaz_if_needed(file_data)).hexdigest() if ext in {'.yml', '.bak'}: continue - if nest_file not in old_files or (xhash != hashes[canon] and ext not in util.AAMP_EXTS): + file_data = base_sarc.get_file_data(nest_file).tobytes() + xhash = xxhash.xxh32(util.unyaz_if_needed(file_data)).hexdigest() + if nest_file in old_files: + old_hash = xxhash.xxh32( + util.unyaz_if_needed(old_sarc.get_file_data(nest_file).tobytes()) + ).hexdigest() + if nest_file not in old_files or (xhash != old_hash and ext not in util.AAMP_EXTS): can_delete = False new_sarc.add_file(nest_file, file_data) + del old_sarc if can_delete: del new_sarc file.unlink() diff --git a/installer.cfg b/installer.cfg index b3efd3ca..dc7d1f57 100644 --- a/installer.cfg +++ b/installer.cfg @@ -1,6 +1,6 @@ [Application] name=BCML -version=2.4.8 +version=2.4.9 entry_point=bcml.__init__:main icon=bcml/data/bcml.ico diff --git a/setup.py b/setup.py index 4eb82d4e..79a70135 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name='bcml', - version='2.4.8', + version='2.4.9', author='NiceneNerd', author_email='macadamiadaze@gmail.com', description='A mod manager for The Legend of Zelda: Breath of the Wild on Cemu',