-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build/emscripten: work around mesonbuild/meson#12638
- Loading branch information
Showing
3 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
import os | ||
import shutil | ||
|
||
from pathlib import Path | ||
|
||
from taiseilib.common import ( | ||
add_common_args, | ||
run_main, | ||
) | ||
|
||
def main(args): | ||
import argparse | ||
parser = argparse.ArgumentParser(description='Install resources from res-index', prog=args[0]) | ||
|
||
parser.add_argument('remove_items', | ||
type=Path, | ||
help='the files and/or directories to remove (relative to install destdir + prefix)', | ||
nargs='*', | ||
) | ||
|
||
add_common_args(parser) | ||
|
||
args = parser.parse_args(args[1:]) | ||
|
||
install_root = Path(os.environ['MESON_INSTALL_DESTDIR_PREFIX']) | ||
quiet = bool(os.environ.get('MESON_INSTALL_QUIET', False)) | ||
dryrun = bool(os.environ.get('MESON_INSTALL_DRY_RUN', False)) | ||
|
||
def log(*s): | ||
if not quiet: | ||
print(*s) | ||
|
||
for item in args.remove_items: | ||
itempath = (install_root / item) | ||
|
||
if dryrun: | ||
log(f'Would remove {itempath}') | ||
elif itempath.exists(): | ||
if itempath.is_dir(): | ||
log(f'Removing directory {itempath}') | ||
itempath.rmdir() | ||
else: | ||
log(f'Removing file {itempath}') | ||
itempath.unlink() | ||
else: | ||
log(f'Skipping non-existent file {itempath}') | ||
|
||
|
||
if __name__ == '__main__': | ||
run_main(main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters