PDA

View Full Version : Convenience run and update script.



mk128
01-26-2023, 10:55 AM
Any thoughts on including a script to update if needed and run showeq? I suspect many people do this themselves, and if so, it could save duplicate efforts.

Here's mine:



#!/usr/bin/bash
set -e
set -x

SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
cd "${SCRIPT_DIR}"

PID_FILE=.pid
VER_FILE=.ver

[[ -s "${PID_FILE}" ]] && [[ -d "/proc/$(head -n1 ${PID_FILE})" ]] && exit
echo "${BASHPID}" > "${PID_FILE}"

svn up
CUR_VER="$(head -n1 ${VER_FILE})"
FETCH_VER="$(svn info --show-item revision)"

if [ "${CUR_VER}" != "${FETCH_VER}" ]; then
make -f Makefile.dist build
./configure
make
make install
echo "${FETCH_VER}" > "${VER_FILE}"
fi

sudo /usr/local/bin/showeq

rm -f "${PID_FILE}"