summaryrefslogtreecommitdiff
path: root/bin/update/create_partial_update.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/update/create_partial_update.py')
-rwxr-xr-xbin/update/create_partial_update.py41
1 files changed, 9 insertions, 32 deletions
diff --git a/bin/update/create_partial_update.py b/bin/update/create_partial_update.py
index 88a4553d6a36..8c49bd9159fd 100755
--- a/bin/update/create_partial_update.py
+++ b/bin/update/create_partial_update.py
@@ -29,10 +29,9 @@ def main():
base_url = sys.argv[6]
product_name = sys.argv[7]
version = sys.argv[8]
- old_archive = sys.argv[9]
- old_metadata = sys.argv[10]
+ old_msi = sys.argv[9]
- old_uncompress_dir = uncompress_file_to_dir(old_archive, updater_path.get_previous_build_dir())
+ old_uncompress_dir = uncompress_file_to_dir(old_msi, updater_path.get_previous_build_dir())
versionini = os.path.join(old_uncompress_dir, 'program', 'version.ini') #TODO: Linux, macOS
old_build_id = None
with open(versionini) as f:
@@ -44,33 +43,12 @@ def main():
if old_build_id is None:
raise Exception(f'Cannot find buildid in {versionini}')
- #TODO: check for problematic changes between old and new metadata
- with open(old_metadata) as meta:
- for l in meta:
- m = re.fullmatch('skip (.*)', l.rstrip())
- if m and m.group(1).startswith(f'{product_name}/'):
- path = m.group(1)[len(f'{product_name}/'):]
- os.remove(os.path.join(old_uncompress_dir, path))
-
- new_tar_file_glob = os.path.join(updater_path.get_workdir(), "installation", product_name, "archive", "install", "*", f'{product_name}_*_archive*')
- new_tar_files = glob.glob(new_tar_file_glob)
- if len(new_tar_files) != 1:
- raise Exception(f'`{new_tar_file_glob}` does not match exactly one file')
- new_tar_file = new_tar_files[0]
- new_uncompress_dir = uncompress_file_to_dir(new_tar_file, updater_path.get_current_build_dir())
-
- new_metadata = os.path.join(
- updater_path.get_workdir(), 'installation', product_name, 'archive', 'install', 'metadata')
- ifsfile = os.path.join(updater_path.get_mar_dir(), 'ifs')
- with open(new_metadata) as meta, open(ifsfile, 'w') as ifs:
- for l in meta:
- m = re.fullmatch('(skip|cond) (.*)', l.rstrip())
- if m and m.group(2).startswith(f'{product_name}/'):
- path = m.group(2)[len(f'{product_name}/'):]
- if m.group(1) == 'skip':
- os.remove(os.path.join(new_uncompress_dir, path))
- else:
- ifs.write(f'"{path}" "{path}"\n')
+ new_msi_file_glob = os.path.join(updater_path.get_workdir(), "installation", product_name, "msi", "install", "*", f'{product_name}_*.msi')
+ new_msi_files = glob.glob(new_msi_file_glob)
+ if len(new_msi_files) != 1:
+ raise Exception(f'`{new_msi_file_glob}` does not match exactly one file')
+ new_msi_file = new_msi_files[0]
+ new_uncompress_dir = uncompress_file_to_dir(new_msi_file, updater_path.get_current_build_dir())
update_dir = updater_path.get_update_dir()
@@ -80,8 +58,7 @@ def main():
os.putenv('MOZ_PRODUCT_VERSION', version)
os.putenv('MAR_CHANNEL_ID', 'LOOnlineUpdater')
subprocess.call([os.path.join(workdir, 'UnpackedTarball/onlineupdate/tools/update-packaging/make_incremental_update.sh'), convert_to_native(mar_file),
- convert_to_native(old_uncompress_dir), convert_to_native(new_uncompress_dir),
- convert_to_native(ifsfile)])
+ convert_to_native(old_uncompress_dir), convert_to_native(new_uncompress_dir)])
sign_mar_file(update_dir, certificate_path, certificate_name, mar_file, mar_name_prefix)