mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 06:26:14 -05:00
feat: generate HIP reports through OpenConnect callbacks
This commit is contained in:
46 files changed
+2511
-1184
No files matched your search
@@ -11,7 +11,7 @@ FLAKE_FILE="$PROJECT_DIR/flake.nix"
|
||||
usage() {
|
||||
echo "Usage: $0 [version] [release-tag]"
|
||||
echo
|
||||
echo "Updates flake.nix fetchurl hashes from the published GitHub release assets."
|
||||
echo "Updates flake.nix prebuilt package hashes from the published GitHub release assets."
|
||||
echo "When version is omitted, the workspace package version from Cargo.toml is used."
|
||||
echo "When release-tag is omitted, v<version> is used. Use snapshot to test snapshot assets."
|
||||
}
|
||||
@@ -79,32 +79,32 @@ release_url() {
|
||||
echo "https://github.com/$REPO/releases/download/$release_tag/$asset"
|
||||
}
|
||||
|
||||
source_hash="$(prefetch_hash "$(release_url "globalprotect-openconnect-$version.tar.gz")")"
|
||||
gpgui_x86_64_hash="$(prefetch_hash "$(release_url "gpgui_x86_64.bin.tar.xz")")"
|
||||
gpgui_aarch64_hash="$(prefetch_hash "$(release_url "gpgui_aarch64.bin.tar.xz")")"
|
||||
binary_x86_64_hash="$(prefetch_hash "$(release_url "globalprotect-openconnect_${version}_x86_64.bin.tar.xz")")"
|
||||
binary_aarch64_hash="$(prefetch_hash "$(release_url "globalprotect-openconnect_${version}_aarch64.bin.tar.xz")")"
|
||||
|
||||
SOURCE_HASH="$source_hash" \
|
||||
GPGUI_X86_64_HASH="$gpgui_x86_64_hash" \
|
||||
GPGUI_AARCH64_HASH="$gpgui_aarch64_hash" \
|
||||
BINARY_X86_64_HASH="$binary_x86_64_hash" \
|
||||
BINARY_AARCH64_HASH="$binary_aarch64_hash" \
|
||||
RELEASE_TAG="$release_tag" \
|
||||
RELEASE_VERSION="$version" \
|
||||
perl -0pi -e '
|
||||
s|(releaseTag = ")[^"]+(";)|$1 . $ENV{"RELEASE_TAG"} . $2|e;
|
||||
s|(url = "https://github\.com/yuezk/GlobalProtect-openconnect/releases/download/\$\{releaseTag\}/globalprotect-openconnect-\$\{version\}\.tar\.gz";\n\s*hash = ")[^"]+(";)|$1 . $ENV{"SOURCE_HASH"} . $2|e;
|
||||
s|(releaseVersion = ")[^"]+(";)|$1 . $ENV{"RELEASE_VERSION"} . $2|e;
|
||||
s|(gpguiHashes = \{\n\s*x86_64 = ")[^"]+(";)|$1 . $ENV{"GPGUI_X86_64_HASH"} . $2|e;
|
||||
s|(gpguiHashes = \{\n\s*x86_64 = "[^"]+";\n\s*aarch64 = ")[^"]+(";)|$1 . $ENV{"GPGUI_AARCH64_HASH"} . $2|e;
|
||||
s|(binaryHashes = \{\n\s*x86_64 = ")[^"]+(";)|$1 . $ENV{"BINARY_X86_64_HASH"} . $2|e;
|
||||
s|(binaryHashes = \{\n\s*x86_64 = "[^"]+";\n\s*aarch64 = ")[^"]+(";)|$1 . $ENV{"BINARY_AARCH64_HASH"} . $2|e;
|
||||
' "$FLAKE_FILE"
|
||||
|
||||
grep -F "$source_hash" "$FLAKE_FILE" > /dev/null
|
||||
grep -F "$gpgui_x86_64_hash" "$FLAKE_FILE" > /dev/null
|
||||
grep -F "$gpgui_aarch64_hash" "$FLAKE_FILE" > /dev/null
|
||||
grep -F "$binary_x86_64_hash" "$FLAKE_FILE" > /dev/null
|
||||
grep -F "$binary_aarch64_hash" "$FLAKE_FILE" > /dev/null
|
||||
grep -F "releaseTag = \"$release_tag\";" "$FLAKE_FILE" > /dev/null
|
||||
|
||||
grep -F "releaseVersion = \"$version\";" "$FLAKE_FILE" > /dev/null
|
||||
|
||||
echo "Updated flake.nix hashes for v$version assets from $release_tag"
|
||||
Reference in new issue
Block a user