1
0
mirror of synced 2026-01-12 00:42:56 +00:00

Fix Issue #2155 by reordering in the loadup script the component loadups and when their outputs are copied into loadups dir. (#2160)

Fix Issue #2155 (loadup -f -b -x fails can't find full.sysout).  

Reordered loadup so that the sysouts are copied to loadups before loadup-aux and loadup-db are run, and that the product of loadup-aux are copied to loadups before loadup-db is run -- all to make sure that the right prerequisites are available in loadups when needed.  

Also forced a run of loadup-aux if full.sysout is newer than exports.all when -db is specified.
This commit is contained in:
Frank Halasz 2025-06-03 17:25:10 -07:00 committed by GitHub
parent 04d98d232f
commit 38f417907a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 72 additions and 19 deletions

View File

@ -18,6 +18,7 @@ main() {
thinw=false
thinl=false
override_lock=false
ignore_lock=false
while [ "$#" -ne 0 ];
do
case "$1" in
@ -148,7 +149,12 @@ main() {
-ov | -override | --override)
override_lock=true
;;
--ignore_lock)
# internal
ignore_lock=true
;;
--noendmsg)
# internal
noendmsg=true
;;
-z | -man | --man )
@ -284,7 +290,7 @@ main() {
fi
#
# Do individual loadups as requested
# Do individual "stage" loadups as requested
#
if [ "${no_loadups}" = false ]
@ -318,23 +324,11 @@ main() {
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-apps-from-full.sh"
exit_if_failure $? "${noendmsg}"
fi
if [ "${aux}" = true ]
then
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-aux.sh"
exit_if_failure $? "${noendmsg}"
fi
if [ "${db}" = true ]
then
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-db-from-full.sh"
exit_if_failure $? "${noendmsg}"
fi
fi
#
# Done with loadups, successfully. Now copy files into loadups dir from workdir
# Done with "stage" loadups, successfully. Now copy the stages files into loadups dir from workdir
#
if [ "${nocopy}" = false ]
@ -371,7 +365,29 @@ main() {
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/apps.dribble "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
fi
fi
#
# Now do the "after stages" loadups, if required. Do the copies as necessary to meet the dependecies
# of one loadup on another's output.
#
# First aux
if [ "${no_loadups}" = false ]
then
if [ "${aux}" = true ]
then
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-aux.sh"
exit_if_failure $? "${noendmsg}"
fi
fi
if [ "${nocopy}" = false ]
then
if [ "${aux}" = true ]
then
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/whereis.hash "${LOADUP_OUTDIR}" \
@ -383,7 +399,21 @@ main() {
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/exports.dribble "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
fi
fi
# then db, which depends on the output of aux
if [ "${no_loadups}" = false ]
then
if [ "${db}" = true ]
then
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-db-from-full.sh"
exit_if_failure $? "${noendmsg}"
fi
fi
if [ "${nocopy}" = false ]
then
if [ "${db}" = true ]
then
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/fuller.database "${LOADUP_OUTDIR}" \
@ -391,9 +421,12 @@ main() {
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/fuller.dribble "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
fi
fi
#
# OK we're done, exit cleanly
#
echo "+++++ loadup: SUCCESS +++++"
remove_run_lock
exit 0

View File

@ -8,6 +8,13 @@ main() {
loadup_start
SYSOUT="${LOADUP_OUTDIR}/full.sysout"
if [ ! -f "${SYSOUT}" ]
then
output_error_msg "Error: cannot find ${SYSOUT}.${EOL}Exiting."
exit 1
fi
initfile="-"
cat >"${cmfile}" <<-"EOF"
"
@ -33,7 +40,7 @@ main() {
"
EOF
run_medley "${LOADUP_WORKDIR}/full.sysout"
run_medley "${SYSOUT}"
loadup_finish "whereis.hash" "whereis.hash" "exports.all"
}

View File

@ -6,13 +6,21 @@ main() {
loadup_start
SYSOUT="${MEDLEYDIR}/loadups/full.sysout"
if [ ! -f "${SYSOUT}" ];
SYSOUT="${LOADUP_OUTDIR}/full.sysout"
if [ ! -f "${SYSOUT}" ]
then
output_error_msg "Error: cannot find ${SYSOUT}.${EOL}Exiting."
exit 1
fi
# Check to make sure exports.all exists and is newer than full.sysout
# if not, run loadup-aux to create a new exports.all
EXPORTS="${LOADUP_OUTDIR}/exports.all"
if [ ! -f "${EXPORTS}" ] || [ "$(find "${SYSOUT}" -newer "${EXPORTS}" -exec echo true \; )" = true ]
then
"${MEDLEYDIR}"/scripts/loadups/loadup --aux --ignore_lock --noendmsg
fi
initfile="-"
cat >"${cmfile}" <<-"EOF"
"

View File

@ -247,9 +247,13 @@ process_maikodir() {
}
export LOADUP_LOCKFILE="${LOADUP_WORKDIR}"/lock
LOADUP_LOCK=""
override_lock=false
ignore_lock=false
check_run_lock() {
set +x
if [ "${ignore_lock}" = false ]
then
if [ -e "${LOADUP_LOCKFILE}" ]
then
output_warn_msg "Warning: Another loadup is already running with PID $(cat "${LOADUP_LOCKFILE}")"
@ -282,6 +286,7 @@ check_run_lock() {
fi
echo "$$" > "${LOADUP_LOCKFILE}"
LOADUP_LOCK="$$"
fi
}
remove_run_lock() {