diff --git a/Admin/cronjob/plain_identify b/Admin/cronjob/plain_identify --- a/Admin/cronjob/plain_identify +++ b/Admin/cronjob/plain_identify @@ -1,50 +1,50 @@ #!/bin/bash # # Plain identify job for Isabelle + AFP # set -e source "$HOME/.bashrc" LANG=C REPOS_DIR="$HOME/cronjob/plain_identify_repos" ISABELLE_REPOS_SOURCE="https://isabelle.sketis.net/repos/isabelle" AFP_REPOS_SOURCE="https://isabelle.sketis.net/repos/afp-devel" function setup_repos () { local NAME="$1" local SOURCE="$2" mkdir -p "$REPOS_DIR" if [ ! -d "$REPOS_DIR/$NAME" ]; then - hg clone --noupdate -q "$SOURCE" "$REPOS_DIR/$NAME" + "${HG:-hg}" clone --noupdate -q "$SOURCE" "$REPOS_DIR/$NAME" fi } function identify_repos () { local NAME="$1" - hg pull -R "$REPOS_DIR/$NAME" -q - local ID="$(hg tip -R "$REPOS_DIR/$NAME" --template "{node|short}")" + "${HG:-hg}" pull -R "$REPOS_DIR/$NAME" -q + local ID="$("${HG:-hg}" tip -R "$REPOS_DIR/$NAME" --template "{node|short}")" echo "$NAME version: $ID" } setup_repos "Isabelle" "$ISABELLE_REPOS_SOURCE" setup_repos "AFP" "$AFP_REPOS_SOURCE" NOW="$(date --rfc-3339=ns)" LOG_DIR="$HOME/cronjob/log/$(date -d "$NOW" "+%Y")" LOG_SECONDS="$(($(date -d "$NOW" +"%s") - $(date -d 'today 00:00:00' "+%s")))" LOG_NAME="plain_identify_$(date -d "$NOW" "+%Y-%m-%d").$(printf "%05d" "$LOG_SECONDS").log" mkdir -p "$LOG_DIR" { echo -n "isabelle_identify: " date -d "$NOW" "+%a %b %-d %H:%M:%S %Z %Y" echo identify_repos "Isabelle" identify_repos "AFP" } > "$LOG_DIR/$LOG_NAME" diff --git a/Admin/cronjob/self_update b/Admin/cronjob/self_update --- a/Admin/cronjob/self_update +++ b/Admin/cronjob/self_update @@ -1,17 +1,17 @@ #!/bin/bash # # self-update of the administrative isabelle repository # # Need to copy this file manually to $HOME/cronjob in order to # avoid overwriting the running self_update by itself! source "$HOME/.bashrc" cd "$HOME/cronjob" mkdir -p run log { - hg -R isabelle pull "https://isabelle.sketis.net/repos/isabelle" || echo "self_update pull failed" >&2 - hg -R isabelle update -C || echo "self_update update failed" >&2 + "${HG:-hg}" -R isabelle pull "https://isabelle.sketis.net/repos/isabelle" || echo "self_update pull failed" >&2 + "${HG:-hg}" -R isabelle update -C || echo "self_update update failed" >&2 isabelle/bin/isabelle components -a 2>&1 || echo "self_update components failed" >&2 } > run/self_update.out diff --git a/Admin/lib/Tools/churn b/Admin/lib/Tools/churn --- a/Admin/lib/Tools/churn +++ b/Admin/lib/Tools/churn @@ -1,12 +1,12 @@ #!/usr/bin/env bash # # Author: Florian Haftmann, TU Muenchen # # DESCRIPTION: mercurial churn statistics for specified aliases file ALIAS="${1:-$ISABELLE_HOME/Admin/user-aliases}" shift cd "$(dirname "$ALIAS")" -hg churn --aliases "$ALIAS" "$@" +"${HG:-hg}" churn --aliases "$ALIAS" "$@" diff --git a/Admin/lib/Tools/churn_pie b/Admin/lib/Tools/churn_pie --- a/Admin/lib/Tools/churn_pie +++ b/Admin/lib/Tools/churn_pie @@ -1,14 +1,14 @@ #!/usr/bin/env bash # # Author: Florian Haftmann, TU Muenchen # # DESCRIPTION: pie chart with Mercurial churn statistics ALIAS="${1:-$ISABELLE_HOME/Admin/user-aliases}" shift SCRIPT="$ISABELLE_HOME/Admin/lib/scripts/churn_pie" cd "$(dirname "$ALIAS")" -hg churn --aliases "$ALIAS" | "$SCRIPT" "$@" +"${HG:-hg}" churn --aliases "$ALIAS" | "$SCRIPT" "$@"