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:
@@ -18,6 +18,7 @@ main() {
|
|||||||
thinw=false
|
thinw=false
|
||||||
thinl=false
|
thinl=false
|
||||||
override_lock=false
|
override_lock=false
|
||||||
|
ignore_lock=false
|
||||||
while [ "$#" -ne 0 ];
|
while [ "$#" -ne 0 ];
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -148,7 +149,12 @@ main() {
|
|||||||
-ov | -override | --override)
|
-ov | -override | --override)
|
||||||
override_lock=true
|
override_lock=true
|
||||||
;;
|
;;
|
||||||
|
--ignore_lock)
|
||||||
|
# internal
|
||||||
|
ignore_lock=true
|
||||||
|
;;
|
||||||
--noendmsg)
|
--noendmsg)
|
||||||
|
# internal
|
||||||
noendmsg=true
|
noendmsg=true
|
||||||
;;
|
;;
|
||||||
-z | -man | --man )
|
-z | -man | --man )
|
||||||
@@ -284,7 +290,7 @@ main() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Do individual loadups as requested
|
# Do individual "stage" loadups as requested
|
||||||
#
|
#
|
||||||
|
|
||||||
if [ "${no_loadups}" = false ]
|
if [ "${no_loadups}" = false ]
|
||||||
@@ -318,23 +324,11 @@ main() {
|
|||||||
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-apps-from-full.sh"
|
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-apps-from-full.sh"
|
||||||
exit_if_failure $? "${noendmsg}"
|
exit_if_failure $? "${noendmsg}"
|
||||||
fi
|
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
|
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 ]
|
if [ "${nocopy}" = false ]
|
||||||
@@ -371,7 +365,29 @@ main() {
|
|||||||
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/apps.dribble "${LOADUP_OUTDIR}" \
|
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/apps.dribble "${LOADUP_OUTDIR}" \
|
||||||
| sed -e "s#${MEDLEYDIR}/##g"
|
| sed -e "s#${MEDLEYDIR}/##g"
|
||||||
fi
|
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 ]
|
if [ "${aux}" = true ]
|
||||||
then
|
then
|
||||||
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/whereis.hash "${LOADUP_OUTDIR}" \
|
/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}" \
|
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/exports.dribble "${LOADUP_OUTDIR}" \
|
||||||
| sed -e "s#${MEDLEYDIR}/##g"
|
| sed -e "s#${MEDLEYDIR}/##g"
|
||||||
fi
|
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 ]
|
if [ "${db}" = true ]
|
||||||
then
|
then
|
||||||
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/fuller.database "${LOADUP_OUTDIR}" \
|
/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}" \
|
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/fuller.dribble "${LOADUP_OUTDIR}" \
|
||||||
| sed -e "s#${MEDLEYDIR}/##g"
|
| sed -e "s#${MEDLEYDIR}/##g"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# OK we're done, exit cleanly
|
||||||
|
#
|
||||||
echo "+++++ loadup: SUCCESS +++++"
|
echo "+++++ loadup: SUCCESS +++++"
|
||||||
remove_run_lock
|
remove_run_lock
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -8,6 +8,13 @@ main() {
|
|||||||
|
|
||||||
loadup_start
|
loadup_start
|
||||||
|
|
||||||
|
SYSOUT="${LOADUP_OUTDIR}/full.sysout"
|
||||||
|
if [ ! -f "${SYSOUT}" ]
|
||||||
|
then
|
||||||
|
output_error_msg "Error: cannot find ${SYSOUT}.${EOL}Exiting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
initfile="-"
|
initfile="-"
|
||||||
cat >"${cmfile}" <<-"EOF"
|
cat >"${cmfile}" <<-"EOF"
|
||||||
"
|
"
|
||||||
@@ -33,7 +40,7 @@ main() {
|
|||||||
"
|
"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
run_medley "${LOADUP_WORKDIR}/full.sysout"
|
run_medley "${SYSOUT}"
|
||||||
|
|
||||||
loadup_finish "whereis.hash" "whereis.hash" "exports.all"
|
loadup_finish "whereis.hash" "whereis.hash" "exports.all"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,21 @@ main() {
|
|||||||
|
|
||||||
loadup_start
|
loadup_start
|
||||||
|
|
||||||
SYSOUT="${MEDLEYDIR}/loadups/full.sysout"
|
SYSOUT="${LOADUP_OUTDIR}/full.sysout"
|
||||||
if [ ! -f "${SYSOUT}" ];
|
if [ ! -f "${SYSOUT}" ]
|
||||||
then
|
then
|
||||||
output_error_msg "Error: cannot find ${SYSOUT}.${EOL}Exiting."
|
output_error_msg "Error: cannot find ${SYSOUT}.${EOL}Exiting."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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="-"
|
initfile="-"
|
||||||
cat >"${cmfile}" <<-"EOF"
|
cat >"${cmfile}" <<-"EOF"
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -247,9 +247,13 @@ process_maikodir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export LOADUP_LOCKFILE="${LOADUP_WORKDIR}"/lock
|
export LOADUP_LOCKFILE="${LOADUP_WORKDIR}"/lock
|
||||||
|
LOADUP_LOCK=""
|
||||||
|
override_lock=false
|
||||||
|
ignore_lock=false
|
||||||
|
|
||||||
check_run_lock() {
|
check_run_lock() {
|
||||||
set +x
|
if [ "${ignore_lock}" = false ]
|
||||||
|
then
|
||||||
if [ -e "${LOADUP_LOCKFILE}" ]
|
if [ -e "${LOADUP_LOCKFILE}" ]
|
||||||
then
|
then
|
||||||
output_warn_msg "Warning: Another loadup is already running with PID $(cat "${LOADUP_LOCKFILE}")"
|
output_warn_msg "Warning: Another loadup is already running with PID $(cat "${LOADUP_LOCKFILE}")"
|
||||||
@@ -282,6 +286,7 @@ check_run_lock() {
|
|||||||
fi
|
fi
|
||||||
echo "$$" > "${LOADUP_LOCKFILE}"
|
echo "$$" > "${LOADUP_LOCKFILE}"
|
||||||
LOADUP_LOCK="$$"
|
LOADUP_LOCK="$$"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_run_lock() {
|
remove_run_lock() {
|
||||||
|
|||||||
Reference in New Issue
Block a user