diff --git a/site-modules/profile/templates/swh/deploy/loader_opam/opam-manage-shared-state.sh.erb b/site-modules/profile/templates/swh/deploy/loader_opam/opam-manage-shared-state.sh.erb index 96ac262e..8340a4de 100644 --- a/site-modules/profile/templates/swh/deploy/loader_opam/opam-manage-shared-state.sh.erb +++ b/site-modules/profile/templates/swh/deploy/loader_opam/opam-manage-shared-state.sh.erb @@ -1,21 +1,22 @@ #!/usr/bin/env bash # Managed by puppet class profile::swh::deploy::worker::loader_opam # Changes will be overwritten CMD=/usr/bin/opam ROOT_DIR=<%= @opam_root %> +DEFAULT_INSTANCE="opam.ocaml.org" INSTANCE=$1 INSTANCE_URL=$2 -if [ $INSTANCE = "opam" ]; then +if [ $INSTANCE = $DEFAULT_INSTANCE ]; then # Opam instance is considered the main instance so we must initialize the repository # if not present, otherwise we update it ( $CMD repo --all --root $ROOT_DIR | grep $INSTANCE_URL && $CMD update --root $ROOT_DIR ) \ || $CMD init --reinit --bare --no-setup --root $ROOT_DIR $INTSANCE $INSTANCE_URL else # Other instances, if present should be updated. If not present, they should be added # to the main root_dir as extra instances ( $CMD repo --all --root $ROOT_DIR | grep $INSTANCE_URL && $CMD update --root $ROOT_DIR ) \ || $CMD repository add --root $ROOT_DIR $INSTANCE $INSTANCE_URL fi