Skip to content

Commit 0996470

Browse files
committed
Less annoying gitignore
1 parent f8b3124 commit 0996470

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/semiwrap/cmd_gen_pkgconf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ def main():
2525
module = project.get_extension(module_package_name)
2626
depends = project.get_extension_deps(module)
2727

28-
pc_install_path = project.package_root / pathlib.Path(*module_package_name.split(".")[:-1])
28+
pc_install_path = project.package_root / pathlib.Path(
29+
*module_package_name.split(".")[:-1]
30+
)
2931
make_pc_file(
3032
project_root=project.root,
3133
pcfile=args.pcfile,

src/semiwrap/hooks.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,13 @@ def initialize(self, version: str, build_data: T.Dict[str, T.Any]) -> None:
4444
stage1_build_path = stage0_build_path / "modules"
4545

4646
stage1_meson_build = stage1_build_path / "meson.build"
47-
stage1_gitignore = stage1_build_path / ".gitignore"
4847

4948
# This is used to generate files installed into a directory called 'trampolines'
5049
# so due to https://github.com/mesonbuild/meson/issues/2320 this must also be
5150
# in a directory called 'trampolines'
5251
# - unlike stage0 and stage1, this is included by stage0
5352
trampoline_build_path = stage0_build_path / "trampolines"
5453
trampoline_meson_build = trampoline_build_path / "meson.build"
55-
trampoline_gitignore = trampoline_build_path / ".gitignore"
5654

5755
eps = gen_meson_to_file(
5856
project_root, stage0_meson_build, stage1_meson_build, trampoline_meson_build
@@ -65,10 +63,8 @@ def initialize(self, version: str, build_data: T.Dict[str, T.Any]) -> None:
6563
g[ep.name] = ep.package
6664

6765
if not stage0_gitignore.exists():
68-
stage0_gitignore.write_text("/meson.build\n")
69-
70-
if not stage1_gitignore.exists():
71-
stage1_gitignore.write_text("/meson.build\n")
72-
73-
if not trampoline_gitignore.exists():
74-
trampoline_gitignore.write_text("/meson.build\n")
66+
stage0_gitignore.write_text(
67+
"/meson.build\n"
68+
f"/{stage1_build_path.name}/meson.build\n"
69+
f"/{trampoline_build_path.name}/meson.build\n"
70+
)

0 commit comments

Comments
 (0)