Skip to content

Commit

Permalink
Merge pull request #35 from ZOSOpenTools/add_check_for_setup
Browse files Browse the repository at this point in the history
Add check for ZOPEN_ROOTFS before refreshing zopen
  • Loading branch information
IgorTodorovskiIBM authored Nov 29, 2023
2 parents 5271018 + c0c523b commit 6e25541
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion buildenv
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,37 @@ zopen_install()

zopen_append_to_setup() {
cat <<ZZ
\$PWD/bin/zopen init --refresh
if [ -n "\$ZOPEN_ROOTFS" ] && [ -d "\$ZOPEN_ROOTFS" ] && [ -x "\$PWD/bin/zopen" ]; then
\$PWD/bin/zopen init --refresh
fi
ZZ
}

zopen_pre_terminate() {
# Test setup of meta
set -e
rm -rf $ZOPEN_ROOT/zopen_test
cd $ZOPEN_INSTALL_DIR
unset ZOPEN_ROOTFS
rm -f .installed
. ./.env
zopen init -y $ZOPEN_ROOT/zopen_test
. $ZOPEN_ROOT/zopen_test/etc/zopen-config
rm -rf .installed

# Test refresh on an existing install
timestamp1=$(stat -c %Y "$ZOPEN_ROOT/zopen_test/etc/zopen-config")
. ./.env # runs setup.sh which should now refresh the zopen-config
timestamp2=$(stat -c %Y "$ZOPEN_ROOT/zopen_test/etc/zopen-config")

# zopen-config timestamp should be updated
if [ "$timestamp1" -ge "$timestamp2" ]; then
printError "zopen-config did not get refreshed"
fi
rm -rf $ZOPEN_ROOT/zopen_test
cd -
}

zopen_get_version()
{
version="$(./bin/zopen --version 2>/dev/null)"
Expand Down

0 comments on commit 6e25541

Please sign in to comment.