mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
llvmPackages: Fix update-git.py
This was broken since the change which got rid of llvm/git/default.nix. Fairly obvious fixes. Signed-off-by: Peter Waller <p@pwaller.net>
This commit is contained in:
parent
6011527ff3
commit
cf2e76fca3
1 changed files with 8 additions and 7 deletions
|
@ -14,7 +14,7 @@ from datetime import datetime
|
|||
from urllib.request import urlopen, Request
|
||||
|
||||
|
||||
DEFAULT_NIX = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'git/default.nix')
|
||||
DEFAULT_NIX = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'default.nix')
|
||||
|
||||
|
||||
def get_latest_chromium_build():
|
||||
|
@ -43,7 +43,7 @@ def get_current_revision():
|
|||
"""Get the current revision of llvmPackages_git."""
|
||||
with open(DEFAULT_NIX) as f:
|
||||
for line in f:
|
||||
rev = re.search(r'^ rev = "(.*)";', line)
|
||||
rev = re.search(r'^ rev = "(.*)";', line)
|
||||
if rev:
|
||||
return rev.group(1)
|
||||
sys.exit(1)
|
||||
|
@ -75,12 +75,13 @@ hash = nix_prefetch_url(f'https://github.com/llvm/llvm-project/archive/{commit["
|
|||
print('Updating default.nix...')
|
||||
with fileinput.FileInput(DEFAULT_NIX, inplace=True) as f:
|
||||
for line in f:
|
||||
if match := re.search(r'^ rev-version = "unstable-(.+)";', line):
|
||||
if match := re.search(r'^ rev-version = "unstable-(.+)";', line):
|
||||
old_date = match.group(1)
|
||||
result = re.sub(r'^ version = ".+";', f' version = "{release_version}";', line)
|
||||
result = re.sub(r'^ rev = ".*";', f' rev = "{commit["sha"]}";', result)
|
||||
result = re.sub(r'^ rev-version = ".+";', f' rev-version = "{version}";', result)
|
||||
result = re.sub(r'^ sha256 = ".+";', f' sha256 = "{hash}";', result)
|
||||
result = line
|
||||
result = re.sub(r'^ version = ".+";', f' version = "{release_version}";', result)
|
||||
result = re.sub(r'^ rev = ".*";', f' rev = "{commit["sha"]}";', result)
|
||||
result = re.sub(r'^ rev-version = ".+";', f' rev-version = "{version}";', result)
|
||||
result = re.sub(r'^ sha256 = ".+";', f' sha256 = "{hash}";', result)
|
||||
print(result, end='')
|
||||
# Commit the result:
|
||||
commit_message = f"llvmPackages_git: {old_date} -> {date}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue