Skip to content

Commit

Permalink
wrap: Print deprecation warnings when using wrapdb v1
Browse files Browse the repository at this point in the history
  • Loading branch information
xclaesse committed Nov 13, 2024
1 parent f0851c9 commit 4b122ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/markdown/snippets/wrapdbv1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Limited support for WrapDB v1

WrapDB v1 has been discontinued for several years, Meson will now print a
deprecation warning if a v1 URL is still being used. Wraps can be updated to
latest version using `meson wrap update` command.
9 changes: 9 additions & 0 deletions mesonbuild/wrap/wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ def from_wrap_file(filename: str, subproject: SubProject = SubProject('')) -> Pa
wrap.original_filename = filename
wrap.parse_provide_section(config)

patch_url = values.get('patch_url')
if patch_url and patch_url.startswith('https://wrapdb.mesonbuild.com/v1'):
if name == 'sqlite':
mlog.deprecation(f'sqlite wrap has been renamed to sqlite3, update using `meson wrap install sqlite3`')
elif name == 'libjpeg':
mlog.deprecation(f'libjpeg wrap has been renamed to libjpeg-turbo, update using `meson wrap install libjpeg-turbo`')
else:
mlog.deprecation(f'WrapDB v1 is deprecated, updated using `meson wrap update {name}`')

with open(filename, 'r', encoding='utf-8') as file:
wrap.wrapfile_hash = hashlib.sha256(file.read().encode('utf-8')).hexdigest()

Expand Down

0 comments on commit 4b122ca

Please sign in to comment.