Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
base: use RELEASE to determine module paths.
Browse files Browse the repository at this point in the history
Right after being installed, each module adds its own path to the
RELEASE file. Therefore, it is possible to use the RELEASE file as the
source of truth for our dependencies' paths. Since a module cannot be
built without its dependency already built, this does not limit our
installation scripts.

This removes duplication of several module paths, which may now be
changed more easily.

If a non-existent dependency is provided and errexit (-e) bash option is
set, the script will fail during the get_module_path's grep call due to
its non-zero exit code.
henriquesimoes committed Feb 8, 2024
1 parent 12280c9 commit 525753f
Showing 4 changed files with 50 additions and 49 deletions.
13 changes: 11 additions & 2 deletions base/install-functions.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
get_module_path() {
for module in $@; do
if [ -n "$module" ]; then
grep -E "^$module=" $EPICS_RELEASE_FILE
fi
done
}

download_github_module() {
github_org=$1
module_name=$2
@@ -11,10 +19,11 @@ download_github_module() {
install_module() {
module_name=$1
dependency_name=$2
release_content="$3"
release_modules="$3"

cd $module_name
echo "$release_content" > configure/RELEASE
get_module_path "$release_modules" > configure/RELEASE

if [ -n "$NEEDS_TIRPC" ]; then
echo "TIRPC=YES" >> configure/CONFIG_SITE
fi
23 changes: 10 additions & 13 deletions base/install_area_detector.sh
Original file line number Diff line number Diff line change
@@ -29,15 +29,13 @@ ADCORE=${EPICS_MODULES_PATH}/areaDetector/ADCore

echo "$module_releases" >> ${EPICS_RELEASE_FILE}

echo "
EPICS_BASE=${EPICS_BASE_PATH}
$module_releases
ASYN=${EPICS_MODULES_PATH}/asyn
BUSY=${EPICS_MODULES_PATH}/busy
SSCAN=${EPICS_MODULES_PATH}/sscan
get_module_path "
EPICS_BASE
ASYN
BUSY
SSCAN
" > RELEASE.local
echo "$module_releases" >> RELEASE.local

ln -s RELEASE.local RELEASE_PRODS.local
ln -s RELEASE.local RELEASE_LIBS.local
@@ -105,9 +103,8 @@ download_github_module cnpem ssc-pimega $LIBSSCPIMEGA_VERSION
make -C ssc-pimega/c install

install_github_module cnpem NDSSCPimega NDSSCPIMEGA $NDSSCPIMEGA_VERSION "
EPICS_BASE = ${EPICS_BASE_PATH}
ASYN=${EPICS_MODULES_PATH}/asyn
AREA_DETECTOR=${EPICS_MODULES_PATH}/areaDetector
ADCORE=${EPICS_MODULES_PATH}/areaDetector/ADCore
EPICS_BASE
ASYN
AREA_DETECTOR
ADCORE
"
41 changes: 18 additions & 23 deletions base/install_modules.sh
Original file line number Diff line number Diff line change
@@ -5,65 +5,60 @@ set -ex
. /opt/epics/install-functions.sh

install_github_module mdavidsaver pvxs PVXS $PVXS_VERSION "
EPICS_BASE = ${EPICS_BASE_PATH}
EPICS_BASE
"

# Build seq first since it doesn't depend on anything
lnls-get-n-unpack -l "https://static.erico.dev/seq-$SEQUENCER_VERSION.tar.gz"
mv seq-$SEQUENCER_VERSION seq
install_module seq SNCSEQ "
EPICS_BASE = ${EPICS_BASE_PATH}
EPICS_BASE
"

install_github_module epics-modules calc CALC $CALC_VERSION "
EPICS_BASE = ${EPICS_BASE_PATH}
SNCSEQ = ${EPICS_MODULES_PATH}/seq
EPICS_BASE
SNCSEQ
"

# Build asyn without seq since it's only needed for testIPServer
install_github_module epics-modules asyn ASYN $ASYN_VERSION "
EPICS_BASE = ${EPICS_BASE_PATH}
CALC = ${EPICS_MODULES_PATH}/calc
EPICS_BASE
CALC
"

install_github_module paulscherrerinstitute StreamDevice STREAM $STREAMDEVICE_VERSION "
EPICS_BASE = ${EPICS_BASE_PATH}
ASYN = ${EPICS_MODULES_PATH}/asyn
CALC = ${EPICS_MODULES_PATH}/calc
EPICS_BASE
ASYN
CALC
"

install_github_module epics-modules busy BUSY $BUSY_VERSION "
EPICS_BASE = ${EPICS_BASE_PATH}
ASYN = ${EPICS_MODULES_PATH}/asyn
EPICS_BASE
ASYN
"

install_github_module epics-modules autosave AUTOSAVE $AUTOSAVE_VERSION "
EPICS_BASE = ${EPICS_BASE_PATH}
EPICS_BASE
"

install_github_module epics-modules sscan SSCAN $SSCAN_VERSION "
EPICS_BASE = ${EPICS_BASE_PATH}
SNCSEQ = ${EPICS_MODULES_PATH}/seq
EPICS_BASE
SNCSEQ
"

download_github_module ChannelFinder recsync $RECCASTER_VERSION
install_module recsync/client RECCASTER "
EPICS_BASE = ${EPICS_BASE_PATH}
EPICS_BASE
"

install_github_module epics-modules ipac IPAC $IPAC_VERSION "
EPICS_BASE = ${EPICS_BASE_PATH}
EPICS_BASE
"

install_github_module epics-modules caPutLog CAPUTLOG $CAPUTLOG_VERSION "
EPICS_BASE = ${EPICS_BASE_PATH}
EPICS_BASE
"

install_github_module brunoseivam retools RETOOLS $RETOOLS_VERSION "
EPICS_BASE = ${EPICS_BASE_PATH}
EPICS_BASE
"
22 changes: 11 additions & 11 deletions base/install_motor.sh
Original file line number Diff line number Diff line change
@@ -20,12 +20,12 @@ echo "$module_releases" >> ${EPICS_RELEASE_FILE}

cd ../configure

echo "
EPICS_BASE=${EPICS_BASE_PATH}
ASYN=${EPICS_MODULES_PATH}/asyn
SNCSEQ=${EPICS_MODULES_PATH}/seq
BUSY=${EPICS_MODULES_PATH}/busy
IPAC=${EPICS_MODULES_PATH}/ipac
get_module_path "
EPICS_BASE
ASYN
SNCSEQ
BUSY
IPAC
" > RELEASE.local

echo "
@@ -57,9 +57,9 @@ WITH_BOOST = NO
" >> pmac/configure/CONFIG_SITE

JOBS=1 install_module pmac PMAC "
EPICS_BASE=${EPICS_BASE_PATH}
ASYN=${EPICS_MODULES_PATH}/asyn
CALC=${EPICS_MODULES_PATH}/calc
MOTOR=${EPICS_MODULES_PATH}/motor
BUSY=${EPICS_MODULES_PATH}/busy
EPICS_BASE
ASYN
CALC
MOTOR
BUSY
"

0 comments on commit 525753f

Please sign in to comment.