From 5e06eb9b899f902eeb56935c166d58b2c5727faf Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 10 Nov 2023 16:32:36 -0500 Subject: [PATCH] wraptool: Remove dead code Update command is implemented in msubprojects.py, because it can update all wraps in parallel. --- mesonbuild/wrap/wraptool.py | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/mesonbuild/wrap/wraptool.py b/mesonbuild/wrap/wraptool.py index c4ff9dbbb..187bfaa79 100644 --- a/mesonbuild/wrap/wraptool.py +++ b/mesonbuild/wrap/wraptool.py @@ -20,7 +20,7 @@ import typing as T from glob import glob from .wrap import (open_wrapdburl, WrapException, get_releases, get_releases_data, - update_wrap_file, parse_patch_url) + parse_patch_url) from pathlib import Path from .. import mesonlib, msubprojects @@ -134,31 +134,6 @@ def get_current_version(wrapfile: str) -> T.Tuple[str, str, str, str, T.Optional patch_filename = wrap_data['patch_filename'] return branch, revision, wrap_data['directory'], wrap_data['source_filename'], patch_filename -def update(options: 'argparse.Namespace') -> None: - name = options.name - if not os.path.isdir('subprojects'): - raise SystemExit('Subprojects dir not found. Run this command in your source root directory.') - wrapfile = os.path.join('subprojects', name + '.wrap') - if not os.path.exists(wrapfile): - raise SystemExit('Project ' + name + ' is not in use.') - (branch, revision, subdir, src_file, patch_file) = get_current_version(wrapfile) - (new_branch, new_revision) = get_latest_version(name, options.allow_insecure) - if new_branch == branch and new_revision == revision: - print('Project ' + name + ' is already up to date.') - raise SystemExit - update_wrap_file(wrapfile, name, new_branch, new_revision, options.allow_insecure) - shutil.rmtree(os.path.join('subprojects', subdir), ignore_errors=True) - try: - os.unlink(os.path.join('subprojects/packagecache', src_file)) - except FileNotFoundError: - pass - if patch_file is not None: - try: - os.unlink(os.path.join('subprojects/packagecache', patch_file)) - except FileNotFoundError: - pass - print(f'Updated {name} version {new_branch} revision {new_revision}') - def info(options: 'argparse.Namespace') -> None: name = options.name releases = get_releases(options.allow_insecure)