Skip to content

Extensive loadup scripts revamp #2111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Apr 26, 2025
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
fca8885
Fixed INTERPRET.REM.CM so that it no longer tries to load the file po…
fghalasz Feb 10, 2025
c45533c
WIP. Updating all loadup scripts to more gracefull handle errors
fghalasz Feb 16, 2025
f2f642f
Update component loadup scripts to take advantage of the fact that IL…
fghalasz Feb 20, 2025
4ac992d
Debugging error exits from loadup-full-from-lisp.sh
fghalasz Feb 22, 2025
f13ea47
1) Major revamp of loadup scripts to better detect and report failure…
fghalasz Mar 10, 2025
5de816c
Merge in latest master
fghalasz Mar 10, 2025
ba9accc
Rename (git mv) scripts/loadup-scripts to be scripts/loadups
fghalasz Mar 10, 2025
b959456
Remove redundant scripts/loadup-setup.sh. Real scripts is in scripts…
fghalasz Mar 10, 2025
8a0e981
Fix symbolic links to point to new scripts/loadups instead of old scr…
fghalasz Mar 10, 2025
6dc5450
Merge branch 'master' into fgh_loadups-25-03
fghalasz Apr 14, 2025
5219400
Resurecting lost changes. WIP on completing man-page.
fghalasz Apr 14, 2025
aad9083
Merge master into fgh_loadups-25-03
fghalasz Apr 16, 2025
3d26c34
Finish complete first pass of new loadup scripts including man page, …
fghalasz Apr 19, 2025
e4acfce
Rearrange loadup script directories; add loadup-*.sh scripts that jus…
fghalasz Apr 19, 2025
33a21f7
Add -thinw, -thinl and -nocopy options to loadup script. Add these t…
fghalasz Apr 19, 2025
62b5183
Fix git handling in loadup-setup. Fix logic of no_loadup flag in loa…
fghalasz Apr 19, 2025
7d8ad18
In loadup -apps now runs aux automatically. Can use -apps- toprevent…
fghalasz Apr 19, 2025
38dde9f
Fix typos on loadup man page
fghalasz Apr 20, 2025
8d0eef4
Oops forgot to publish updated man page before commiting.
fghalasz Apr 20, 2025
36098df
Various minor fixes based on running a loadup scripts thru shellcheck
fghalasz Apr 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ loadups/*.dribble
loadups/whereis.hash
loadups/apps.sysout
loadups/fuller.database
loadups/build/

# manual cross-reference files

79 changes: 61 additions & 18 deletions internal/loadups/LOADUP-APPS
Original file line number Diff line number Diff line change
@@ -1,43 +1,86 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)

(FILECREATED "17-Jan-2023 20:34:02" {DSK}<home>frank>il>medley>gmedley>sources>LOADUP-APPS.;3 2095
(FILECREATED " 9-Mar-2025 20:03:27" {DSK}<home>frank>il>medley>internal>loadups>LOADUP-APPS.;10 3274

:CHANGES-TO (FNS Apps.RemoveBackgroundMenuItem)
:EDIT-BY "frank"

:PREVIOUS-DATE "17-Jan-2023 20:29:39" {DSK}<home>frank>il>medley>gmedley>sources>LOADUP-APPS.;2
:CHANGES-TO (FNS LOADUP-APPS)

:PREVIOUS-DATE " 9-Mar-2025 19:42:36" {DSK}<home>frank>il>medley>internal>loadups>LOADUP-APPS.;8
)


(PRETTYCOMPRINT LOADUP-APPSCOMS)

(RPAQQ LOADUP-APPSCOMS ((GLOBALVARS *ALL-BUTTONS* BackgroundMenuCommands BackgroundMenu)
(FNS Apps.LOADUP Apps.RemoveBackgroundMenuItem)))
(FNS LOADUP-APPS Apps.RemoveBackgroundMenuItem)))
(DECLARE%: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS *ALL-BUTTONS* BackgroundMenuCommands BackgroundMenu)
)
(DEFINEQ

(Apps.LOADUP
[LAMBDA NIL (* ; "Edited 12-Nov-2022 14:03 by FGH")
(PROGN
(* ;; " Delete button(s) that are created when lispusers/BUTTONS is loaded")
(LOADUP-APPS
[LAMBDA NIL (* ; "Edited 9-Mar-2025 20:02 by frank")
(* ; "Edited 2-Jan-2025 20:38 by lmm")
(* ; "Edited 2-Jan-2025 06:30 by larry")

(* ;; "= = = = = = = = = = = = = = = = = =")

(* ;; " Load ROOMS")

(* ;; "")

(DOFILESLOAD `((SYSLOAD SOURCE)
(FROM ,(MEDLEYDIR "ROOMS"))
ROOMS))

(* ;; "======================")

(* ;; " Load Notecards and %"fix up%"")

(* ;; "")

(DOFILESLOAD `((SYSLOAD)
(FROM ,(CONCAT (UNIX-GETENV "NOTECARDSDIR")
"/system"))
NOTECARDS))
(Apps.RemoveBackgroundMenuItem 'NoteCards) (* ; "")
(PUTASSOC 'NOTECARDS (LIST (UNIX-GETENV 'NOTECARDS_COMMIT_ID))
SYSOUTCOMMITS)

(* ;; "======================")

(* ;; " Load CLOS and %"fix up%"")

(* ;; " Assumes that clos/DEFSYS.DFASL has already been loaded (so CLOS: package is defined)")

(* ;; "")

(LOADUP-CLOS)
(CLOS::LOAD-CLOS) (* ; "")
(Apps.RemoveBackgroundMenuItem 'BrowseClass)

(* ;; "= = = = = = = = = = = = = == = = = ")

(for B in *ALL-BUTTONS* do (DELETE-BUTTON B))
(* ;; " Load lispusers/BUTTONS and %"fix up%"")

(* ;; " Remove the BUTTONS BackgroundMenu item")
(* ;; "")

(Apps.RemoveBackgroundMenuItem "Button Control")
(DOFILESLOAD '((SYSLOAD)
BUTTONS))
(Apps.RemoveBackgroundMenuItem "Button Control")
(for B in *ALL-BUTTONS* do (DELETE-BUTTON B))

(* ;; " Remove the NoteCards Background Menu Item")
(* ;; "= = = = = = = = = = = = = == = = = ")

(Apps.RemoveBackgroundMenuItem 'NoteCards)
(* ;; " Do misc")

(* ;; " Remove the CLOS Background Menu Item")
(* ;; "")

(Apps.RemoveBackgroundMenuItem 'BrowseClass)
(RPLACA [CAR (LIST '(A B C]
NIL])
(PUTASSOC 'MEDLEY (LIST (UNIX-GETENV 'LOADUP_COMMIT_ID))
SYSOUTCOMMITS)
(PRINTOUT T "commits-- " SYSOUTCOMMITS T])

(Apps.RemoveBackgroundMenuItem
[LAMBDA (ItemStringOrAtom)
@@ -52,5 +95,5 @@
Apps.SBG])
)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (647 2072 (Apps.LOADUP 657 . 1400) (Apps.RemoveBackgroundMenuItem 1402 . 2070)))))
(FILEMAP (NIL (656 3251 (LOADUP-APPS 666 . 2579) (Apps.RemoveBackgroundMenuItem 2581 . 3249)))))
STOP
Binary file modified internal/loadups/LOADUP-APPS.LCOM
Binary file not shown.
23 changes: 23 additions & 0 deletions internal/loadups/LOADUP-CLOS
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)

(FILECREATED " 9-Mar-2025 19:04:34" {DSK}<home>frank>il>medley>internal>loadups>LOADUP-CLOS.;1 600

:EDIT-BY "frank"

:CHANGES-TO (VARS LOADUP-CLOSCOMS))


(PRETTYCOMPRINT LOADUP-CLOSCOMS)

(RPAQQ LOADUP-CLOSCOMS ((FNS LOADUP-CLOS)))
(DEFINEQ

(LOADUP-CLOS
[LAMBDA NIL (* ; "Edited 9-Mar-2025 18:53 by frank")
(DOFILESLOAD `((SYSLOAD)
(FROM ,(MEDLEYDIR "CLOS"))
DEFSYS])
)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (333 577 (LOADUP-CLOS 343 . 575)))))
STOP
Binary file added internal/loadups/LOADUP-CLOS.LCOM
Binary file not shown.
343 changes: 343 additions & 0 deletions internal/loadups/man-page/loadup.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,343 @@
.\" Automatically generated by Pandoc 3.1.3
.\"
.\" Define V font for inline verbatim, using C font in formats
.\" that render this, and otherwise B font.
.ie "\f[CB]x\f[]"x" \{\
. ftr V B
. ftr VI BI
. ftr VB B
. ftr VBI BI
.\}
.el \{\
. ftr V CR
. ftr VI CI
. ftr VB CB
. ftr VBI CBI
.\}
.ad l
.TH "loadup" "1" "" "" "Run the Medley loadup procedure"
.nh
.SH NAME
.PP
\f[B]loadup\f[R] \[em] runs a loadup procedure for Medley Interlisp
.SH SYNOPSIS
.PP
\f[B]<MEDLEYDIR>/scripts/loadup\f[R] [ options \&...
]
.SH DESCRIPTION
.PP
Runs all or part of the \f[B]loadup\f[R] procedure for Medley Interlisp.
The loadup procedure is used to create the standard sysout files from
which you can start a Medley session as well as other standard files
that are useful in running Medley.
After cloning Medley from GitHub or after making significant changes to
the Medley source, you need to run the loadup procedure to (re)create
these standard files.
.PP
The complete loadup procedure happens in 5 sequential stages with each
stage depending on successful completion of the previous stage.
There are two other non-sequential stages (Aux and DB), which depend
only on the completion of Stage 4 (full.sysout).
.PP
You need not run all 5 stages, depending on what sysout files you need
to create for your work.
The target files created in each stage are copied into a loadups
directory (<MEDLEYDIR>/loadups).
The \f[I]medley\f[R] run script and other Medley tools look for these
files in the loadups directory.
.PP
The 5 sequential stages and their main products are:
.RS
.IP "1." 3
\f[B]Init:\f[R] create an \f[I]init.dlinit\f[R] sysout file.
This init.dlinit file is used internally for Stage 2 and is not copied
into the loadups directory.
.RE
.RS
.IP "2." 3
\f[B]Mid:\f[R] create an \f[I]init-mid.sysout\f[R].
This init-mid.sysout is used only internally for Stage 3 and is not
copied into the loadups directory.
.RE
.RS
.IP "3." 3
\f[B]Lisp:\f[R] create \f[I]lisp.sysout\f[R].
Lisp.sysout has a minimal set of Medley\[cq]s functionality loaded and
can be used as the basis for running a stripped-down Medley session.
Lisp.sysout is copied into the loadups directory.
.RE
.RS
.IP "4." 3
\f[B]Full:\f[R] create \f[I]full.sysout\f[R].
Full.sysout has all of the \[lq]standard\[rq] set of Medley
functionality loaded and is the primary sysout used for running Medley
sessions.
Full.sysout is copied into the loadups directory.
.RE
.RS
.IP "5." 3
\f[B]Apps:\f[R]: create \f[I]apps.sysout\f[R].
Apps.sysout includes everything in full.sysout plus the Medley
applications Buttons, CLOS, Rooms, and Notecards.
.RE
.PP
The two independent stages that can be run if the first 4 sequential
stages complete successfully are:
.RS
.IP \[bu] 2
\f[B]Aux:\f[R]: create the \f[I]whereis.hash\f[R] and
\f[I]exports.all\f[R] files.
These are databases that are commonly used when working on Medley source
code.
They are copied into the loadups directory.
.IP \[bu] 2
\f[B]DB:\f[R]: creates the \f[I]fuller.database\f[R] file.
Fuller.database is a Mastercope database created by analyzing all of the
source code included in full.sysout.
(Stage 4) Fuller.database is copied into the loadups directory.
.RE
.PP
Loadup does all of its work in a work directory
(<MEDLEYDIR>loadups/build).
The target files are copied from this work directory to the loadups
directory if the loadup is successful.
Each stage of the loadup also creates a dribble file containing the
terminal output from within the Medley environment.
These dribble files are not copied to the loadups directory, but remain
available in the work directory after the loadup completes.
.PP
Only one instance (per <MEDLEIDIR>) of loadup can be run at a time.
(The lock file is in the work directory and is named
\f[B]\f[BI]lock\f[B]\f[R].
It can be removed in case of an uncontrolled failure of the loadup
procedure.)
.PP
Note: \f[B]MEDLEYDIR\f[R] is an environment variable set by the loadup
script.
It is set to the top level directory of the Medley installation that
contains the specific loadup script that is invoked after all symbolic
links are resolved.
In the standard global installation this will be
/usr/local/interlisp/medley.
But Medley can be installed in multiple places on any given machine and
hence MEDLEYDIR is computed on each invocation of loadup.
.SH OPTIONS
.TP
\f[B]-z, --man, -man\f[R]
Print this manual page on the screen.
.TP
\f[B]-t STAGE, --target STAGE, -target STAGE\f[R]
Run the sequential loadup procedure until the STAGE is complete,
starting from the files created by the previously run STAGE specified in
the \[en]start option.
.RS
.PP
STAGE can be one of the following:
.RE
.RS
.RS
.PP
i, init, 1: Run the loadup sequence through Stage 1 (init.dlinit).
Init.dlinit is \f[I]not\f[R] copied into the loadups directory.
.RE
.RE
.RS
.RS
.PP
m, mid, 2: Run the loadup sequence through Stage 2 (init-mid.sysout).
Init-mid.sysout is \f[I]not\f[R] copied into the loadups directory.
.RE
.RE
.RS
.RS
.PP
l, lisp, 3: Run the loadup sequence through Stage 3 (lisp.sysout).
Lisp.sysout is copied into the loadups directory.
.RE
.RE
.RS
.RS
.PP
f, full, 4: Run the loadup sequence through Stage 4 (full.sysout).
Full.sysout is copied into the loadups directory.
.RE
.RE
.RS
.RS
.PP
a, apps, 5: Run the loadup sequence through Stage 5 (apps.sysout).
Also run the Aux stage as if \[en]aux option had been specified.
Apps.sysout and the Aux files are copied into the loadups directory.
.RE
.RE
.RS
.RS
.PP
a-, apps-, 5-: Run the loadup sequence through Stage 5 (apps.sysout).
The Aux stage is not run unless otherwise specified.
Apps.sysout is copied into the loadups directory.
Also run the Aux stage as if \[en]aux option had been specified.
.RE
.RE
.TP
\f[B]-s STAGE --start STAGE, -start STAGE\f[R]
Start the loadup process using the files previously created by STAGE.
These files are looked for first in the loadups directory or, if not
found there, in the work directory.
It is an error if the files created by STAGE cannot be found.
.RS
.PP
STAGE can be one of the following:
.RE
.RS
.RS
.PP
s, scratch, 0 : Start the loadup process from the beginning.
This is the default.
.RE
.RE
.RS
.RS
.PP
i, init, 1 : Start the loadup process using the files created by Stage 1
(init.dlinit).
.RE
.RE
.RS
.RS
.PP
m, mid, 2 : Start the loadup process using the files created by Stage 2
(init-mid.sysout).
.RE
.RE
.RS
.RS
.PP
l, lisp, 3 : Start the loadup process using the files created by Stage 3
(lisp.sysout)
.RE
.RE
.RS
.RS
.PP
f, full, 4 : Start the loadup process using the files created by Stage 4
(full.sysout).
.RE
.RE
.TP
\f[B]-x, --aux, -aux\f[R]
Run the Aux loadup stage, creating the \f[I]whereis.hash\f[R] and
\f[I]exports.all\f[R] files.
If loadup completes successfully, these files are copied into loadups.
.TP
\f[B]-b, --db, -db\f[R]
Run the DB loadup stage, creating the \f[I]fuller.database\f[R] file.
If this stage complete successfully, these files are copied into
loadups.
.TP
\f[B]-i, --init, -init, -1\f[R]
Synonym for \[lq]\[en]target init\[rq]
.TP
\f[B]-m, --mid, -mid, -2\f[R]
Synonym for \[lq]\[en]target mid\[rq]
.TP
\f[B]-l, --lisp, -lisp, -3\f[R]
Synonym for \[lq]\[en]target lisp\[rq]
.TP
\f[B]-f, --full. -full, -4\f[R]
Synonym for \[lq]\[en]target full\[rq]
.TP
\f[B]-a, --apps, -apps, -5\f[R]
Synonym for \[lq]\[en]target apps\[rq]
.TP
\f[B]-a-, --apps-, -apps-, -5-\f[R]
Synonym for \[lq]\[en]target apps\[rq]
.TP
\f[B]-nc, --nocopy, -nocopy\f[R]
Run the specified loadups, but do not copy results into loadups
directory.
.TP
\f[B]-tw, --thinw, -thinw\f[R]
Before running loadups (if any), thin the working directory by deleting
all versioned (\f[I].\[ti][0-9]\f[R]\[ti]) files.
.TP
\f[B]-tl, --thinl, -thinl\f[R]
Before running loadups (if any), thin the loadups directory by deleting
all versioned (\f[I].\[ti][0-9]\f[R]\[ti]) files.
.TP
\f[B]-d DIR --maikodir DIR, -maikodir DIR\f[R]
Use DIR as the directory from which to execute lde (Miko) when running
Medley in the loadup process.
If this flag is not present, the value of the environment variable
MAIKODIR will be used instead.
And if MAIKODIR does not exist, then the default Maiko directory search
within Medley will be used.
.SH DEFAULTS
.PP
The defaults for the Options context-dependent and somewhat complicated
due to the goal of maintaining compatibility with legacy loadup scripts.
All of the following defaults rules hold independent of the
\[en]maikodir (-d) option.
.IP "1." 3
If none of \[en]target, \[en]start, \[en]aux, and \[en]db are specified,
then:
.RS
.PP
1A.
If neither \[en]thinw nor \[en]thinl are specified, the options default
to:
.RE
.RS
.RS
.PP
\f[B]\[en]target full \[en]start 0 \[en]aux\f[R]
.RE
.RE
.RS
.PP
1B.
If either \[en]thinw or \[en]thinl are specified, no loadups are run.
.RE
.IP "2." 3
If neither \[en]start nor \[en]target are specified but either -aux or
-db or both are, then \[en]start defaults to \f[I]full\f[R] and
\[en]target is irrelevant.
.IP "3." 3
If \[en]start is specified and \[en]target is not, then \[en]target
defaults to \f[I]full\f[R]
.IP "4." 3
If \[en]target is specified and \[en]start is not, then \[en]start
defaults to \f[I]0\f[R]
.SH EXAMPLES
.PP
\f[B]./loadup -full -s lisp\f[R] : run loadup thru Stage 4 (full.sysout)
starting from existing Stage 3 outputs (lisp.sysout).
.PP
\f[B]./loadup --target full --start lisp\f[R] : run loadup thru Stage 4
(full.sysout) starting from existing Stage 3 outputs (lisp.sysout).
.PP
\f[B]./loadup -5 \[en]aux\f[R] : run loadup from the beginning thru
Stage 5 (apps.sysout) then run the Aux \[lq]stage\[rq] to create
\f[I]whereis.hash\f[R] and \f[I]exports.all\f[R]
.PP
\f[B]./loadup -db\f[R] : just run the DB \[lq]stage\[rq] starting from
an existing full.sysout; do not run any of the sequential stages.
.PP
\f[B]./loadup \[en]maikodir \[ti]/il/newmaiko\f[R] : run loadup sequence
from beginning to full plus the loadup Aux stage, while using
\f[I]\[ti]/il/newmaiko\f[R] as the location for the lde executables when
running Medley.
.PP
\f[B]./loadup -full\f[R] : run loadup sequence from beginning thru full
.PP
\f[B]./loadup -apps\f[R] : run loadup sequence from beginning thru app.
Also run the Aux stage loadup.
.PP
\f[B]./loadup -apps-\f[R] : run loadup sequence from beginning thru app.
Do not run the Aux stage loadup.
.SH BUGS
.PP
See GitHub Issues: <https://github.com/Interlisp/medley/issues>
.SH COPYRIGHT
.PP
Copyright(c) 2025 by Interlisp.org
Binary file added internal/loadups/man-page/loadup.1.gz
Binary file not shown.
179 changes: 179 additions & 0 deletions internal/loadups/man-page/loadup.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
% loadup(1) | Run the Medley loadup procedure

---
adjusting: l
hyphenate: false
---

NAME
====

**loadup** — runs a loadup procedure for Medley Interlisp

SYNOPSIS
========

**\<MEDLEYDIR>/scripts/loadup** \[ options ... ]


DESCRIPTION
===========

Runs all or part of the **loadup** procedure for Medley Interlisp. The loadup procedure is used to create the standard sysout files from which you can start a Medley session as well as other standard files that are useful in running Medley. After cloning Medley from GitHub or after making significant changes to the Medley source, you need to run the loadup procedure to (re)create these standard files.

The complete loadup procedure happens in 5 sequential stages with each stage depending on successful completion
of the previous stage. There are two other non-sequential stages (Aux and DB), which depend only on the completion
of Stage 4 (full.sysout).

You need not run all 5 stages, depending on what sysout files you need to create for your work.
The target files created in each stage are copied into a loadups directory (\<MEDLEYDIR>/loadups).
The *medley* run script and other Medley tools look for these files in the loadups directory.

The 5 sequential stages and their main products are:

>1. **Init:** create an *init.dlinit* sysout file. This init.dlinit file is used internally for Stage 2 and is not copied into the loadups directory.
>2. **Mid:** create an *init-mid.sysout*. This init-mid.sysout is used only internally for Stage 3 and is not copied into the loadups directory.
>3. **Lisp:** create *lisp.sysout*. Lisp.sysout has a minimal set of Medley's functionality loaded and can be used as the basis for running a stripped-down Medley session. Lisp.sysout is copied into the loadups directory.
>4. **Full:** create *full.sysout*. Full.sysout has all of the "standard" set of Medley functionality loaded and is the primary sysout used for running Medley sessions. Full.sysout is copied into the loadups directory.
>5. **Apps:**: create *apps.sysout*. Apps.sysout includes everything in full.sysout plus the Medley applications Buttons, CLOS, Rooms, and Notecards.

The two independent stages that can be run if the first 4 sequential stages complete successfully are:

>+ **Aux:**: create the *whereis.hash* and *exports.all* files. These are databases that are commonly used when working on Medley source code. They are copied into the loadups directory.
>+ **DB:**: creates the *fuller.database* file. Fuller.database is a Mastercope database created by analyzing all of the source code included in full.sysout. (Stage 4) Fuller.database is copied into the loadups directory.

Loadup does all of its work in a work directory (\<MEDLEYDIR>loadups/build). The target files are copied from this work directory to the loadups directory if the loadup is successful. Each stage of the loadup also creates a dribble file containing the terminal output from within the Medley environment. These dribble files are not copied to the loadups directory, but remain available in the work directory after the loadup completes.


Only one instance (per \<MEDLEIDIR>) of loadup can be run at a time. (The lock file is in the work directory and is named ***lock***. It can be removed in case of an uncontrolled failure of the loadup procedure.)

Note: **MEDLEYDIR** is an environment variable set by the loadup script. It is set to the top level directory of the Medley installation that contains the specific loadup script that
is invoked after all symbolic links are resolved. In the standard global installation this will
be /usr/local/interlisp/medley. But Medley can be installed in multiple places on any given machine and
hence MEDLEYDIR is computed on each invocation of loadup.

OPTIONS
=======
**-z, \-\-man, \-man**
: Print this manual page on the screen.

**-t STAGE, \-\-target STAGE, -target STAGE**
: Run the sequential loadup procedure until the STAGE is complete, starting from the files created by the previously run STAGE specified in the --start option.

>STAGE can be one of the following:
>>i, init, 1: Run the loadup sequence through Stage 1 (init.dlinit). Init.dlinit is *not* copied into the loadups directory.
>>m, mid, 2: Run the loadup sequence through Stage 2 (init-mid.sysout). Init-mid.sysout is *not* copied into the loadups directory.
>>l, lisp, 3: Run the loadup sequence through Stage 3 (lisp.sysout). Lisp.sysout is copied into the loadups directory.
>>f, full, 4: Run the loadup sequence through Stage 4 (full.sysout). Full.sysout is copied into the loadups directory.
>>a, apps, 5: Run the loadup sequence through Stage 5 (apps.sysout). Also run the Aux stage as if --aux option had been specified. Apps.sysout and the Aux files are copied into the loadups directory.
>>a-, apps-, 5-: Run the loadup sequence through Stage 5 (apps.sysout). The Aux stage is not run unless otherwise specified. Apps.sysout is copied into the loadups directory. Also run the Aux stage as if --aux option had been specified.

**-s STAGE \-\-start STAGE, -start STAGE**
: Start the loadup process using the files previously created by STAGE. These files are looked for first in the loadups directory or, if not found there, in the work directory. It is an error if the files created by STAGE cannot be found.

>STAGE can be one of the following:
>>s, scratch, 0 : Start the loadup process from the beginning. This is the default.
>> i, init, 1 : Start the loadup process using the files created by Stage 1 (init.dlinit).
>>m, mid, 2 : Start the loadup process using the files created by Stage 2 (init-mid.sysout).
>>l, lisp, 3 : Start the loadup process using the files created by Stage 3 (lisp.sysout)
>>f, full, 4 : Start the loadup process using the files created by Stage 4 (full.sysout).
**-x, \-\-aux, -aux**
: Run the Aux loadup stage, creating the *whereis.hash* and *exports.all* files. If loadup completes successfully, these files are copied into loadups.

**-b, \-\-db, \-db**
: Run the DB loadup stage, creating the *fuller.database* file. If this stage complete successfully, these files are copied into loadups.

**-i, \-\-init, -init, -1**
: Synonym for "--target init"

**-m, \-\-mid, -mid, -2**
: Synonym for "--target mid"

**-l, \-\-lisp, -lisp, -3**
: Synonym for "--target lisp"

**-f, \-\-full. -full, -4**
: Synonym for "--target full"

**-a, \-\-apps, -apps, -5**
: Synonym for "--target apps"

**-a-, \-\-apps-, -apps-, -5-**
: Synonym for "--target apps"

**-nc, \-\-nocopy, -nocopy**
: Run the specified loadups, but do not copy results into loadups directory.

**-tw, \-\-thinw, -thinw**
: Before running loadups (if any), thin the working directory by deleting all versioned (*.~[0-9]*~) files.

**-tl, \-\-thinl, -thinl**
: Before running loadups (if any), thin the loadups directory by deleting all versioned (*.~[0-9]*~) files.

**-d DIR \-\-maikodir DIR, -maikodir DIR**
: Use DIR as the directory from which to execute lde (Miko) when running Medley in the loadup process. If this flag is not present, the value of the environment variable MAIKODIR will be used instead. And if MAIKODIR does not exist, then the default Maiko directory search within Medley will be used.

DEFAULTS
====
The defaults for the Options context-dependent and somewhat complicated due to the goal of maintaining compatibility with legacy loadup scripts. All of the following defaults rules hold independent of the --maikodir (-d) option.

1. If none of --target, --start, --aux, and --db are specified, then:

>1A. If neither --thinw nor --thinl are specified, the options default to:
>> **--target full --start 0 --aux**
>1B. If either --thinw or --thinl are specified, no loadups are run.
2. If neither --start nor --target are specified but either -aux or -db or both are, then --start defaults to *full* and --target is irrelevant.

3. If --start is specified and --target is not, then --target defaults to *full*

4. If --target is specified and --start is not, then --start defaults to *0*

EXAMPLES
====
**./loadup -full -s lisp** : run loadup thru Stage 4 (full.sysout) starting from existing Stage 3 outputs (lisp.sysout).

**./loadup \-\-target full \-\-start lisp** : run loadup thru Stage 4 (full.sysout) starting from existing Stage 3 outputs (lisp.sysout).

**./loadup -5 --aux** : run loadup from the beginning thru Stage 5 (apps.sysout) then run the Aux "stage" to create *whereis.hash* and *exports.all*

**./loadup -db** : just run the DB "stage" starting from an existing full.sysout; do not run any of the sequential stages.

**./loadup --maikodir ~/il/newmaiko** : run loadup sequence from beginning to full plus the loadup Aux stage, while using *~/il/newmaiko* as the location for the lde executables when running Medley.

**./loadup -full** : run loadup sequence from beginning thru full

**./loadup -apps** : run loadup sequence from beginning thru app. Also run the Aux stage loadup.

**./loadup -apps-** : run loadup sequence from beginning thru app. Do not run the Aux stage loadup.

BUGS
====

See GitHub Issues: <https://github.com/Interlisp/medley/issues>

COPYRIGHT
=========

Copyright(c) 2025 by Interlisp.org
2 changes: 2 additions & 0 deletions internal/loadups/man-page/man2html.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
pandoc --from man --to html < loadup.1 > man_loadup.html
269 changes: 269 additions & 0 deletions internal/loadups/man-page/man_loadup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
<h1>NAME</h1>
<p><strong>loadup</strong> — runs a loadup procedure for Medley
Interlisp</p>
<h1>SYNOPSIS</h1>
<p><strong>&lt;MEDLEYDIR&gt;/scripts/loadup</strong> [ options ... ]</p>
<h1>DESCRIPTION</h1>
<p>Runs all or part of the <strong>loadup</strong> procedure for Medley
Interlisp. The loadup procedure is used to create the standard sysout
files from which you can start a Medley session as well as other
standard files that are useful in running Medley. After cloning Medley
from GitHub or after making significant changes to the Medley source,
you need to run the loadup procedure to (re)create these standard
files.</p>
<p>The complete loadup procedure happens in 5 sequential stages with
each stage depending on successful completion of the previous stage.
There are two other non-sequential stages (Aux and DB), which depend
only on the completion of Stage 4 (full.sysout).</p>
<p>You need not run all 5 stages, depending on what sysout files you
need to create for your work. The target files created in each stage are
copied into a loadups directory (&lt;MEDLEYDIR&gt;/loadups). The
<em>medley</em> run script and other Medley tools look for these files
in the loadups directory.</p>
<p>The 5 sequential stages and their main products are:</p>
<blockquote>
<ol type="1">
<li><p><strong>Init:</strong> create an <em>init.dlinit</em> sysout
file. This init.dlinit file is used internally for Stage 2 and is not
copied into the loadups directory.</p></li>
</ol>
</blockquote>
<blockquote>
<ol start="2" type="1">
<li><p><strong>Mid:</strong> create an <em>init-mid.sysout</em>. This
init-mid.sysout is used only internally for Stage 3 and is not copied
into the loadups directory.</p></li>
</ol>
</blockquote>
<blockquote>
<ol start="3" type="1">
<li><p><strong>Lisp:</strong> create <em>lisp.sysout</em>. Lisp.sysout
has a minimal set of Medley’s functionality loaded and can be used as
the basis for running a stripped-down Medley session. Lisp.sysout is
copied into the loadups directory.</p></li>
</ol>
</blockquote>
<blockquote>
<ol start="4" type="1">
<li><p><strong>Full:</strong> create <em>full.sysout</em>. Full.sysout
has all of the “standard” set of Medley functionality loaded and is the
primary sysout used for running Medley sessions. Full.sysout is copied
into the loadups directory.</p></li>
</ol>
</blockquote>
<blockquote>
<ol start="5" type="1">
<li><p><strong>Apps:</strong>: create <em>apps.sysout</em>. Apps.sysout
includes everything in full.sysout plus the Medley applications Buttons,
CLOS, Rooms, and Notecards.</p></li>
</ol>
</blockquote>
<p>The two independent stages that can be run if the first 4 sequential
stages complete successfully are:</p>
<blockquote>
<ul>
<li><p><strong>Aux:</strong>: create the <em>whereis.hash</em> and
<em>exports.all</em> files. These are databases that are commonly used
when working on Medley source code. They are copied into the loadups
directory.</p></li>
<li><p><strong>DB:</strong>: creates the <em>fuller.database</em> file.
Fuller.database is a Mastercope database created by analyzing all of the
source code included in full.sysout. (Stage 4) Fuller.database is copied
into the loadups directory.</p></li>
</ul>
</blockquote>
<p>Loadup does all of its work in a work directory
(&lt;MEDLEYDIR&gt;loadups/build). The target files are copied from this
work directory to the loadups directory if the loadup is successful.
Each stage of the loadup also creates a dribble file containing the
terminal output from within the Medley environment. These dribble files
are not copied to the loadups directory, but remain available in the
work directory after the loadup completes.</p>
<p>Only one instance (per &lt;MEDLEIDIR&gt;) of loadup can be run at a
time. (The lock file is in the work directory and is named
<strong><em>lock</em></strong>. It can be removed in case of an
uncontrolled failure of the loadup procedure.)</p>
<p>Note: <strong>MEDLEYDIR</strong> is an environment variable set by
the loadup script. It is set to the top level directory of the Medley
installation that contains the specific loadup script that is invoked
after all symbolic links are resolved. In the standard global
installation this will be /usr/local/interlisp/medley. But Medley can be
installed in multiple places on any given machine and hence MEDLEYDIR is
computed on each invocation of loadup.</p>
<h1>OPTIONS</h1>
<dl>
<dt><strong>-z, --man, -man</strong></dt>
<dd>
<p>Print this manual page on the screen.</p>
</dd>
<dt><strong>-t STAGE, --target STAGE, -target STAGE</strong></dt>
<dd>
<p>Run the sequential loadup procedure until the STAGE is complete,
starting from the files created by the previously run STAGE specified in
the –start option.</p>
<p>STAGE can be one of the following:</p>
<blockquote>
<p>i, init, 1: Run the loadup sequence through Stage 1 (init.dlinit).
Init.dlinit is <em>not</em> copied into the loadups directory.</p>
</blockquote>
<blockquote>
<p>m, mid, 2: Run the loadup sequence through Stage 2 (init-mid.sysout).
Init-mid.sysout is <em>not</em> copied into the loadups directory.</p>
</blockquote>
<blockquote>
<p>l, lisp, 3: Run the loadup sequence through Stage 3 (lisp.sysout).
Lisp.sysout is copied into the loadups directory.</p>
</blockquote>
<blockquote>
<p>f, full, 4: Run the loadup sequence through Stage 4 (full.sysout).
Full.sysout is copied into the loadups directory.</p>
</blockquote>
<blockquote>
<p>a, apps, 5: Run the loadup sequence through Stage 5 (apps.sysout).
Also run the Aux stage as if –aux option had been specified. Apps.sysout
and the Aux files are copied into the loadups directory.</p>
</blockquote>
<blockquote>
<p>a-, apps-, 5-: Run the loadup sequence through Stage 5 (apps.sysout).
The Aux stage is not run unless otherwise specified. Apps.sysout is
copied into the loadups directory. Also run the Aux stage as if –aux
option had been specified.</p>
</blockquote>
</dd>
<dt><strong>-s STAGE --start STAGE, -start STAGE</strong></dt>
<dd>
<p>Start the loadup process using the files previously created by STAGE.
These files are looked for first in the loadups directory or, if not
found there, in the work directory. It is an error if the files created
by STAGE cannot be found.</p>
<p>STAGE can be one of the following:</p>
<blockquote>
<p>s, scratch, 0 : Start the loadup process from the beginning. This is
the default.</p>
</blockquote>
<blockquote>
<p>i, init, 1 : Start the loadup process using the files created by
Stage 1 (init.dlinit).</p>
</blockquote>
<blockquote>
<p>m, mid, 2 : Start the loadup process using the files created by Stage
2 (init-mid.sysout).</p>
</blockquote>
<blockquote>
<p>l, lisp, 3 : Start the loadup process using the files created by
Stage 3 (lisp.sysout)</p>
</blockquote>
<blockquote>
<p>f, full, 4 : Start the loadup process using the files created by
Stage 4 (full.sysout).</p>
</blockquote>
</dd>
<dt><strong>-x, --aux, -aux</strong></dt>
<dd>
<p>Run the Aux loadup stage, creating the <em>whereis.hash</em> and
<em>exports.all</em> files. If loadup completes successfully, these
files are copied into loadups.</p>
</dd>
<dt><strong>-b, --db, -db</strong></dt>
<dd>
<p>Run the DB loadup stage, creating the <em>fuller.database</em> file.
If this stage complete successfully, these files are copied into
loadups.</p>
</dd>
<dt><strong>-i, --init, -init, -1</strong></dt>
<dd>
<p>Synonym for “–target init”</p>
</dd>
<dt><strong>-m, --mid, -mid, -2</strong></dt>
<dd>
<p>Synonym for “–target mid”</p>
</dd>
<dt><strong>-l, --lisp, -lisp, -3</strong></dt>
<dd>
<p>Synonym for “–target lisp”</p>
</dd>
<dt><strong>-f, --full. -full, -4</strong></dt>
<dd>
<p>Synonym for “–target full”</p>
</dd>
<dt><strong>-a, --apps, -apps, -5</strong></dt>
<dd>
<p>Synonym for “–target apps”</p>
</dd>
<dt><strong>-a-, --apps-, -apps-, -5-</strong></dt>
<dd>
<p>Synonym for “–target apps”</p>
</dd>
<dt><strong>-nc, --nocopy, -nocopy</strong></dt>
<dd>
<p>Run the specified loadups, but do not copy results into loadups
directory.</p>
</dd>
<dt><strong>-tw, --thinw, -thinw</strong></dt>
<dd>
<p>Before running loadups (if any), thin the working directory by
deleting all versioned (<em>.~[0-9]</em>~) files.</p>
</dd>
<dt><strong>-tl, --thinl, -thinl</strong></dt>
<dd>
<p>Before running loadups (if any), thin the loadups directory by
deleting all versioned (<em>.~[0-9]</em>~) files.</p>
</dd>
<dt><strong>-d DIR --maikodir DIR, -maikodir DIR</strong></dt>
<dd>
<p>Use DIR as the directory from which to execute lde (Miko) when
running Medley in the loadup process. If this flag is not present, the
value of the environment variable MAIKODIR will be used instead. And if
MAIKODIR does not exist, then the default Maiko directory search within
Medley will be used.</p>
</dd>
</dl>
<h1>DEFAULTS</h1>
<p>The defaults for the Options context-dependent and somewhat
complicated due to the goal of maintaining compatibility with legacy
loadup scripts. All of the following defaults rules hold independent of
the –maikodir (-d) option.</p>
<ol type="1">
<li><p>If none of –target, –start, –aux, and –db are specified,
then:</p>
<p>1A. If neither –thinw nor –thinl are specified, the options default
to:</p>
<blockquote>
<p><strong>–target full –start 0 –aux</strong></p>
</blockquote>
<p>1B. If either –thinw or –thinl are specified, no loadups are
run.</p></li>
<li><p>If neither –start nor –target are specified but either -aux or
-db or both are, then –start defaults to <em>full</em> and –target is
irrelevant.</p></li>
<li><p>If –start is specified and –target is not, then –target defaults
to <em>full</em></p></li>
<li><p>If –target is specified and –start is not, then –start defaults
to <em>0</em></p></li>
</ol>
<h1>EXAMPLES</h1>
<p><strong>./loadup -full -s lisp</strong> : run loadup thru Stage 4
(full.sysout) starting from existing Stage 3 outputs (lisp.sysout).</p>
<p><strong>./loadup --target full --start lisp</strong> : run loadup
thru Stage 4 (full.sysout) starting from existing Stage 3 outputs
(lisp.sysout).</p>
<p><strong>./loadup -5 –aux</strong> : run loadup from the beginning
thru Stage 5 (apps.sysout) then run the Aux “stage” to create
<em>whereis.hash</em> and <em>exports.all</em></p>
<p><strong>./loadup -db</strong> : just run the DB “stage” starting from
an existing full.sysout; do not run any of the sequential stages.</p>
<p><strong>./loadup –maikodir ~/il/newmaiko</strong> : run loadup
sequence from beginning to full plus the loadup Aux stage, while using
<em>~/il/newmaiko</em> as the location for the lde executables when
running Medley.</p>
<p><strong>./loadup -full</strong> : run loadup sequence from beginning
thru full</p>
<p><strong>./loadup -apps</strong> : run loadup sequence from beginning
thru app. Also run the Aux stage loadup.</p>
<p><strong>./loadup -apps-</strong> : run loadup sequence from beginning
thru app. Do not run the Aux stage loadup.</p>
<h1>BUGS</h1>
<p>See GitHub Issues:
&lt;https://github.com/Interlisp/medley/issues&gt;</p>
<h1>COPYRIGHT</h1>
<p>Copyright(c) 2025 by Interlisp.org</p>
3 changes: 3 additions & 0 deletions internal/loadups/man-page/md2man.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
pandoc loadup.1.md -s -t man -o loadup.1
gzip --stdout loadup.1 >loadup.1.gz
4 changes: 4 additions & 0 deletions internal/loadups/man-page/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
./md2man.sh
./man2html.sh

2 changes: 2 additions & 0 deletions internal/loadups/man-page/showmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
pandoc loadup.1.md -s -t man | /usr/bin/man -l -
1 change: 1 addition & 0 deletions loadup
1 change: 1 addition & 0 deletions scripts/loadup
146 changes: 0 additions & 146 deletions scripts/loadup-all.sh

This file was deleted.

1 change: 1 addition & 0 deletions scripts/loadup-all.sh
123 changes: 0 additions & 123 deletions scripts/loadup-db.sh

This file was deleted.

1 change: 1 addition & 0 deletions scripts/loadup-db.sh
121 changes: 0 additions & 121 deletions scripts/loadup-full.sh

This file was deleted.

1 change: 1 addition & 0 deletions scripts/loadup-full.sh
191 changes: 0 additions & 191 deletions scripts/loadup-setup.sh

This file was deleted.

487 changes: 487 additions & 0 deletions scripts/loadups/loadup

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions scripts/loadups/loadup-all.sh
Original file line number Diff line number Diff line change
@@ -32,46 +32,51 @@ main() {
exit 1
fi

git_commit_ID "${NOTECARDSDIR}"
NOTECARDS_COMMIT_ID="${COMMIT_ID}"
export NOTECARDS_COMMIT_ID
git_commit_ID "${NOTECARDSDIR}"
NOTECARDS_COMMIT_ID="${COMMIT_ID}"
export NOTECARDS_COMMIT_ID

initfile="-"
cat >"${cmfile}" <<-"EOF"
cat >"${cmfile}" <<-EOF
"
(PROGN
(IL:MEDLEY-INIT-VARS 'IL:GREET)
(IL:DRIBBLE (IL:CONCAT (QUOTE {DSK})(IL:UNIX-GETENV (QUOTE LOADUP_WORKDIR))(IL:L-CASE (QUOTE /apps.dribble))))
(IL:LOAD (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV(QUOTE ROOMSDIR))(QUOTE /ROOMS)) 'IL:SYSLOAD)
(IL:LOAD (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV(QUOTE NOTECARDSDIR))(QUOTE |/system/NOTECARDS.LCOM|)) 'IL:SYSLOAD)
(IL:LOAD (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV(QUOTE CLOSDIR))(QUOTE /DEFSYS.DFASL)) 'IL:SYSLOAD)
(IL:LOAD (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV(QUOTE MEDLEYDIR))(QUOTE |lispusers/BUTTONS.LCOM|)) 'IL:SYSLOAD)
(IL:LOAD (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV (QUOTE LOADUP_SOURCEDIR)) (QUOTE /LOADUP-APPS.LCOM)) 'IL:SYSLOAD)
(IL:PRINT (IL:UNIX-GETENV (QUOTE NOTECARDS_COMMIT_ID)))
(IL:PUTASSOC (QUOTE IL:MEDLEY) (LIST (IL:UNIX-GETENV (QUOTE LOADUP_COMMIT_ID))) IL:SYSOUTCOMMITS)
(IL:PUTASSOC (QUOTE IL:NOTECARDS) (LIST (IL:UNIX-GETENV (QUOTE NOTECARDS_COMMIT_ID))) IL:SYSOUTCOMMITS)
(IL:PRINT IL:SYSOUTCOMMITS)
(IL:HARDRESET)
(SETQ IL:LOADUP-SUCCESS
(${NL_ER_SETQ}
(PROGN
(SETQ IL:HELPFLAG ${HELPFLAG})
(IL:MEDLEY-INIT-VARS 'IL:GREET)
(IL:DRIBBLE
(IL:CONCAT (QUOTE {DSK})(IL:UNIX-GETENV (QUOTE LOADUP_WORKDIR))(IL:L-CASE (QUOTE /apps.dribble)))
)
(IL:LOAD (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV (QUOTE LOADUP_SOURCEDIR))(QUOTE /LOADUP-CLOS.LCOM)))
(IL:LOADUP-CLOS)
(IL:LOAD (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV (QUOTE LOADUP_SOURCEDIR))(QUOTE /LOADUP-APPS.LCOM)))
(IL:LOADUP-APPS)
(IL:DRIBBLE)
)
)
)
SHH
(PROGN
(IL:ENDLOADUP)
(CLOS::LOAD-CLOS)
(IL:|Apps.LOADUP|)
(IL:DRIBBLE)
(IL:MAKESYS
(IL:CONCAT (QUOTE {DSK})(IL:UNIX-GETENV(QUOTE LOADUP_WORKDIR))(IL:L-CASE (QUOTE /apps.sysout)))
:APPS)
(COND
(IL:LOADUP-SUCCESS
(IL:ENDLOADUP)
(SETQ IL:HELPFLAG T)
(SETQ IL:LOADUP-SUCCESS (QUOTE NOBIND))
(IL:MAKESYS
(IL:CONCAT (QUOTE {DSK})(IL:UNIX-GETENV(QUOTE LOADUP_WORKDIR)) (IL:L-CASE (QUOTE /apps.sysout)))
:APPS
)
(IL:LOGOUT T 0)
)
)
(IL:LOGOUT T)
(IL:LOGOUT T 1)
"
EOF

run_medley "${LOADUP_WORKDIR}/full.sysout"

loadup_finish "apps.sysout" "apps.*"

}


13 changes: 8 additions & 5 deletions scripts/loadup-aux.sh → scripts/loadups/loadup-aux.sh
Original file line number Diff line number Diff line change
@@ -11,22 +11,25 @@ main() {
initfile="-"
cat >"${cmfile}" <<-"EOF"
"
(SETQ IL:HELPFLAG ${HELPFLAG})
(PROG
((WORKDIR (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV (QUOTE LOADUP_WORKDIR)) (QUOTE /))))
(IL:MEDLEY-INIT-VARS)
(IL:LOAD(QUOTE MEDLEY-UTILS))
(DRIBBLE (QUOTE {DSK}<TMP>FOOBAR))
(IL:LOAD (QUOTE MEDLEY-UTILS))
(IL:DRIBBLE (IL:CONCAT WORKDIR (IL:L-CASE (QUOTE exports.dribble))))
(IL:MAKE-EXPORTS-ALL (IL:CONCAT WORKDIR (IL:L-CASE (QUOTE exports.all))))
(DRIBBLE)
(IL:DRIBBLE)
(IL:PUTASSOC (QUOTE IL:MEDLEY) (LIST (IL:UNIX-GETENV (QUOTE LOADUP_COMMIT_ID))) IL:SYSOUTCOMMITS)
(IL:MAKE-WHEREIS-HASH
(IL:CONCAT WORKDIR (IL:L-CASE (QUOTE whereis.dribble)))
(IL:CONCAT WORKDIR (IL:L-CASE (QUOTE whereis.hash-tmp)))
(IL:CONCAT WORKDIR (IL:L-CASE (QUOTE whereis.hash)))
NIL NIL
)
(IL:LOGOUT T)
(IL:LOGOUT T 0)
)
(IL:LOGOUT T 1)
"
EOF

Original file line number Diff line number Diff line change
@@ -9,14 +9,15 @@ main() {
SYSOUT="${MEDLEYDIR}/loadups/full.sysout"
if [ ! -f "${SYSOUT}" ];
then
echo "Error: cannot find ${SYSOUT}. Exiting."
output_error_msg "Error: cannot find ${SYSOUT}.${EOL}Exiting."
exit 1
fi

initfile="-"
cat >"${cmfile}" <<-"EOF"
"
(SETQ IL:HELPFLAG ${HELPFLAG})
(PROG
((WORKDIR (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV (QUOTE LOADUP_WORKDIR)) (QUOTE /))))
(SETQ IL:SYSOUTCOMMITS (LIST (LIST (QUOTE IL:MEDLEY) (IL:UNIX-GETENV (QUOTE LOADUP_COMMIT_ID)))))
@@ -28,8 +29,9 @@ main() {
(IL:CONCAT WORKDIR (IL:L-CASE (QUOTE fuller.database)))
(IL:CONCAT WORKDIR (IL:L-CASE (QUOTE fuller.sysout)))
)
(IL:LOGOUT T)
(IL:LOGOUT T 0)
)
(IL:LOGOUT T 1)
"
EOF
110 changes: 110 additions & 0 deletions scripts/loadups/loadup-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/bin/sh
#
# Redirect loadup-db.sh to omnibus loadup script
#
main() {

"${LOADUP_SCRIPTDIR}"/loadup -db

}

# shellcheck disable=SC2164,SC2034
if [ -z "${LOADUP_SCRIPTDIR}" ]
then
#
#
# Some functions to determine what directory this script is being executed from
#
#
get_abs_filename() {
# $1 : relative filename
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}

# This function taken from
# https://stackoverflow.com/questions/29832037/how-to-get-script-directory-in-posix-sh
rreadlink() (

# Execute this function in a *subshell* to localize variables and the effect of `cd`.

target=$1
fname=
targetDir=
CDPATH=

# Try to make the execution environment as predictable as possible:
# All commands below are invoked via `command`, so we must make sure that `command`
# itself is not redefined as an alias or shell function.
# (Note that command is too inconsistent across shells, so we don't use it.)
# `command` is a *builtin* in bash, dash, ksh, zsh, and some platforms do not even have
# an external utility version of it (e.g, Ubuntu).
# `command` bypasses aliases and shell functions and also finds builtins
# in bash, dash, and ksh. In zsh, option POSIX_BUILTINS must be turned on for that
# to happen.
{ \unalias command; \unset -f command; } >/dev/null 2>&1
[ -n "$ZSH_VERSION" ] && options[POSIX_BUILTINS]=on # make zsh find *builtins* with `command` too.

while :; do # Resolve potential symlinks until the ultimate target is found.
[ -L "$target" ] || [ -e "$target" ] || { command printf '%s\n' "ERROR: '$target' does not exist." >&2; return 1; }
command cd "$(command dirname -- "$target")" # Change to target dir; necessary for correct resolution of target path.
fname=$(command basename -- "$target") # Extract filename.
[ "$fname" = '/' ] && fname='' # !! curiously, `basename /` returns '/'
if [ -L "$fname" ]; then
# Extract [next] target path, which may be defined
# *relative* to the symlink's own directory.
# Note: We parse `ls -l` output to find the symlink target
# which is the only POSIX-compliant, albeit somewhat fragile, way.
target=$(command ls -l "$fname")
target=${target#* -> }
continue # Resolve [next] symlink target.
fi
break # Ultimate target reached.
done
targetDir=$(command pwd -P) # Get canonical dir. path
# Output the ultimate target's canonical path.
# Note that we manually resolve paths ending in /. and /.. to make sure we have a normalized path.
if [ "$fname" = '.' ]; then
command printf '%s\n' "${targetDir%/}"
elif [ "$fname" = '..' ]; then
# Caveat: something like /var/.. will resolve to /private (assuming /var@ -> /private/var), i.e. the '..' is applied
# AFTER canonicalization.
command printf '%s\n' "$(command dirname -- "${targetDir}")"
else
command printf '%s\n' "${targetDir%/}/$fname"
fi
)

get_script_dir() {

# call this with $0 (from main script) as its (only) parameter
# if you need to preserve cwd, run this is a subshell since
# it can change cwd

# set -x

local_SCRIPT_PATH="$( get_abs_filename "$1" )";

while [ -h "$local_SCRIPT_PATH" ];
do
cd "$( dirname -- "$local_SCRIPT_PATH"; )";
local_SCRIPT_PATH="$( rreadlink "$local_SCRIPT_PATH" )";
done

cd "$( dirname -- "$local_SCRIPT_PATH"; )" > '/dev/null';
local_SCRIPT_PATH="$( pwd; )";

# set +x

echo "${local_SCRIPT_PATH}"
}

# end of script directory functions
###############################################################################

# figure out the script dir
LOADUP_SCRIPTDIR="$(get_script_dir "$0")"
export LOADUP_SCRIPTDIR

fi

main "$@"
Original file line number Diff line number Diff line change
@@ -7,21 +7,32 @@ main() {
loadup_start

initfile="-"
cat >"${cmfile}" <<-"EOF"
cat >"${cmfile}" <<-EOF
"
(PROGN
(IL:LOAD (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV (QUOTE LOADUP_SOURCEDIR))(QUOTE /LOADUP-FULL.LCOM)))
(IL:LOADUP-FULL (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV(QUOTE LOADUP_WORKDIR))(IL:L-CASE (QUOTE /full.dribble))))
(IL:PUTASSOC (QUOTE IL:MEDLEY) (LIST (IL:UNIX-GETENV (QUOTE LOADUP_COMMIT_ID))) IL:SYSOUTCOMMITS)
(IL:HARDRESET)
)
SHH
(PROGN
(IL:ENDLOADUP)
(IL:MAKESYS (IL:CONCAT (QUOTE {DSK})(IL:UNIX-GETENV(QUOTE LOADUP_WORKDIR))(IL:L-CASE (QUOTE /full.sysout))) :FULL))
(IL:LOGOUT T)
(SETQ IL:LOADUP-SUCCESS
(${NL_ER_SETQ}
(PROGN
(SETQ IL:HELPFLAG ${HELPFLAG})
(IL:LOAD (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV (QUOTE LOADUP_SOURCEDIR))(QUOTE /LOADUP-FULL.LCOM)))
(IL:LOADUP-FULL (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV(QUOTE LOADUP_WORKDIR))(IL:L-CASE (QUOTE /full.dribble))))
(IL:PUTASSOC (QUOTE IL:MEDLEY) (LIST (IL:UNIX-GETENV (QUOTE LOADUP_COMMIT_ID))) IL:SYSOUTCOMMITS)
)
)
)
(COND
(IL:LOADUP-SUCCESS
(IL:ENDLOADUP)
(SETQ IL:HELPFLAG T)
(SETQ IL:LOADUP-SUCCESS (QUOTE NOBIND))
(IL:MAKESYS
(IL:CONCAT (QUOTE {DSK})(IL:UNIX-GETENV(QUOTE LOADUP_WORKDIR))(IL:L-CASE (QUOTE /full.sysout)))
:FULL
)
(IL:LOGOUT T 0)
)
)
(IL:LOGOUT T 1)
"
EOF
110 changes: 110 additions & 0 deletions scripts/loadups/loadup-full.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/bin/sh
#
# Redirect loadup-full.sh to omnibus loadup script
#
main() {

"${LOADUP_SCRIPTDIR}"/loadup -target full

}

# shellcheck disable=SC2164,SC2034
if [ -z "${LOADUP_SCRIPTDIR}" ]
then
#
#
# Some functions to determine what directory this script is being executed from
#
#
get_abs_filename() {
# $1 : relative filename
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}

# This function taken from
# https://stackoverflow.com/questions/29832037/how-to-get-script-directory-in-posix-sh
rreadlink() (

# Execute this function in a *subshell* to localize variables and the effect of `cd`.

target=$1
fname=
targetDir=
CDPATH=

# Try to make the execution environment as predictable as possible:
# All commands below are invoked via `command`, so we must make sure that `command`
# itself is not redefined as an alias or shell function.
# (Note that command is too inconsistent across shells, so we don't use it.)
# `command` is a *builtin* in bash, dash, ksh, zsh, and some platforms do not even have
# an external utility version of it (e.g, Ubuntu).
# `command` bypasses aliases and shell functions and also finds builtins
# in bash, dash, and ksh. In zsh, option POSIX_BUILTINS must be turned on for that
# to happen.
{ \unalias command; \unset -f command; } >/dev/null 2>&1
[ -n "$ZSH_VERSION" ] && options[POSIX_BUILTINS]=on # make zsh find *builtins* with `command` too.

while :; do # Resolve potential symlinks until the ultimate target is found.
[ -L "$target" ] || [ -e "$target" ] || { command printf '%s\n' "ERROR: '$target' does not exist." >&2; return 1; }
command cd "$(command dirname -- "$target")" # Change to target dir; necessary for correct resolution of target path.
fname=$(command basename -- "$target") # Extract filename.
[ "$fname" = '/' ] && fname='' # !! curiously, `basename /` returns '/'
if [ -L "$fname" ]; then
# Extract [next] target path, which may be defined
# *relative* to the symlink's own directory.
# Note: We parse `ls -l` output to find the symlink target
# which is the only POSIX-compliant, albeit somewhat fragile, way.
target=$(command ls -l "$fname")
target=${target#* -> }
continue # Resolve [next] symlink target.
fi
break # Ultimate target reached.
done
targetDir=$(command pwd -P) # Get canonical dir. path
# Output the ultimate target's canonical path.
# Note that we manually resolve paths ending in /. and /.. to make sure we have a normalized path.
if [ "$fname" = '.' ]; then
command printf '%s\n' "${targetDir%/}"
elif [ "$fname" = '..' ]; then
# Caveat: something like /var/.. will resolve to /private (assuming /var@ -> /private/var), i.e. the '..' is applied
# AFTER canonicalization.
command printf '%s\n' "$(command dirname -- "${targetDir}")"
else
command printf '%s\n' "${targetDir%/}/$fname"
fi
)

get_script_dir() {

# call this with $0 (from main script) as its (only) parameter
# if you need to preserve cwd, run this is a subshell since
# it can change cwd

# set -x

local_SCRIPT_PATH="$( get_abs_filename "$1" )";

while [ -h "$local_SCRIPT_PATH" ];
do
cd "$( dirname -- "$local_SCRIPT_PATH"; )";
local_SCRIPT_PATH="$( rreadlink "$local_SCRIPT_PATH" )";
done

cd "$( dirname -- "$local_SCRIPT_PATH"; )" > '/dev/null';
local_SCRIPT_PATH="$( pwd; )";

# set +x

echo "${local_SCRIPT_PATH}"
}

# end of script directory functions
###############################################################################

# figure out the script dir
LOADUP_SCRIPTDIR="$(get_script_dir "$0")"
export LOADUP_SCRIPTDIR

fi

main "$@"
2 changes: 1 addition & 1 deletion scripts/loadup-init.sh → scripts/loadups/loadup-init.sh
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ main() {
(LOADUP-SOURCE-DIR (CONCAT "{DSK}" (UNIX-GETENV "LOADUP_SOURCEDIR") "/"))
)
(SETQ DIRECTORIES (CONS LOADUP-SOURCE-DIR DIRECTORIES))
(PRINT (DATE))
(PRINT (DATE))
(PRINT (SETQ SYSOUTCOMMITS (LIST (LIST (QUOTE MEDLEY) (UNIX-GETENV (QUOTE LOADUP_COMMIT_ID))))))
(RESETLST (RESETSAVE OK.TO.MODIFY.FNS T)
(MAKEINITGREET (CONCAT WORKDIR "init.sysout") (CONCAT WORKDIR "init.dlinit"))
Original file line number Diff line number Diff line change
@@ -7,23 +7,30 @@ main() {
loadup_start

initfile="-"
cat >"${cmfile}" <<-"EOF"
cat >"${cmfile}" <<-EOF
"
(PROGN
(SETQ LOADUP-SUCCESS NIL)
(LOAD (CONCAT (QUOTE {DSK}) (UNIX-GETENV (QUOTE MEDLEYDIR)) (QUOTE /sources/MEDLEYDIR.LCOM)))
(MEDLEY-INIT-VARS)
(LOAD (CONCAT (QUOTE {DSK}) (UNIX-GETENV (QUOTE LOADUP_SOURCEDIR)) (QUOTE /LOADUP-LISP.LCOM)))
(LOADUP-LISP (CONCAT (QUOTE {DSK}) (UNIX-GETENV (QUOTE LOADUP_WORKDIR)) (QUOTE /lisp.dribble)))
(PUTASSOC (QUOTE MEDLEY) (LIST (UNIX-GETENV (QUOTE LOADUP_COMMIT_ID))) SYSOUTCOMMITS)
(HARDRESET)
)
SHH
(PROGN
(IL:ENDLOADUP)
(IL:MAKESYS (IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV(QUOTE LOADUP_WORKDIR)) (IL:L-CASE (QUOTE /lisp.sysout))) :LISP)
(IL:LOGOUT T)
)
(SETQ LOADUP-SUCCESS T)
(HARDRESET)
)
(COND
(IL:LOADUP-SUCCESS
(IL:ENDLOADUP)
(SETQ IL:HELPFLAG T)
(SETQ IL:LOADUP-SUCCESS (QUOTE NOBIND))
(IL:MAKESYS
(IL:CONCAT (QUOTE {DSK}) (IL:UNIX-GETENV (QUOTE LOADUP_WORKDIR)) (IL:L-CASE (QUOTE /lisp.sysout)))
:LISP)
(IL:LOGOUT T 0)
)
)
(IL:LOGOUT T 1)
"
EOF
File renamed without changes.
271 changes: 271 additions & 0 deletions scripts/loadups/loadup-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
#!to_be_sourced_only
# shellcheck shell=sh

MEDLEYDIR=$(cd "${LOADUP_SCRIPTDIR}/../.." || exit; pwd)
export MEDLEYDIR

export LOADUP_CPV="${MEDLEYDIR}/scripts/cpv"

if [ -z "${LOADUP_SOURCEDIR}" ]
then
LOADUP_SOURCEDIR="${MEDLEYDIR}/internal/loadups"
export LOADUP_SOURCEDIR
fi

if [ -z "${LOADUP_OUTDIR}" ]
then
LOADUP_OUTDIR="${MEDLEYDIR}/loadups"
export LOADUP_OUTDIR
fi

if [ ! -d "${LOADUP_OUTDIR}" ];
then
if [ ! -e "${LOADUP_OUTDIR}" ];
then
mkdir -p "${LOADUP_OUTDIR}"
else
echo "Error: ${LOADUP_OUTDIR} exists but is not a directory. Exiting."
exit 1
fi
fi

if [ -z "${LOADUP_WORKDIR}" ]
then
LOADUP_WORKDIR="${LOADUP_OUTDIR}/build"
export LOADUP_WORKDIR
fi

if [ ! -d "${LOADUP_WORKDIR}" ];
then
if [ ! -e "${LOADUP_WORKDIR}" ];
then
mkdir -p "${LOADUP_WORKDIR}"
else
echo "Error: ${LOADUP_WORKDIR} exists but is not a directory. Exiting."
exit 1
fi
fi

if [ -z "${LOADUP_LOGINDIR}" ]
then
LOADUP_LOGINDIR="${LOADUP_WORKDIR}/logindir"
export LOADUP_LOGINDIR
fi

if [ ! -d "${LOADUP_LOGINDIR}" ];
then
if [ ! -e "${LOADUP_LOGINDIR}" ];
then
mkdir -p "${LOADUP_LOGINDIR}"
else
echo "Error: ${LOADUP_LOGINDIR} exists but is not a directory. Exiting."
exit 1
fi
fi

if [ -f "$(command -v git)" ] && [ -x "$(command -v git)" ]
then
export HAS_GIT=true
else
export HAS_GIT=false
fi

is_git_dir () {
if [ "${HAS_GIT}" = true ]
then
return "$(git -C "$1" rev-parse >/dev/null 2>/dev/null; echo $?)"
else
return 1
fi
}

git_commit_ID () {
if [ "${HAS_GIT}" = true ]
then
if is_git_dir "$1"
then
# This does NOT indicate if there are any modified files!
COMMIT_ID="$(git -C "$1" rev-parse --short HEAD)"
fi
fi
}

git_commit_ID "${LOADUP_SOURCEDIR}"
LOADUP_COMMIT_ID="${COMMIT_ID}"
export LOADUP_COMMIT_ID

# obsolete? scr="-sc 1024x768 -g 1042x790"
geometry=1024x768

touch "${LOADUP_WORKDIR}"/loadup.timestamp

script_name=$(basename "$0" ".sh")
cmfile="${LOADUP_WORKDIR}/${script_name}.cm"
initfile="${LOADUP_WORKDIR}/${script_name}.init"


# Select whether we use NLSETQ or ERSETQ to wrap the loadup
# cm files depending on whether we want to allow breaks or not.
# shellcheck disable=SC2034
if [ -n "${LOADUP_NOBREAK}" ]
then
HELPFLAG=NIL
NL_ER_SETQ=IL:NLSETQ
else
HELPFLAG="(QUOTE IL:BREAK!)"
NL_ER_SETQ=IL:ERSETQ
fi

######################################################################

loadup_start () {
touch "${LOADUP_WORKDIR}"/timestamp
sleep 1
echo ">>>>> START ${script_name}"
}

loadup_finish () {

if [ ! "${cmfile}" = "-" ]; then rm -f "${cmfile}"; fi
if [ ! "${initfile}" = "-" ]; then rm -f "${initfile}"; fi

if [ "${exit_code}" -ne 0 ] || [ ! -f "${LOADUP_WORKDIR}/$1" ] \
|| [ ! "$( find "${LOADUP_WORKDIR}/$1" -newer "${LOADUP_WORKDIR}"/timestamp )" ]
then
output_error_msg "----- FAILURE ${script_name}-----"
exit_code=1
else
echo "+++++ SUCCESS +++++"
exit_code=0
fi
echo "..... files created ....."
if [ -f "${LOADUP_WORKDIR}/$1" ]
then
shift;
for f in "$@"
do
# shellcheck disable=SC2045,SC2086
for ff in $(ls -1 "${LOADUP_WORKDIR}"/$f);
do
# shellcheck disable=SC2010
if [ "$( find "${ff}" -newer "${LOADUP_WORKDIR}"/timestamp )" ]
then
ls -l "${ff}" 2>/dev/null | grep -v "^.*~[0-9]\+~$"
fi
done
done
fi
echo "<<<<< END ${script_name}"
echo ""

exit ${exit_code}
}

run_medley () {
/bin/sh "${MEDLEYDIR}/scripts/medley/medley.command" \
--config - \
--id loadup_+ \
--geometry "${geometry}" \
--noscroll \
--logindir "${LOADUP_LOGINDIR}" \
--rem.cm "${cmfile}" \
--greet "${initfile}" \
--sysout "$1" \
"$2" "$3" "$4" "$5" "$6" "$7" ;
exit_code=$?
}

is_tput="$(command -v tput)"
if [ -z "${is_tput}" ]
then
is_tput="$(command -v true)"
fi


EOL="
"
output_error_msg() {
local_oem_file="${TMPDIR:-/tmp}"/oem_$$
echo "$1" >"${local_oem_file}"
while read -r line
do
echo "$(${is_tput} setab 1)$(${is_tput} setaf 7)${line}$(${is_tput} sgr0)"
done <"${local_oem_file}"
rm -f "${local_oem_file}"
}

output_warn_msg() {
local_oem_file="${TMPDIR:-/tmp}"/oem_$$
echo "$1" >"${local_oem_file}"
while read -r line
do
echo "$(${is_tput} setab 3)$(${is_tput} setaf 4)${line}$(${is_tput} sgr0)"
done <"${local_oem_file}"
rm -f "${local_oem_file}"
}

exit_if_failure() {
if [ "$1" -ne 0 ]
then
if [ ! "$2" = "true" ]
then
output_error_msg "----- ${script_name}: FAILURE -----${EOL}"
fi
remove_run_lock
exit 1
fi
}

process_maikodir() {
# process --maikodir argument. Only use when --maikodir is only possible argument
while [ "$#" -ne 0 ];
do
case "$1" in
-d | -maikodir | --maikodir)
if [ -n "$2" ]
then
maikodir=$(cd "$2" 2>/dev/null && pwd)
if [ -z "${maikodir}" ] || [ ! -d "${maikodir}" ]
then
output_error_msg "Error: In --maikodir (-d) command line argument, \"$2\" is not an existing directory.${EOL}Exiting"
exit 1
fi
else
output_error_msg "Error: Missing value for the --maikodir (-d) command line argument.${EOL}Exiting"
exit 1
fi
export MAIKODIR="${maikodir}"
shift
;;
*)
output_error_msg "Error: unknown flag: $1${EOL}Exiting"
exit 1
;;
esac
shift
done
}

export LOADUP_LOCKFILE="${LOADUP_WORKDIR}"/lock

check_run_lock() {
if [ -e "${LOADUP_LOCKFILE}" ]
then
output_error_msg "Error: Another loadup is already running with PID $(cat "${LOADUP_LOCKFILE}")${EOL}Exiting."
exit 1
fi
echo "$$" > "${LOADUP_LOCKFILE}"
LOADUP_LOCK="$$"
}

remove_run_lock() {
if [ -n "${LOADUP_LOCK}" ]
then
rm -f "${LOADUP_LOCKFILE}"
fi
}


######################################################################


83 changes: 49 additions & 34 deletions scripts/copy-all.sh → scripts/loadups/obsolete/copy-all.sh
Original file line number Diff line number Diff line change
@@ -1,50 +1,65 @@
#!/bin/sh
# shellcheck disable=SC2086

main() {
# shellcheck source=./loadup-setup.sh
. "${LOADUP_SCRIPTDIR}/loadup-setup.sh"

echo ">>>>> START ${script_name}"

/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/full.sysout "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/lisp.sysout "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"

if [ "${1}" = "-apps" ]; then
/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/apps.sysout "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
fi

/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/whereis.hash "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/exports.all "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"

/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/init.dribble "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/lisp.dribble "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/full.dribble "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/whereis.dribble "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"

if [ "${1}" = "-apps" ]; then
/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/apps.dribble "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
fi


/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/RDSYS "${MEDLEYDIR}"/library \
| sed -e "s#${MEDLEYDIR}/##g"
/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/RDSYS.LCOM "${MEDLEYDIR}"/library \
| sed -e "s#${MEDLEYDIR}/##g"

aux="$1"
db="$2"
no_stages="$3"
start="$4"
end="$5"

if [ $start -eq 0 ] && [ $end -ge 1 ]
then
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/RDSYS "${MEDLEYDIR}/library" \
| sed -e "s#${MEDLEYDIR}/##g"
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/RDSYS.LCOM "${MEDLEYDIR}/library" \
| sed -e "s#${MEDLEYDIR}/##g"
fi

if [ $start -le 2 ] && [ $end -ge 3 ]
then
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/lisp.sysout "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
fi

if [ $start -le 3 ] && [ $end -ge 4 ]
then
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/full.sysout "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
fi

if [ $start -le 3 ] && [ $end -ge 5 ]
then
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/apps.sysout "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
fi

if [ "${aux}" = true ]
then
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/whereis.hash "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/exports.all "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
fi

if [ "${db}" = true ]
then
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/fuller.database "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/fuller.dribble "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
fi

echo "<<<<< END ${script_name}"
echo ""
exit 0

}


4 changes: 2 additions & 2 deletions scripts/copy-db.sh → scripts/loadups/obsolete/copy-db.sh
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@ main() {

echo ">>>>> START ${script_name}"

/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/fuller.database "${LOADUP_OUTDIR}"
/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/fuller.dribble "${LOADUP_OUTDIR}"
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/fuller.database "${LOADUP_OUTDIR}"
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/fuller.dribble "${LOADUP_OUTDIR}"

echo "<<<<< END ${script_name}"
echo ""
10 changes: 5 additions & 5 deletions scripts/copy-full.sh → scripts/loadups/obsolete/copy-full.sh
Original file line number Diff line number Diff line change
@@ -6,16 +6,16 @@ main() {

echo ">>>>> START ${script_name}"

/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/full.sysout "${LOADUP_OUTDIR}" \
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/full.sysout "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/lisp.sysout "${LOADUP_OUTDIR}" \
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/lisp.sysout "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"

/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/init.dribble "${LOADUP_OUTDIR}" \
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/init.dribble "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/lisp.dribble "${LOADUP_OUTDIR}" \
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/lisp.dribble "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"
/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/full.dribble "${LOADUP_OUTDIR}" \
/bin/sh "${LOADUP_CPV}" "${LOADUP_WORKDIR}"/full.dribble "${LOADUP_OUTDIR}" \
| sed -e "s#${MEDLEYDIR}/##g"

/bin/sh "${LOADUP_SCRIPTDIR}/cpv" "${LOADUP_WORKDIR}"/RDSYS "${MEDLEYDIR}"/library \
File renamed without changes.
126 changes: 126 additions & 0 deletions scripts/loadups/obsolete/loadup-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
#!/bin/sh

main () {
# shellcheck source=./loadup-setup.sh
. "${LOADUP_SCRIPTDIR}/loadup-setup.sh"

check_run_lock

process_maikodir "$@"

# do the loadup
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-db-from-full.sh"
exit_if_failure $?
/bin/sh "${LOADUP_SCRIPTDIR}/copy-db.sh"
exit_if_failure $?

echo "+++++ loadup-db.sh: SUCCESS +++++"
remove_run_lock
exit 0
}

# shellcheck disable=SC2164,SC2034
if [ -z "${LOADUP_SCRIPTDIR}" ]
then
#
#
# Some functions to determine what directory this script is being executed from
#
#
get_abs_filename() {
# $1 : relative filename
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}

# This function taken from
# https://stackoverflow.com/questions/29832037/how-to-get-script-directory-in-posix-sh
rreadlink() (

# Execute this function in a *subshell* to localize variables and the effect of `cd`.

target=$1
fname=
targetDir=
CDPATH=

# Try to make the execution environment as predictable as possible:
# All commands below are invoked via `command`, so we must make sure that `command`
# itself is not redefined as an alias or shell function.
# (Note that command is too inconsistent across shells, so we don't use it.)
# `command` is a *builtin* in bash, dash, ksh, zsh, and some platforms do not even have
# an external utility version of it (e.g, Ubuntu).
# `command` bypasses aliases and shell functions and also finds builtins
# in bash, dash, and ksh. In zsh, option POSIX_BUILTINS must be turned on for that
# to happen.
{ \unalias command; \unset -f command; } >/dev/null 2>&1
[ -n "$ZSH_VERSION" ] && options[POSIX_BUILTINS]=on # make zsh find *builtins* with `command` too.

while :; do # Resolve potential symlinks until the ultimate target is found.
[ -L "$target" ] || [ -e "$target" ] || { command printf '%s\n' "ERROR: '$target' does not exist." >&2; return 1; }
command cd "$(command dirname -- "$target")" # Change to target dir; necessary for correct resolution of target path.
fname=$(command basename -- "$target") # Extract filename.
[ "$fname" = '/' ] && fname='' # !! curiously, `basename /` returns '/'
if [ -L "$fname" ]; then
# Extract [next] target path, which may be defined
# *relative* to the symlink's own directory.
# Note: We parse `ls -l` output to find the symlink target
# which is the only POSIX-compliant, albeit somewhat fragile, way.
target=$(command ls -l "$fname")
target=${target#* -> }
continue # Resolve [next] symlink target.
fi
break # Ultimate target reached.
done
targetDir=$(command pwd -P) # Get canonical dir. path
# Output the ultimate target's canonical path.
# Note that we manually resolve paths ending in /. and /.. to make sure we have a normalized path.
if [ "$fname" = '.' ]; then
command printf '%s\n' "${targetDir%/}"
elif [ "$fname" = '..' ]; then
# Caveat: something like /var/.. will resolve to /private (assuming /var@ -> /private/var), i.e. the '..' is applied
# AFTER canonicalization.
command printf '%s\n' "$(command dirname -- "${targetDir}")"
else
command printf '%s\n' "${targetDir%/}/$fname"
fi
)

get_script_dir() {

# call this with $0 (from main script) as its (only) parameter
# if you need to preserve cwd, run this is a subshell since
# it can change cwd

# set -x

local_SCRIPT_PATH="$( get_abs_filename "$1" )";

while [ -h "$local_SCRIPT_PATH" ];
do
cd "$( dirname -- "$local_SCRIPT_PATH"; )";
local_SCRIPT_PATH="$( rreadlink "$local_SCRIPT_PATH" )";
done

cd "$( dirname -- "$local_SCRIPT_PATH"; )" > '/dev/null';
local_SCRIPT_PATH="$( pwd; )";

# set +x

echo "${local_SCRIPT_PATH}"
}

# end of script directory functions
###############################################################################

# figure out the script dir
LOADUP_SCRIPTDIR="$(get_script_dir "$0")"
export LOADUP_SCRIPTDIR

fi

main "$@"





120 changes: 120 additions & 0 deletions scripts/loadups/obsolete/loadup-full.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/bin/sh

main() {
# shellcheck source=./loadup-setup.sh
. "${LOADUP_SCRIPTDIR}/loadup-setup.sh"

process_maikodir "$@"

# do the loadup
/bin/sh "${LOADUP_SCRIPTDIR}/loadup-all.sh" --full --noendmsg

# shellcheck disable=SC2181
if [ $? -eq 0 ];
then
echo "+++++ ${script_name}: SUCCESS +++++"
else
output_error_msg "----- ${script_name}: FAILURE -----${EOL}"
fi
}

# shellcheck disable=SC2164,SC2034
if [ -z "${LOADUP_SCRIPTDIR}" ]
then
#
#
# Some functions to determine what directory this script is being executed from
#
#
get_abs_filename() {
# $1 : relative filename
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}

# This function taken from
# https://stackoverflow.com/questions/29832037/how-to-get-script-directory-in-posix-sh
rreadlink() (

# Execute this function in a *subshell* to localize variables and the effect of `cd`.

target=$1
fname=
targetDir=
CDPATH=

# Try to make the execution environment as predictable as possible:
# All commands below are invoked via `command`, so we must make sure that `command`
# itself is not redefined as an alias or shell function.
# (Note that command is too inconsistent across shells, so we don't use it.)
# `command` is a *builtin* in bash, dash, ksh, zsh, and some platforms do not even have
# an external utility version of it (e.g, Ubuntu).
# `command` bypasses aliases and shell functions and also finds builtins
# in bash, dash, and ksh. In zsh, option POSIX_BUILTINS must be turned on for that
# to happen.
{ \unalias command; \unset -f command; } >/dev/null 2>&1
[ -n "$ZSH_VERSION" ] && options[POSIX_BUILTINS]=on # make zsh find *builtins* with `command` too.

while :; do # Resolve potential symlinks until the ultimate target is found.
[ -L "$target" ] || [ -e "$target" ] || { command printf '%s\n' "ERROR: '$target' does not exist." >&2; return 1; }
command cd "$(command dirname -- "$target")" # Change to target dir; necessary for correct resolution of target path.
fname=$(command basename -- "$target") # Extract filename.
[ "$fname" = '/' ] && fname='' # !! curiously, `basename /` returns '/'
if [ -L "$fname" ]; then
# Extract [next] target path, which may be defined
# *relative* to the symlink's own directory.
# Note: We parse `ls -l` output to find the symlink target
# which is the only POSIX-compliant, albeit somewhat fragile, way.
target=$(command ls -l "$fname")
target=${target#* -> }
continue # Resolve [next] symlink target.
fi
break # Ultimate target reached.
done
targetDir=$(command pwd -P) # Get canonical dir. path
# Output the ultimate target's canonical path.
# Note that we manually resolve paths ending in /. and /.. to make sure we have a normalized path.
if [ "$fname" = '.' ]; then
command printf '%s\n' "${targetDir%/}"
elif [ "$fname" = '..' ]; then
# Caveat: something like /var/.. will resolve to /private (assuming /var@ -> /private/var), i.e. the '..' is applied
# AFTER canonicalization.
command printf '%s\n' "$(command dirname -- "${targetDir}")"
else
command printf '%s\n' "${targetDir%/}/$fname"
fi
)

get_script_dir() {

# call this with $0 (from main script) as its (only) parameter
# if you need to preserve cwd, run this is a subshell since
# it can change cwd

# set -x

local_SCRIPT_PATH="$( get_abs_filename "$1" )";

while [ -h "$local_SCRIPT_PATH" ];
do
cd "$( dirname -- "$local_SCRIPT_PATH"; )";
local_SCRIPT_PATH="$( rreadlink "$local_SCRIPT_PATH" )";
done

cd "$( dirname -- "$local_SCRIPT_PATH"; )" > '/dev/null';
local_SCRIPT_PATH="$( pwd; )";

# set +x

echo "${local_SCRIPT_PATH}"
}

# end of script directory functions
###############################################################################

# figure out the script dir
LOADUP_SCRIPTDIR="$(get_script_dir "$0")"
export LOADUP_SCRIPTDIR

fi

main "$@"
126 changes: 126 additions & 0 deletions scripts/loadups/thin_loadups.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
#!/bin/sh
#
# Thin the Medley loadups and loadups/build directories by deleting all but the latest version.
#
# 2025-04-18 Frank Halasz
#

main() {

#shellcheck source=./loadup-setup.sh
. "${LOADUP_SCRIPTDIR}"/loadup-setup.sh

if [ "$1" = "w" ] || [ "$1" = "lw" ] || [ "$1" = "wl" ]
then
find "${LOADUP_WORKDIR}" -name "*.~[0-9]*~" -delete
fi
if [ "$1" = "l" ] || [ "$1" = "lw" ] || [ "$1" = "wl" ]
then
find "${LOADUP_OUTDIR}" -name "*.~[0-9]*~" -delete
fi

}



# shellcheck disable=SC2164,SC2034
if [ -z "${LOADUP_SCRIPTDIR}" ]
then
#
#
# Some functions to determine what directory this script is being executed from
#
#
get_abs_filename() {
# $1 : relative filename
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}

# This function taken from
# https://stackoverflow.com/questions/29832037/how-to-get-script-directory-in-posix-sh
rreadlink() (

# Execute this function in a *subshell* to localize variables and the effect of `cd`.

target=$1
fname=
targetDir=
CDPATH=

# Try to make the execution environment as predictable as possible:
# All commands below are invoked via `command`, so we must make sure that `command`
# itself is not redefined as an alias or shell function.
# (Note that command is too inconsistent across shells, so we don't use it.)
# `command` is a *builtin* in bash, dash, ksh, zsh, and some platforms do not even have
# an external utility version of it (e.g, Ubuntu).
# `command` bypasses aliases and shell functions and also finds builtins
# in bash, dash, and ksh. In zsh, option POSIX_BUILTINS must be turned on for that
# to happen.
{ \unalias command; \unset -f command; } >/dev/null 2>&1
[ -n "$ZSH_VERSION" ] && options[POSIX_BUILTINS]=on # make zsh find *builtins* with `command` too.

while :; do # Resolve potential symlinks until the ultimate target is found.
[ -L "$target" ] || [ -e "$target" ] || { command printf '%s\n' "ERROR: '$target' does not exist." >&2; return 1; }
command cd "$(command dirname -- "$target")" # Change to target dir; necessary for correct resolution of target path.
fname=$(command basename -- "$target") # Extract filename.
[ "$fname" = '/' ] && fname='' # !! curiously, `basename /` returns '/'
if [ -L "$fname" ]; then
# Extract [next] target path, which may be defined
# *relative* to the symlink's own directory.
# Note: We parse `ls -l` output to find the symlink target
# which is the only POSIX-compliant, albeit somewhat fragile, way.
target=$(command ls -l "$fname")
target=${target#* -> }
continue # Resolve [next] symlink target.
fi
break # Ultimate target reached.
done
targetDir=$(command pwd -P) # Get canonical dir. path
# Output the ultimate target's canonical path.
# Note that we manually resolve paths ending in /. and /.. to make sure we have a normalized path.
if [ "$fname" = '.' ]; then
command printf '%s\n' "${targetDir%/}"
elif [ "$fname" = '..' ]; then
# Caveat: something like /var/.. will resolve to /private (assuming /var@ -> /private/var), i.e. the '..' is applied
# AFTER canonicalization.
command printf '%s\n' "$(command dirname -- "${targetDir}")"
else
command printf '%s\n' "${targetDir%/}/$fname"
fi
)

get_script_dir() {

# call this with $0 (from main script) as its (only) parameter
# if you need to preserve cwd, run this is a subshell since
# it can change cwd

# set -x

local_SCRIPT_PATH="$( get_abs_filename "$1" )";

while [ -h "$local_SCRIPT_PATH" ];
do
cd "$( dirname -- "$local_SCRIPT_PATH"; )";
local_SCRIPT_PATH="$( rreadlink "$local_SCRIPT_PATH" )";
done

cd "$( dirname -- "$local_SCRIPT_PATH"; )" > '/dev/null';
local_SCRIPT_PATH="$( pwd; )";

# set +x

echo "${local_SCRIPT_PATH}"
}

# end of script directory functions
###############################################################################

# figure out the script dir
LOADUP_SCRIPTDIR="$(get_script_dir "$0")"
export LOADUP_SCRIPTDIR

fi

main "$@"

29 changes: 18 additions & 11 deletions scripts/medley/medley.command
Original file line number Diff line number Diff line change
@@ -159,7 +159,7 @@ SCRIPTDIR="$(get_script_dir "$0")"
#
###############################################################################

is_tput="$(which tput)"
is_tput="$(command -v tput)"

output_error_msg() {
local_oem_file="${TMPDIR:-/tmp}"/oem_$$
@@ -170,7 +170,7 @@ output_error_msg() {
then
echo "$(${is_tput} setab 1)$(${is_tput} setaf 7)${line}$(${is_tput} sgr0)"
else
echo "$1"
echo "${line}"
fi
done <"${local_oem_file}"
rm -f "${local_oem_file}"
@@ -620,8 +620,8 @@ sysout_stage=""
title=""
use_vnc=false
windows=false
maikodir_arg=""
maikodir_stage=""
maikodir_arg="${MAIKODIR}"
maikodir_stage="MAIKODIR env variable"
maikoprog_arg=""
greet_arg=""
noscroll=false
@@ -931,10 +931,16 @@ do
;;
--maikodir)
# for use in loadups
check_for_dash_or_end "$1" "$2"
check_dir_exists "$1" "2"
maikodir_arg="$2"
maikodir_stage="${args_stage}"
if [ "$2" = "-" ] || [ "$2" == "--" ]
then
maikodir_arg=""
maikodir_stage=""
else
check_for_dash_or_end "$1" "$2"
check_dir_exists "$1" "2"
maikodir_arg="$2"
maikodir_stage="${args_stage}"
fi
shift;
;;
-prog | --maikoprog)
@@ -1365,7 +1371,8 @@ then
then
err_msg="ERROR: Cannot find the Maiko directory at either
\"${MEDLEYDIR}/maiko\" or \"${MEDLEYDIR}/../maiko\".
You can use the --maikodir argument to specify the Maiko directory.
You can use the --maikodir argument or the MAIKODIR env variable
to specify the Maiko directory.
Exiting."
output_error_msg "${err_msg}"
exit 53
@@ -1380,8 +1387,8 @@ Exiting."
elif ! check_if_maiko_dir "${maikodir_arg}" || ! check_for_maiko_exe "${maikodir_arg}"
then
err_msg="In ${maikodir_stage}:
ERROR: The value of the --maikodir argument is not in fact a directory containing
the Maiko emulator (${maiko_exe_subdir}/${maikoprog_arg}).
ERROR: The value provided by \$MAIKODIR or by the --maikodir argument ("${maikodir_arg}") is not
in fact a directory containing the Maiko emulator (${maiko_exe_subdir}/${maikoprog_arg}).
Exiting."
output_error_msg "${err_msg}"
exit 53
18 changes: 12 additions & 6 deletions scripts/medley/medley_args.sh
Original file line number Diff line number Diff line change
@@ -30,8 +30,8 @@ sysout_stage=""
title=""
use_vnc=false
windows=false
maikodir_arg=""
maikodir_stage=""
maikodir_arg="${MAIKODIR}"
maikodir_stage="MAIKODIR env variable"
maikoprog_arg=""
greet_arg=""
noscroll=false
@@ -341,10 +341,16 @@ do
;;
--maikodir)
# for use in loadups
check_for_dash_or_end "$1" "$2"
check_dir_exists "$1" "2"
maikodir_arg="$2"
maikodir_stage="${args_stage}"
if [ "$2" = "-" ] || [ "$2" == "--" ]
then
maikodir_arg=""
maikodir_stage=""
else
check_for_dash_or_end "$1" "$2"
check_dir_exists "$1" "2"
maikodir_arg="$2"
maikodir_stage="${args_stage}"
fi
shift;
;;
-prog | --maikoprog)
7 changes: 4 additions & 3 deletions scripts/medley/medley_run.sh
Original file line number Diff line number Diff line change
@@ -246,7 +246,8 @@ then
then
err_msg="ERROR: Cannot find the Maiko directory at either
\"${MEDLEYDIR}/maiko\" or \"${MEDLEYDIR}/../maiko\".
You can use the --maikodir argument to specify the Maiko directory.
You can use the --maikodir argument or the MAIKODIR env variable
to specify the Maiko directory.
Exiting."
output_error_msg "${err_msg}"
exit 53
@@ -261,8 +262,8 @@ Exiting."
elif ! check_if_maiko_dir "${maikodir_arg}" || ! check_for_maiko_exe "${maikodir_arg}"
then
err_msg="In ${maikodir_stage}:
ERROR: The value of the --maikodir argument is not in fact a directory containing
the Maiko emulator (${maiko_exe_subdir}/${maikoprog_arg}).
ERROR: The value provided by \$MAIKODIR or by the --maikodir argument ("${maikodir_arg}") is not
in fact a directory containing the Maiko emulator (${maiko_exe_subdir}/${maikoprog_arg}).
Exiting."
output_error_msg "${err_msg}"
exit 53
4 changes: 2 additions & 2 deletions scripts/medley/medley_utils.sh
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
#
###############################################################################

is_tput="$(which tput)"
is_tput="$(command -v tput)"

output_error_msg() {
local_oem_file="${TMPDIR:-/tmp}"/oem_$$
@@ -24,7 +24,7 @@ output_error_msg() {
then
echo "$(${is_tput} setab 1)$(${is_tput} setaf 7)${line}$(${is_tput} sgr0)"
else
echo "$1"
echo "${line}"
fi
done <"${local_oem_file}"
rm -f "${local_oem_file}"