mirror of
https://gitlab.com/square-game-liberation-front/F.E.I.S.git
synced 2025-03-01 07:50:25 +01:00
25 lines
765 B
Python
25 lines
765 B
Python
|
"""implement the missing --save option of meson subprojects packagefiles
|
||
|
for wrap-git packages"""
|
||
|
|
||
|
from argparse import ArgumentParser
|
||
|
from path import Path
|
||
|
|
||
|
parser = ArgumentParser()
|
||
|
parser.add_argument("wrap", type=Path)
|
||
|
args = parser.parse_args()
|
||
|
|
||
|
subprojects = Path("subprojects")
|
||
|
if not subprojects.exists():
|
||
|
print(f"{subprojects} folder doesn't exist, are you in the right directory ?")
|
||
|
|
||
|
subproject = subprojects / args.wrap
|
||
|
patch = subprojects / "packagefiles" / args.wrap
|
||
|
if not patch.exists():
|
||
|
print(f"subproject folder doesn't exist ({subproject}), is the name correct ?")
|
||
|
|
||
|
for absolute in subproject.walkfiles("*meson*"):
|
||
|
relative = absolute.relpath(subproject)
|
||
|
(patch / relative).parent.makedirs_p()
|
||
|
absolute.copy(patch / relative)
|
||
|
|