Skip to content

Commit 64bbb7b

Browse files
committed
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.
1 parent 330c5a0 commit 64bbb7b

File tree

4 files changed

+72
-19
lines changed

4 files changed

+72
-19
lines changed

scripts/loadups/loadup

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ main() {
1818
thinw=false
1919
thinl=false
2020
override_lock=false
21+
ignore_lock=false
2122
while [ "$#" -ne 0 ];
2223
do
2324
case "$1" in
@@ -148,7 +149,12 @@ main() {
148149
-ov | -override | --override)
149150
override_lock=true
150151
;;
152+
--ignore_lock)
153+
# internal
154+
ignore_lock=true
155+
;;
151156
--noendmsg)
157+
# internal
152158
noendmsg=true
153159
;;
154160
-z | -man | --man )
@@ -284,7 +290,7 @@ main() {
284290
fi
285291

286292
#
287-
# Do individual loadups as requested
293+
# Do individual "stage" loadups as requested
288294
#
289295

290296
if [ "${no_loadups}" = false ]
@@ -318,23 +324,11 @@ main() {
318324
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-apps-from-full.sh"
319325
exit_if_failure $? "${noendmsg}"
320326
fi
321-
322-
if [ "${aux}" = true ]
323-
then
324-
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-aux.sh"
325-
exit_if_failure $? "${noendmsg}"
326-
fi
327-
328-
if [ "${db}" = true ]
329-
then
330-
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-db-from-full.sh"
331-
exit_if_failure $? "${noendmsg}"
332-
fi
333327
fi
334328

335329

336330
#
337-
# Done with loadups, successfully. Now copy files into loadups dir from workdir
331+
# Done with "stage" loadups, successfully. Now copy the stages files into loadups dir from workdir
338332
#
339333

340334
if [ "${nocopy}" = false ]
@@ -371,7 +365,29 @@ main() {
371365
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/apps.dribble "${LOADUP_OUTDIR}" \
372366
| sed -e "s#${MEDLEYDIR}/##g"
373367
fi
368+
fi
369+
370+
371+
372+
#
373+
# Now do the "after stages" loadups, if required. Do the copies as necessary to meet the dependecies
374+
# of one loadup on another's output.
375+
#
376+
377+
# First aux
378+
379+
if [ "${no_loadups}" = false ]
380+
then
381+
382+
if [ "${aux}" = true ]
383+
then
384+
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-aux.sh"
385+
exit_if_failure $? "${noendmsg}"
386+
fi
387+
fi
374388

389+
if [ "${nocopy}" = false ]
390+
then
375391
if [ "${aux}" = true ]
376392
then
377393
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/whereis.hash "${LOADUP_OUTDIR}" \
@@ -383,17 +399,34 @@ main() {
383399
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/exports.dribble "${LOADUP_OUTDIR}" \
384400
| sed -e "s#${MEDLEYDIR}/##g"
385401
fi
402+
fi
403+
404+
# then db, which depends on the output of aux
405+
406+
if [ "${no_loadups}" = false ]
407+
then
408+
if [ "${db}" = true ]
409+
then
410+
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-db-from-full.sh"
411+
exit_if_failure $? "${noendmsg}"
412+
fi
413+
fi
386414

415+
if [ "${nocopy}" = false ]
416+
then
387417
if [ "${db}" = true ]
388418
then
389419
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/fuller.database "${LOADUP_OUTDIR}" \
390420
| sed -e "s#${MEDLEYDIR}/##g"
391421
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/fuller.dribble "${LOADUP_OUTDIR}" \
392422
| sed -e "s#${MEDLEYDIR}/##g"
393423
fi
394-
395424
fi
396425

426+
427+
#
428+
# OK we're done, exit cleanly
429+
#
397430
echo "+++++ loadup: SUCCESS +++++"
398431
remove_run_lock
399432
exit 0

scripts/loadups/loadup-aux.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ main() {
88

99
loadup_start
1010

11+
SYSOUT="${LOADUP_OUTDIR}/full.sysout"
12+
if [ ! -f "${SYSOUT}" ]
13+
then
14+
output_error_msg "Error: cannot find ${SYSOUT}.${EOL}Exiting."
15+
exit 1
16+
fi
17+
1118
initfile="-"
1219
cat >"${cmfile}" <<-"EOF"
1320
"
@@ -33,7 +40,7 @@ main() {
3340
"
3441
EOF
3542

36-
run_medley "${LOADUP_WORKDIR}/full.sysout"
43+
run_medley "${SYSOUT}"
3744

3845
loadup_finish "whereis.hash" "whereis.hash" "exports.all"
3946
}

scripts/loadups/loadup-db-from-full.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@ main() {
66

77
loadup_start
88

9-
SYSOUT="${MEDLEYDIR}/loadups/full.sysout"
10-
if [ ! -f "${SYSOUT}" ];
9+
SYSOUT="${LOADUP_OUTDIR}/full.sysout"
10+
if [ ! -f "${SYSOUT}" ]
1111
then
1212
output_error_msg "Error: cannot find ${SYSOUT}.${EOL}Exiting."
1313
exit 1
1414
fi
1515

16+
# Check to make sure exports.all exists and is newer than full.sysout
17+
# if not, run loadup-aux to create a new exports.all
18+
EXPORTS="${LOADUP_OUTDIR}/exports.all"
19+
if [ ! -f "${EXPORTS}" ] || [ "$(find "${SYSOUT}" -newer "${EXPORTS}" -exec echo true \; )" = true ]
20+
then
21+
"${MEDLEYDIR}"/scripts/loadups/loadup --aux --ignore_lock --noendmsg
22+
fi
23+
1624
initfile="-"
1725
cat >"${cmfile}" <<-"EOF"
1826
"

scripts/loadups/loadup-setup.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,13 @@ process_maikodir() {
247247
}
248248

249249
export LOADUP_LOCKFILE="${LOADUP_WORKDIR}"/lock
250+
LOADUP_LOCK=""
251+
override_lock=false
252+
ignore_lock=false
250253

251254
check_run_lock() {
252-
set +x
255+
if [ "${ignore_lock}" = false ]
256+
then
253257
if [ -e "${LOADUP_LOCKFILE}" ]
254258
then
255259
output_warn_msg "Warning: Another loadup is already running with PID $(cat "${LOADUP_LOCKFILE}")"
@@ -282,6 +286,7 @@ check_run_lock() {
282286
fi
283287
echo "$$" > "${LOADUP_LOCKFILE}"
284288
LOADUP_LOCK="$$"
289+
fi
285290
}
286291

287292
remove_run_lock() {

0 commit comments

Comments
 (0)