about summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2023-11-26 00:44:30 +0200
committerTristan Ross <tristan.ross@midstall.com>2024-03-28 00:06:46 -0700
commit0df1dae88b5bb9542dff0ca92a1d026f49c7062b (patch)
tree56c35b31018e339b445a29a465ffae28e4734d12 /pkgs/development/compilers/llvm
parentc6c3e07cfc59e76546a7c27010a2de6704b3931d (diff)
llvm/update-git.py: fix
Works after changing `git/default.nix` to use `gitRelease` instead of `officialRelease`

Wont update the version attr

```
, gitRelease ? {
    version = "15.0.0";
    rev = "a5640968f2f7485b2aa4919f5fa68fd8f23e2d1f";
    rev-version = "unstable-2022-26-07";
    sha256 = "1sh5xihdfdn2hp7ds3lkaq1bfrl4alj36gl1aidmhlw65p5rdvl7";
  }

```
Diffstat (limited to 'pkgs/development/compilers/llvm')
-rwxr-xr-xpkgs/development/compilers/llvm/update-git.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pkgs/development/compilers/llvm/update-git.py b/pkgs/development/compilers/llvm/update-git.py
index b5e900df502bb..9be43e8e1afb9 100755
--- a/pkgs/development/compilers/llvm/update-git.py
+++ b/pkgs/development/compilers/llvm/update-git.py
@@ -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,11 +75,11 @@ 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'^  release_version = ".+";', f'  release_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'^    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)
         print(result, end='')
 # Commit the result: