mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
e20a887a8d
In the move to a python version of this script, I didn't notice that running the bootstrap script in shell mode precluded it from actually accepting the -disableMetrics argument. Existing vcpkg installs can be un-metrics'd by re-running the bootstrap script with the disable argument, or by adding a vcpkg.disable-metrics file in $VCPKG_ROOT
40 lines
1.2 KiB
Python
Executable file
40 lines
1.2 KiB
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
import os
|
|
import subprocess
|
|
import pathlib
|
|
import sys
|
|
|
|
|
|
def main() -> int:
|
|
script_dir = pathlib.Path(__file__).parent.resolve()
|
|
|
|
git_repo = "https://github.com/microsoft/vcpkg.git"
|
|
git_rev = "b2cb0da531c2f1f740045bfe7c4dac59f0b2b69c" # 2024.11.16
|
|
|
|
build_dir = script_dir.parent / "Build"
|
|
build_dir.mkdir(parents=True, exist_ok=True)
|
|
vcpkg_checkout = build_dir / "vcpkg"
|
|
|
|
if not vcpkg_checkout.is_dir():
|
|
subprocess.check_call(args=["git", "clone", git_repo], cwd=build_dir)
|
|
else:
|
|
bootstrapped_vcpkg_version = subprocess.check_output(
|
|
["git", "-C", vcpkg_checkout, "rev-parse", "HEAD"]).strip().decode()
|
|
|
|
if bootstrapped_vcpkg_version == git_rev:
|
|
return 0
|
|
|
|
print(f"Building vcpkg@{git_rev}")
|
|
|
|
subprocess.check_call(args=["git", "fetch", "origin"], cwd=vcpkg_checkout)
|
|
subprocess.check_call(args=["git", "checkout", git_rev], cwd=vcpkg_checkout)
|
|
|
|
bootstrap_script = "bootstrap-vcpkg.bat" if os.name == 'nt' else "bootstrap-vcpkg.sh"
|
|
subprocess.check_call(args=[vcpkg_checkout / bootstrap_script, "-disableMetrics"], cwd=vcpkg_checkout)
|
|
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|