[meld/build-updates: 17/26] Improve dist command for version sourcing and newer Meson
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/build-updates: 17/26] Improve dist command for version sourcing and newer Meson
- Date: Sun, 11 Sep 2022 02:17:15 +0000 (UTC)
commit d9ea21e8462f0de9875c7f2db2456ee43349b470
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Sep 11 09:44:38 2022 +1000
Improve dist command for version sourcing and newer Meson
maint | 35 +++++++++++++++++++++--------------
1 file changed, 21 insertions(+), 14 deletions(-)
---
diff --git a/maint b/maint
index 6a509c17..cd04c772 100644
--- a/maint
+++ b/maint
@@ -10,6 +10,7 @@ import re
import subprocess
import sys
import urllib.parse
+from pathlib import Path
import click
import keyring
@@ -370,23 +371,29 @@ def appdata():
@cli.command()
-def dist():
- build_dir = '_build'
- archive = f"{APPLICATION_NAME}-{meld.conf.__version__}.tar.xz"
- dist_archive_path = os.path.abspath(
- os.path.join(build_dir, 'meson-dist', archive))
-
- click.echo('Running meson...')
- cmd = ['meson', build_dir]
+@click.option(
+ "--skip-dirty-check", is_flag=True,
+ help="Skip Meson's check for uncommitted changes",
+)
+def dist(skip_dirty_check: bool) -> Path:
+ build_dir = Path("_build").resolve()
+ archive = f"{APPLICATION_NAME}-{get_version()}.tar.xz"
+ dist_archive_path = build_dir / "meson-dist" / archive
+
+ click.echo("Setting up meson build...")
+ cmd = ["meson", "setup", build_dir]
call_with_output(cmd, echo_stdout=False)
- click.echo('Creating distribution...')
- cmd = ['ninja', '-C', build_dir, 'dist']
+ click.echo("Generating source distribution...")
+ cmd = ["meson", "dist", "-C", build_dir]
+ if skip_dirty_check:
+ cmd += ["--allow-dirty"]
call_with_output(cmd, echo_stdout=False)
- if not os.path.exists(dist_archive_path):
- click.echo('Failed to create archive file %s' % dist_archive_path)
+ if not dist_archive_path.exists():
+ click.echo(f"Failed to create archive file {dist_archive_path}")
raise click.Abort()
+
return dist_archive_path
@@ -476,12 +483,12 @@ def make_release(ctx):
commit(message='Post-release version bump')
push()
- ctx.forward(upload, path=archive_path)
+ ctx.forward(upload, path=str(archive_path))
# TODO: ssh in and run ftpadmin install
click.echo('\nNow run:')
click.echo('ssh %s' % UPLOAD_SERVER)
- click.echo('ftpadmin install %s' % os.path.basename(archive_path))
+ click.echo(f"ftpadmin install {archive_path.name}")
if __name__ == '__main__':
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]