From ad769cce358e726e5d6546c5e87533b852bf5dbd Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 19 Jun 2023 10:33:00 +0200 Subject: [PATCH] Cleanup --- scripts/sync-protobuf.sh | 32 +++++++++++++-------------- src/{COSMOS_ICS_COMMIT => ICS_COMMIT} | 0 2 files changed, 16 insertions(+), 16 deletions(-) rename src/{COSMOS_ICS_COMMIT => ICS_COMMIT} (100%) diff --git a/scripts/sync-protobuf.sh b/scripts/sync-protobuf.sh index f58f23f8..9507c386 100755 --- a/scripts/sync-protobuf.sh +++ b/scripts/sync-protobuf.sh @@ -25,21 +25,21 @@ set -eou pipefail CACHE_PATH="${XDG_CACHE_HOME:-$HOME/.cache}" COSMOS_SDK_GIT="${COSMOS_SDK_GIT:-$CACHE_PATH/cosmos/cosmos-sdk.git}" IBC_GO_GIT="${IBC_GO_GIT:-$CACHE_PATH/ibc-go.git}" -COSMOS_ICS_GIT="${COSMOS_ICS_GIT:-$CACHE_PATH/cosmos/interchain-security.git}" +ICS_GIT="${ICS_GIT:-$CACHE_PATH/cosmos/interchain-security.git}" COSMOS_SDK_COMMIT="$(cat src/COSMOS_SDK_COMMIT)" IBC_GO_COMMIT="$(cat src/IBC_GO_COMMIT)" -COSMOS_ICS_COMMIT="$(cat src/COSMOS_ICS_COMMIT)" +ICS_COMMIT="$(cat src/ICS_COMMIT)" echo "COSMOS_SDK_COMMIT: $COSMOS_SDK_COMMIT" echo "IBC_GO_COMMIT: $IBC_GO_COMMIT" -echo "COSMOS_ICS_COMMIT: $COSMOS_ICS_COMMIT" +echo "ICS_COMMIT: $ICS_COMMIT" # Use either --ics-commit flag for commit ID, # or --ics-tag for git tag. Because we can't modify # proto-compiler to have smart detection on that. -if [[ "$COSMOS_ICS_COMMIT" =~ ^[a-zA-Z0-9]{40}$ ]] +if [[ "$ICS_COMMIT" =~ ^[a-zA-Z0-9]{40}$ ]] then ICS_COMMIT_OPTION="--ics-commit" else @@ -50,12 +50,12 @@ fi # bare git repositories so that no local modification # can be done there. -if [[ ! -e "$COSMOS_ICS_GIT" ]] +if [[ ! -e "$ICS_GIT" ]] then - echo "Cloning interchain-security source code to as bare git repository to $COSMOS_ICS_GIT" - git clone --mirror https://github.com/cosmos/interchain-security.git "$COSMOS_ICS_GIT" + echo "Cloning interchain-security source code to as bare git repository to $ICS_GIT" + git clone --mirror https://github.com/cosmos/interchain-security.git "$ICS_GIT" else - echo "Using existing interchain-security bare git repository at $COSMOS_ICS_GIT" + echo "Using existing interchain-security bare git repository at $ICS_GIT" fi # Use either --sdk-commit flag for commit ID, @@ -91,7 +91,7 @@ fi # Update the repositories using git fetch. This is so that # we keep local copies of the repositories up to sync first. -pushd "$COSMOS_ICS_GIT" +pushd "$ICS_GIT" git fetch popd @@ -107,16 +107,16 @@ popd # actual source files from the bare git repositories. # This is so that we do not accidentally use an unclean # local copy of the source files to generate the protobuf. -COSMOS_ICS_DIR=$(mktemp -d /tmp/interchain-security-XXXXXXXX) +ICS_DIR=$(mktemp -d /tmp/interchain-security-XXXXXXXX) -pushd "$COSMOS_ICS_DIR" -git clone "$COSMOS_ICS_GIT" . -git checkout "$COSMOS_ICS_COMMIT" +pushd "$ICS_DIR" +git clone "$ICS_GIT" . +git checkout "$ICS_COMMIT" # We have to name the commit as a branch because # proto-compiler uses the branch name as the commit # output. Otherwise it will just output HEAD -git checkout -b "$COSMOS_ICS_COMMIT" +git checkout -b "$ICS_COMMIT" cd proto buf mod update @@ -188,12 +188,12 @@ cargo build --locked # and once for no-std version with --build-tonic set to false cargo run --locked -- compile \ - --ics "$COSMOS_ICS_DIR/proto-include" \ + --ics "$ICS_DIR/proto-include" \ --sdk "$COSMOS_SDK_DIR/proto-include" \ --ibc "$IBC_GO_DIR/proto-include" \ --out ../../src/prost # Remove the temporary checkouts of the repositories -rm -rf "$COSMOS_ICS_DIR" +rm -rf "$ICS_DIR" rm -rf "$COSMOS_SDK_DIR" rm -rf "$IBC_GO_DIR" diff --git a/src/COSMOS_ICS_COMMIT b/src/ICS_COMMIT similarity index 100% rename from src/COSMOS_ICS_COMMIT rename to src/ICS_COMMIT