google-cloud-sdk: add passthru.updateScript (#222631)
This commit is contained in:
parent
a9e0513971
commit
1ead2ab094
@ -112,6 +112,7 @@ in stdenv.mkDerivation rec {
|
||||
|
||||
passthru = {
|
||||
inherit components withExtraComponents;
|
||||
updateScript = ./update.sh;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
|
@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p nix
|
||||
#! nix-shell -i bash -p nix jq curl
|
||||
|
||||
CHANNEL_URL="https://dl.google.com/dl/cloudsdk/channels/rapid"
|
||||
BASE_URL="$CHANNEL_URL/downloads/google-cloud-sdk"
|
||||
|
||||
# Version of Google Cloud SDK from
|
||||
# https://cloud.google.com/sdk/docs/release-notes
|
||||
VERSION="426.0.0"
|
||||
PACKAGE_DIR=$(dirname -- "$0")
|
||||
|
||||
VERSION=$(curl "https://storage.googleapis.com/storage/v1/b/cloud-sdk-release/o?delimiter=/&startOffset=google-cloud-sdk-${UPDATE_NIX_OLD_VERSION}&endOffset=google-cloud-sdk-9" | jq --raw-output '.items[-1].name | scan("\\d+\\.\\d+\\.\\d+")')
|
||||
|
||||
function genMainSrc() {
|
||||
local url="${BASE_URL}-${VERSION}-${1}-${2}.tar.gz"
|
||||
@ -45,6 +45,6 @@ EOF
|
||||
echo " };"
|
||||
echo "}"
|
||||
|
||||
} >data.nix
|
||||
} > "${PACKAGE_DIR}/data.nix"
|
||||
|
||||
curl "${CHANNEL_URL}/components-v${VERSION}.json" -w "\n" > components.json
|
||||
curl "${CHANNEL_URL}/components-v${VERSION}.json" -w "\n" > "${PACKAGE_DIR}/components.json"
|
||||
|
Loading…
Reference in New Issue
Block a user