5 # Example usage: ./pkgs/development/compilers/llvm/update.sh 12.0.0-rc4
8 readonly VERSION_MAJOR
="${VERSION%%.*}"
9 readonly VERSION_MAIN
="${VERSION%%-*}"
10 declare VERSION_PATCH
="${VERSION/$VERSION_MAIN/}"
11 readonly VERSION_PATCH
="${VERSION_PATCH/-/}"
13 readonly DIR
="pkgs/development/compilers/llvm/$VERSION_MAJOR"
14 readonly FILE
="$DIR/default.nix"
17 -e "s/release_version = \".+\";/release_version = \"$VERSION_MAIN\";/" \
18 -e "s/candidate = \".*\";/candidate = \"$VERSION_PATCH\";/" \
21 readonly ATTRSET
="llvmPackages_$VERSION_MAJOR"
25 "clang-unwrapped.clang-tools-extra_src"
36 for SOURCE
in "${SOURCES[@]}"; do
37 echo "Updating the hash of $SOURCE:"
38 declare ATTR
="$ATTRSET.$SOURCE"
39 declare OLD_HASH
="$(nix eval -f . $ATTR.outputHash)"
40 declare NEW_HASH
="\"$(nix-prefetch-url -A $ATTR)\""
41 find "$DIR" -type f
-exec sed -i "s/$OLD_HASH/$NEW_HASH/" {} +