Convert builddist to a Python script.

This commit is contained in:
Jussi Pakkanen committed 2025-07-31 12:29:35 +03:00
1 parent fb1046d9e9
commit dd7cf67f00
2 files changed
+32 -19

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# Copyright 2025 The Meson development team
# This script must be run from the source root.
import pathlib, shutil, subprocess
gendir = pathlib.Path('distgendir')
distdir = pathlib.Path('dist')
gitdir = pathlib.Path('.git')
if distdir.is_dir():
shutil.rmtree(distdir)
distdir.mkdir()
if gendir.is_dir():
shutil.rmtree(gendir)
gendir.mkdir()
shutil.copytree(gitdir, gendir / '.git')
subprocess.check_call(['git', 'reset', '--hard'],
cwd=gendir)
subprocess.check_call(['python3', 'setup.py', 'sdist', 'bdist_wheel'],
cwd=gendir)
for f in (gendir / 'dist').glob('*'):
shutil.copy(f, distdir)
shutil.rmtree(gendir)
-19
View File
@@ -1,19 +0,0 @@
#!/usr/bin/zsh
# This script must be run from the source root.
set -e
GENDIR=distgendir
rm -rf dist
rm -rf $GENDIR
mkdir dist
mkdir $GENDIR
cp -r .git $GENDIR
cd $GENDIR
git reset --hard
python3 setup.py sdist bdist_wheel
cp dist/* ../dist
cd ..
rm -rf $GENDIR