-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
33 lines (23 loc) · 1.05 KB
/
main.py
File metadata and controls
33 lines (23 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import subprocess
# Find the current git branch to choose stable or unstable variation.
g = subprocess.run(["git", "branch", "--show-current"], capture_output=True)
current_branch = g.stdout.decode("utf-8")[:-1]
# The version of LLVM we're based on. Used when we link to their documentatio.
current_llvm_version = "20.1.0"
print("Current branch: " + current_branch)
def define_env(env):
env.variables["branch"] = current_branch
env.variables["customer_specific_repo"] = "nonfree" in current_branch
scale_pkgname = "scale"
repo_subdomain = "pkgs"
if "nonfree" in current_branch:
repo_subdomain = "nonfree-" + repo_subdomain
if "unstable" in current_branch:
scale_pkgname += "-unstable"
env.variables["scale_pkgname"] = scale_pkgname
env.variables["repo_subdomain"] = repo_subdomain
env.variables["current_llvm_version"] = current_llvm_version
@env.macro
def checksum(url):
g = subprocess.run(["curl", url + ".sha512"], capture_output=True)
return g.stdout.decode("utf-8").split(" ")[0]