Correct locate rsync when running as a Snap

This commit is contained in:
Michael Vines
2018-07-02 15:34:13 -07:00
parent 2cbfe41422
commit feb1669d39
5 changed files with 8 additions and 6 deletions

View File

@ -15,8 +15,8 @@ rsync_leader_url=$(rsync_url "$leader")
set -ex set -ex
mkdir -p $SOLANA_CONFIG_DIR mkdir -p $SOLANA_CONFIG_DIR
rsync -vPz "$rsync_leader_url"/config/leader.json $SOLANA_CONFIG_DIR/ $rsync -vPz "$rsync_leader_url"/config/leader.json $SOLANA_CONFIG_DIR/
rsync -vPz "$rsync_leader_url"/config-private/mint.json $SOLANA_CONFIG_DIR/ $rsync -vPz "$rsync_leader_url"/config-private/mint.json $SOLANA_CONFIG_DIR/
# shellcheck disable=SC2086 # $solana_client_demo should not be quoted # shellcheck disable=SC2086 # $solana_client_demo should not be quoted
exec $solana_client_demo \ exec $solana_client_demo \

View File

@ -3,11 +3,13 @@
# Disable complaints about unused variables in this file: # Disable complaints about unused variables in this file:
# shellcheck disable=2034 # shellcheck disable=2034
rsync=rsync
if [[ -d "$SNAP" ]]; then # Running inside a Linux Snap? if [[ -d "$SNAP" ]]; then # Running inside a Linux Snap?
solana_program() { solana_program() {
declare program="$1" declare program="$1"
printf "%s/command-%s.wrapper" "$SNAP" "$program" printf "%s/command-%s.wrapper" "$SNAP" "$program"
} }
rsync="$SNAP"/bin/rsync
SOLANA_CUDA="$(snapctl get enable-cuda)" SOLANA_CUDA="$(snapctl get enable-cuda)"
elif [[ -n "$USE_SNAP" ]]; then # Use the Linux Snap binaries elif [[ -n "$USE_SNAP" ]]; then # Use the Linux Snap binaries

View File

@ -27,8 +27,8 @@ fi
rsync_leader_url=$(rsync_url "$leader") rsync_leader_url=$(rsync_url "$leader")
set -ex set -ex
mkdir -p $SOLANA_CONFIG_DIR mkdir -p $SOLANA_CONFIG_DIR
rsync -vPz "$rsync_leader_url"/config/leader.json $SOLANA_CONFIG_DIR/ $rsync -vPz "$rsync_leader_url"/config/leader.json $SOLANA_CONFIG_DIR/
rsync -vPz "$rsync_leader_url"/config-private/mint.json $SOLANA_CONFIG_DIR/ $rsync -vPz "$rsync_leader_url"/config-private/mint.json $SOLANA_CONFIG_DIR/
# shellcheck disable=SC2086 # $solana_drone should not be quoted # shellcheck disable=SC2086 # $solana_drone should not be quoted
exec $solana_drone \ exec $solana_drone \

View File

@ -68,7 +68,7 @@ rsync_leader_url=$(rsync_url "$leader")
set -ex set -ex
SOLANA_LEADER_CONFIG_DIR="$SOLANA_CONFIG_DIR"/leader-config SOLANA_LEADER_CONFIG_DIR="$SOLANA_CONFIG_DIR"/leader-config
rm -rf "$SOLANA_LEADER_CONFIG_DIR" rm -rf "$SOLANA_LEADER_CONFIG_DIR"
rsync -vPrz "$rsync_leader_url"/config/ "$SOLANA_LEADER_CONFIG_DIR" $rsync -vPrz "$rsync_leader_url"/config/ "$SOLANA_LEADER_CONFIG_DIR"
ls -lh "$SOLANA_LEADER_CONFIG_DIR" ls -lh "$SOLANA_LEADER_CONFIG_DIR"
# shellcheck disable=SC2086 # $program should not be quoted # shellcheck disable=SC2086 # $program should not be quoted

View File

@ -21,7 +21,7 @@ rsync_leader_url=$(rsync_url "$leader")
set -e set -e
mkdir -p $SOLANA_CONFIG_DIR mkdir -p $SOLANA_CONFIG_DIR
if [[ ! -r $SOLANA_CONFIG_DIR/leader.json ]]; then if [[ ! -r $SOLANA_CONFIG_DIR/leader.json ]]; then
rsync -vPz "$rsync_leader_url"/config/leader.json $SOLANA_CONFIG_DIR/ $rsync -vPz "$rsync_leader_url"/config/leader.json $SOLANA_CONFIG_DIR/
fi fi
client_json=$SOLANA_CONFIG_DIR/client.json client_json=$SOLANA_CONFIG_DIR/client.json