Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
edk2: fetch submodules manually for 202408
Original submodule sources are no longer available, so the submodules are fetched manually, with unavailable sources replaced by mirrors. (tianocore/edk2#6402) fix #353769 submodules-202408.nix was generated using the following script. #!/usr/bin/env nix-shell #!nix-shell -i bash -p coreutils git jq nixfmt-rfc-style nix-prefetch-git set -eu -o pipefail version=202408 git_remote=origin git_repo=https://github.com/tianocore/edk2 git_rev=refs/tags/edk2-stable$version tmp=$(mktemp -d) trap 'rm -rf -- "$tmp"' EXIT git_dir=$tmp/git git init --bare "$git_dir" git -C "$git_dir" remote add "$git_remote" "$git_repo" git -C "$git_dir" fetch --depth 1 --filter=blob:none "$git_remote" "$git_rev:$git_rev" git -C "$git_dir" show "$git_rev:.gitmodules" > "$tmp/submodules" submodules="{}" for module in $(git config get -f "$tmp/submodules" --all \ --name-only --show-names --regexp '^submodule\.[^.]+\.path$'); do module=${module#submodule.} module=${module%.path} module_path=$(git config get -f "$tmp/submodules" "submodule.$module.path") module_url=$(git config get -f "$tmp/submodules" "submodule.$module.url") module_rev=$(git -C "$git_dir" ls-tree --object-only "$git_rev" "$module_path") # https://github.com/tianocore/edk2/pull/6402/files case $module_url in https://github.com/Zeex/subhook.git) module_url=https://github.com/tianocore/edk2-subhook.git;; esac module_repo=${module_url#https://github.com/} module_repo=${module_repo%.git} module_owner=${module_repo%/*} module_repo=${module_repo#*/} module_hash=$(nix-prefetch-git --fetch-submodules "$module_url" "$module_rev" | jq -r .hash) submodules=$(jq --argjson submodules "$submodules" \ --arg path "$module_path" \ --arg owner "$module_owner" \ --arg repo "$module_repo" \ --arg rev "$module_rev" \ --arg hash "$module_hash" \ -n '$submodules + {$path: {"owner": $owner, "repo": $repo, "rev": $rev, "hash": $hash}}') done echo "$submodules" > "$tmp/result.json" nix eval --impure --expr "builtins.fromJSON (builtins.readFile \"$tmp/result.json\")" | \ nixfmt > submodules-$version.nix
- Loading branch information