diff --git a/.gitignore b/.gitignore index 9af2af4b..1434e477 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,9 @@ loadups/whereis.hash loadups/apps.sysout loadups/fuller.database loadups/build/ +loadups/branches +loadups/gitinfo + # manual cross-reference files diff --git a/docs/man-page/man_medley.html b/docs/man-page/man_medley.html index a0e6c58a..bb215a2f 100644 --- a/docs/man-page/man_medley.html +++ b/docs/man-page/man_medley.html @@ -293,6 +293,16 @@ that detects Xvnc server failures. Setting this flag notifies Medley that very short Medley sessions are possible and the Xvnc error detection needs to be adjusted accordingly.

+
-br [BRANCH | -], --branch [BRANCH | -]
+
+

By default, sysout files are loaded from the MEDLEYDIR/loadups +directory. If “--branch BRANCH” is specified, then by default +sysout files are loaded from the MEDLEYDIR/loadups/branches/BRANCH +directory. The sysouts in these directories are created using a loadups +script with the --branch flag set. See the loadup man page. If +BRANCH is “-”, then the name of the active git branch for +MEDLEYDIR (if any) is used as BRANCH.

+

Other Options

diff --git a/docs/man-page/medley.1 b/docs/man-page/medley.1 index c73c1f9c..dfa3dd34 100644 --- a/docs/man-page/medley.1 +++ b/docs/man-page/medley.1 @@ -395,6 +395,18 @@ This can cause issues with medley code that detects Xvnc server failures. Setting this flag notifies Medley that very short Medley sessions are possible and the Xvnc error detection needs to be adjusted accordingly. +.TP +-br [\f[I]BRANCH\f[R] | -], --branch [\f[I]BRANCH\f[R] | -] +By default, sysout files are loaded from the MEDLEYDIR/loadups +directory. +If \[lq]--branch \f[I]BRANCH\f[R]\[rq] is specified, then by default +sysout files are loaded from the MEDLEYDIR/loadups/branches/BRANCH +directory. +The sysouts in these directories are created using a loadups script with +the --branch flag set. +See the loadup man page. +If \f[I]BRANCH\f[R] is \[lq]-\[rq], then the name of the active git +branch for MEDLEYDIR (if any) is used as \f[I]BRANCH\f[R]. .SS Other Options .PP \ diff --git a/docs/man-page/medley.1.gz b/docs/man-page/medley.1.gz index 95dd0cf3..feaa2ac3 100644 Binary files a/docs/man-page/medley.1.gz and b/docs/man-page/medley.1.gz differ diff --git a/docs/man-page/medley.1.md b/docs/man-page/medley.1.md index 425e6a30..44bbf114 100644 --- a/docs/man-page/medley.1.md +++ b/docs/man-page/medley.1.md @@ -263,6 +263,15 @@ specified in the Medley file system, not the host Windows file system. will run for a very short time (< a couple of seconds). This can cause issues with medley code that detects Xvnc server failures. Setting this flag notifies Medley that very short Medley sessions are possible and the Xvnc error detection needs to be adjusted accordingly. +-br [*BRANCH* | -], \-\-branch [*BRANCH* | -] +: By default, sysout files are loaded from the MEDLEYDIR/loadups directory. +If "\-\-branch *BRANCH*" is specified, then by default sysout files are loaded from the +MEDLEYDIR/loadups/branches/BRANCH directory. The sysouts in these directories are created using +a loadups script with the \-\-branch flag set. See the loadup man page. +If *BRANCH* is "-", then the name of the active git branch for MEDLEYDIR (if any) is used as +*BRANCH*. + + Other Options ------------- diff --git a/internal/loadups/man-page/loadup.1 b/internal/loadups/man-page/loadup.1 index f670bcd8..699c7734 100644 --- a/internal/loadups/man-page/loadup.1 +++ b/internal/loadups/man-page/loadup.1 @@ -1,5 +1,19 @@ -.\" Automatically generated by Pandoc 2.9.2.1 +.\" 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 @@ -8,7 +22,8 @@ \f[B]loadup\f[R] \[em] runs a loadup procedure for Medley Interlisp .SH SYNOPSIS .PP -\f[B]/scripts/loadup\f[R] [ options \&... ] +\f[B]/scripts/loadup\f[R] [ options \&... +] .SH DESCRIPTION .PP Runs all or part of the \f[B]loadup\f[R] procedure for Medley Interlisp. @@ -83,7 +98,7 @@ source code included in full.sysout. .RE .PP Loadup does all of its work in a work directory -(loadups/build). +(/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 @@ -91,6 +106,11 @@ terminal output from within the Medley environment. These dribble files are also copied to the loadups directory, but also remain available in the work directory after the loadup completes. .PP +If is a git directory, then a file is created in the loadups +output directory called \f[I]gitinfo\f[R] which contains the git commit, +git branch and git status information for the directory at the time the +loadup is run. +.PP Only one instance (per ) of loadup can be run at a time. There is lock file to prevent simultaneous loadups in the work directory (named \f[B]\f[BI]lock\f[B]\f[R]) that can be manually removed. @@ -246,6 +266,20 @@ simultaneously. If this flag is not set and an active lock is encountered, the user will be asked to choose whether to override or exit. .TP +\f[B]-br [ BRANCH | -], --branch [ BRANCH | - ]\f[R] +By default the sysouts and other files produced by loadup are placed at +the top level of the /loadups directory. +If this flag is specified, then the sysout and other output files are +placed in the directory /loadups/branches/BRANCH. +If BRANCH is \[lq]-\[rq] or not specified at all, then BRANCH is the +name of the currently active git branch of , except if git is +not installled on the current system or if is not a git +directory, in which case then this flag is ignored. +BRANCH can contain alphanumerics, dashes, underscores,and periods. +Any other character is replaced by an underscore. +The medley script has a corresponding --branch argument to load these +sysout files. +.TP \f[B]-nc, --nocopy, -nocopy\f[R] Run the specified loadups, but do not copy results into loadups directory. diff --git a/internal/loadups/man-page/loadup.1.gz b/internal/loadups/man-page/loadup.1.gz index 24bd928a..2b49a35e 100644 Binary files a/internal/loadups/man-page/loadup.1.gz and b/internal/loadups/man-page/loadup.1.gz differ diff --git a/internal/loadups/man-page/loadup.1.md b/internal/loadups/man-page/loadup.1.md index 117f1881..1d914475 100644 --- a/internal/loadups/man-page/loadup.1.md +++ b/internal/loadups/man-page/loadup.1.md @@ -48,8 +48,9 @@ The two independent stages that can be run if the first 4 sequential stages comp >+ **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 (\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 also copied to the loadups directory, but also remain available in the work directory after the loadup completes. +Loadup does all of its work in a work directory (\/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 also copied to the loadups directory, but also remain available in the work directory after the loadup completes. +If \ is a git directory, then a file is created in the loadups output directory called *gitinfo* which contains the git commit, git branch and git status information for the directory at the time the loadup is run. Only one instance (per \) of loadup can be run at a time. There is lock file to prevent simultaneous loadups in the work directory (named ***lock***) that can be manually removed. The lock can also be automatically overridden (see the --override flag below). Alternatively, if a lock is encountered at run time, the user will be asked to choose whether to override or simply exit the loadup. @@ -123,6 +124,17 @@ OPTIONS **-ov, \-\-override, -override** : Automatically override the lock that prevents two loadups from running simultaneously. If this flag is not set and an active lock is encountered, the user will be asked to choose whether to override or exit. +**-br [ BRANCH | -], \-\-branch [ BRANCH | - ]** +: By default the sysouts and other files produced by loadup are placed at the top level of +the \/loadups directory. If this flag is specified, then the sysout and other +output files are placed in the directory \/loadups/branches/BRANCH. +If BRANCH is "-" or not specified at all, then BRANCH is the name of the currently active +git branch of \, except if git is not installled on the current system +or if \ is not a git directory, in which case then this flag is ignored. +BRANCH can contain alphanumerics, dashes, underscores,and periods. +Any other character is replaced by an underscore. +The medley script has a corresponding \-\-branch argument to load these sysout files. + **-nc, \-\-nocopy, -nocopy** : Run the specified loadups, but do not copy results into loadups directory. diff --git a/internal/loadups/man-page/man_loadup.html b/internal/loadups/man-page/man_loadup.html index b11ac2cc..ff5985e8 100644 --- a/internal/loadups/man-page/man_loadup.html +++ b/internal/loadups/man-page/man_loadup.html @@ -1,159 +1,305 @@

NAME

-

loadup — runs a loadup procedure for Medley Interlisp

+

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.

+

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. +
  3. 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.

    -
  1. 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.

  2. +
  3. 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.

    -
  1. 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.

  2. +
  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.

    -
  1. 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.

  2. +
  3. 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.

    -
  1. Apps:: create apps.sysout. Apps.sysout includes everything in full.sysout plus the Medley applications Buttons, CLOS, Rooms, and Notecards.

  2. +
  3. 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:

+

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.

  • +
  • 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 also copied to the loadups directory, but also remain available in the work directory after the loadup completes.

-

Only one instance (per <MEDLEIDIR>) of loadup can be run at a time. There is lock file to prevent simultaneous loadups in the work directory (named lock) that can be manually removed. The lock can also be automatically overridden (see the –override flag below). Alternatively, if a lock is encountered at run time, the user will be asked to choose whether to override or simply exit the loadup.

-

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.

+

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 also copied to the loadups directory, but also remain available in +the work directory after the loadup completes.

+

If <MEDLEYDIR> is a git directory, then a file is created in +the loadups output directory called gitinfo which contains the +git commit, git branch and git status information for the directory at +the time the loadup is run.

+

Only one instance (per <MEDLEIDIR>) of loadup can be run at a +time. There is lock file to prevent simultaneous loadups in the work +directory (named lock) that can be manually +removed. The lock can also be automatically overridden (see the +–override flag below). Alternatively, if a lock is encountered at run +time, the user will be asked to choose whether to override or simply +exit the loadup.

+

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.

+
+

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.

+
+

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.

+

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.

+

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.

+

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.

+

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). +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.

+

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.

+
+

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.

+

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).

+

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).

+

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)

+

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).

+

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.

+
+

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.

+
+

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”

+
+

Synonym for “–target init”

-m, --mid, -mid, -2
-

Synonym for “–target mid”

+
+

Synonym for “–target mid”

-l, --lisp, -lisp, -3
-

Synonym for “–target lisp”

+
+

Synonym for “–target lisp”

-f, --full. -full, -4
-

Synonym for “–target full”

+
+

Synonym for “–target full”

-a, --apps, -apps, -5
-

Synonym for “–target apps”

+
+

Synonym for “–target apps”

-a-, --apps-, -apps-, -5-
-

Synonym for “–target apps”

+
+

Synonym for “–target apps”

-ov, --override, -override
-

Automatically override the lock that prevents two loadups from running simultaneously. If this flag is not set and an active lock is encountered, the user will be asked to choose whether to override or exit.

+
+

Automatically override the lock that prevents two loadups from +running simultaneously. If this flag is not set and an active lock is +encountered, the user will be asked to choose whether to override or +exit.

+
+
-br [ BRANCH | -], --branch [ BRANCH | - ]
+
+

By default the sysouts and other files produced by loadup are placed +at the top level of the <MEDLEYDIR>/loadups directory. If this +flag is specified, then the sysout and other output files are placed in +the directory <MEDLEYDIR>/loadups/branches/BRANCH. If BRANCH is +“-” or not specified at all, then BRANCH is the name of the currently +active git branch of <MEDLEYDIR>, except if git is not installled +on the current system or if <MEDLEYDIR> is not a git directory, in +which case then this flag is ignored. BRANCH can contain alphanumerics, +dashes, underscores,and periods. Any other character is replaced by an +underscore. The medley script has a corresponding --branch argument to +load these sysout files.

-nc, --nocopy, -nocopy
-

Run the specified loadups, but do not copy results into loadups directory.

+
+

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.

+
+

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.

+
+

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.

+
+

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.

-v, --vnc, -vnc
-

Relevant to Linux (including WSLv1 and WSLv2) platforms only. Use Xvnc for the Medley display during this loadup. By default, the Medley display will use X Windows. This flag is most useful on Windows System for Linux v1, where Xvnc is commonly used in running Medley in the absence of an Xwindows server.

+
+

Relevant to Linux (including WSLv1 and WSLv2) platforms only. Use +Xvnc for the Medley display during this loadup. By default, the Medley +display will use X Windows. This flag is most useful on Windows System +for Linux v1, where Xvnc is commonly used in running Medley in the +absence of an Xwindows server.

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.

+

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:

    +
  2. 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.

  3. -
  4. If neither –start nor –target are specified but either -aux or -db or both are, then –start defaults to full and –target is irrelevant.

  5. -
  6. If –start is specified and –target is not, then –target defaults to full

  7. -
  8. If –target is specified and –start is not, then –start defaults to 0

  9. +

    1B. If either –thinw or –thinl are specified, no loadups are +run.

    +
  10. If neither –start nor –target are specified but either -aux or +-db or both are, then –start defaults to full and –target is +irrelevant.

  11. +
  12. If –start is specified and –target is not, then –target defaults +to full

  13. +
  14. 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.

+

./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>

+

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

COPYRIGHT

Copyright(c) 2025 by Interlisp.org

diff --git a/scripts/loadups/loadup b/scripts/loadups/loadup index 17ea8e31..608373e1 100755 --- a/scripts/loadups/loadup +++ b/scripts/loadups/loadup @@ -3,9 +3,6 @@ main() { - # shellcheck source=./loadup-setup.sh - . "${LOADUP_SCRIPTDIR}/loadup-setup.sh" - # process args start="" start_s="" @@ -20,6 +17,9 @@ main() { override_lock=false ignore_lock=false export LOADUP_USE_VNC="-" + man_flg=false + use_branch="" + branch_requested=false while [ "$#" -ne 0 ]; do @@ -123,6 +123,22 @@ main() { end=1 end_s=init ;; + -br | -branch | --branch) + branch_requested=true + if [ "$2" = "-" ] + then + use_branch="-" + shift + else + if check_for_no_arg "$2" + then + use_branch="-" + else + use_branch="$2" + shift + fi + fi + ;; -nc | -nocopy | --nocopy) nocopy=true ;; @@ -168,13 +184,7 @@ main() { force_vnc="+" ;; -z | -man | --man ) - if [ "$(uname)" = "Darwin" ] - then - /usr/bin/man "${LOADUP_SOURCEDIR}/man-page/loadup.1.gz" - else - /usr/bin/man -l "${LOADUP_SOURCEDIR}/man-page/loadup.1.gz" - fi - exit 0 + man_flg=true ;; *) output_error_msg "Error: unknown flag: $1${EOL}Exiting" @@ -184,6 +194,27 @@ main() { shift done + # + # Source loadup-setup.sh script to set all the standard loadup env variables + # + + # shellcheck source=./loadup-setup.sh + . "${LOADUP_SCRIPTDIR}/loadup-setup.sh" + + # + # if --man flag is set, then show man page and exit + # + if [ "${man_flg}" = true ] + then + if [ "$(uname)" = "Darwin" ] + then + /usr/bin/man "${LOADUP_SOURCEDIR}/man-page/loadup.1.gz" + else + /usr/bin/man -l "${LOADUP_SOURCEDIR}/man-page/loadup.1.gz" + fi + exit 0 + fi + # # # check arguments @@ -192,6 +223,12 @@ main() { no_loadups=false + # check --branch is used correctly + if [ "${branch_requested}" = true ] && [ -z "${use_branch}" ] + then + output_warn_msg "The --branch (-br) flag was used. But either git is not installed on this system or \"${LOADUP_SOURCEDIR}\" is not a git directory.${EOL}The --branch flag will be ignored" + fi + # # check for no args or only maikodir arg and set defaults appropriately # @@ -299,6 +336,16 @@ main() { fi fi + # + # Save git informatiom into LOADUP_OUTDIR + # + + if [ -n "${LOADUP_COMMIT_ID}" ] + then + echo "Commit: ${LOADUP_COMMIT_ID}" > "${LOADUP_OUTDIR}"/gitinfo + git status >> "${LOADUP_OUTDIR}"/gitinfo + fi + # # Do individual "stage" loadups as requested # @@ -433,7 +480,6 @@ main() { fi fi - # # OK we're done, exit cleanly # @@ -443,6 +489,43 @@ main() { } +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}" +} + +check_for_no_arg() { + if [ -z "$1" ] + then + return 0 + else + case "$1" in + -*) + return 0 + ;; + *) + return 1 + ;; + esac + fi +} + + # shellcheck disable=SC2164,SC2034 if [ -z "${LOADUP_SCRIPTDIR}" ] diff --git a/scripts/loadups/loadup-apps-from-full.sh b/scripts/loadups/loadup-apps-from-full.sh index fc69eff9..fa757ffc 100755 --- a/scripts/loadups/loadup-apps-from-full.sh +++ b/scripts/loadups/loadup-apps-from-full.sh @@ -32,10 +32,20 @@ main() { exit 1 fi - git_commit_ID "${NOTECARDSDIR}" + git_commit_info "${NOTECARDSDIR}" NOTECARDS_COMMIT_ID="${COMMIT_ID}" export NOTECARDS_COMMIT_ID + if [ -n "${NOTECARDS_COMMIT_ID}" ] + then + { + echo ; + echo "--------------------------------------------" ; + echo "Notecards Commit: ${NOTECARDS_COMMIT_ID}" ; + git -C "${NOTECARDSDIR}" status ; + } >> "${LOADUP_OUTDIR}/gitinfo" + fi + initfile="-" cat >"${cmfile}" <<-EOF " diff --git a/scripts/loadups/loadup-setup.sh b/scripts/loadups/loadup-setup.sh index e6b46e79..7c5a4e78 100644 --- a/scripts/loadups/loadup-setup.sh +++ b/scripts/loadups/loadup-setup.sh @@ -12,10 +12,38 @@ then export LOADUP_SOURCEDIR fi +git_commit_info () { + if [ -f "$(command -v git)" ] && [ -x "$(command -v git)" ] + then + if git -C "$1" rev-parse >/dev/null 2>/dev/null + then + # This does NOT indicate if there are any modified files! + COMMIT_ID="$(git -C "$1" rev-parse --short HEAD)" + BRANCH="$(git -C "$1" rev-parse --abbrev-ref HEAD)" + fi + fi +} + +git_commit_info "${LOADUP_SOURCEDIR}" +export LOADUP_COMMIT_ID="${COMMIT_ID}" +export LOADUP_BRANCH="${BRANCH}" + +if [ "${use_branch}" = "-" ] +then + use_branch="${LOADUP_BRANCH}" +fi + +slash_branch="" +if [ -n "${use_branch}" ] +then + use_branch="$(printf %s "${use_branch}" | sed "s/[^a-zA-Z0-9_.-]/_/g")" + slash_branch="/branches/${use_branch}" +fi + + if [ -z "${LOADUP_OUTDIR}" ] then - LOADUP_OUTDIR="${MEDLEYDIR}/loadups" - export LOADUP_OUTDIR + export LOADUP_OUTDIR="${MEDLEYDIR}/loadups${slash_branch}" fi if [ ! -d "${LOADUP_OUTDIR}" ]; @@ -63,43 +91,13 @@ then 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") +script_name_for_id=$(echo "${script_name}" | sed -e "s/-/_/g") cmfile="${LOADUP_WORKDIR}/${script_name}.cm" initfile="${LOADUP_WORKDIR}/${script_name}.init" @@ -165,7 +163,7 @@ force_vnc="-" run_medley () { /bin/sh "${MEDLEYDIR}/scripts/medley/medley.command" \ --config - \ - --id loadup_+ \ + --id "${script_name_for_id}_+" \ --geometry "${geometry}" \ --noscroll \ --logindir "${LOADUP_LOGINDIR}" \ @@ -187,6 +185,7 @@ fi EOL=" " + output_error_msg() { local_oem_file="${TMPDIR:-/tmp}"/oem_$$ echo "$1" >"${local_oem_file}" diff --git a/scripts/medley/medley.command b/scripts/medley/medley.command index 544b9cec..91e62dda 100755 --- a/scripts/medley/medley.command +++ b/scripts/medley/medley.command @@ -161,6 +161,9 @@ SCRIPTDIR="$(get_script_dir "$0")" is_tput="$(command -v tput)" +export EOL=" +" + output_error_msg() { local_oem_file="${TMPDIR:-/tmp}"/oem_$$ echo "$1" >"${local_oem_file}" @@ -176,6 +179,16 @@ output_error_msg() { 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}" +} + check_for_dash_or_end() { local_err_msg=""; if [ -z "$2" ] || [ "$2" = "--" ] @@ -309,6 +322,19 @@ parse_nethub_data() { } +git_commit_info () { + if [ -f "$(command -v git)" ] && [ -x "$(command -v git)" ] + then + if git -C "$1" rev-parse >/dev/null 2>/dev/null + then + # This does NOT indicate if there are any modified files! + COMMIT_ID="$(git -C "$1" rev-parse --short HEAD)" + BRANCH="$(git -C "$1" rev-parse --abbrev-ref HEAD)" + fi + fi +} + + MEDLEYDIR="$(cd "${SCRIPTDIR}/../.."; pwd)" export MEDLEYDIR IL_DIR="$(cd "${MEDLEYDIR}/.."; pwd)" @@ -641,6 +667,7 @@ borderwidth_arg="" remcm_arg="${LDEREMCM}" repeat_cm="" automation=false +use_branch="" # Add marker at end of args so we can accumulate pass-on args in args array set -- "$@" "--start_of_pass_args" @@ -655,6 +682,16 @@ do sysout_arg="apps" sysout_stage="${args_stage}" ;; + -br | -branch | --branch) + if [ "$2" = "-" ] + then + use_branch="-" + else + check_for_dash_or_end "$1" "$2" + use_branch="$2" + fi + shift + ;; -c | --config) # already handled so just skip both flag and value shift; @@ -1008,7 +1045,6 @@ do shift done - # Process run_id # if it doesn't end in #, make sure that there is not another instance currently running with this same id # If it does end in #, find the right number to fill in for the # @@ -1098,9 +1134,69 @@ else fi export LDEDESTSYSOUT +# expand on use_branch, if needed + +if [ "${use_branch}" = "-" ] +then + git_commit_info "${MEDLEYDIR}" + use_branch="${BRANCH}" + if [ -z "${use_branch}" ] + then + output_warn_msg "A \"--branch -\" (\"-br -\") argument was given on the command line.${EOL}But either there is no git installed on this system or MEDLEYDIR (\"${MEDLEYDIR}\") is not a git directory.${EOL}Ignoring --branch argument.${EOL}" + fi +fi + +# clean use_branch of no alphanumeric chars + +if [ -n "${use_branch}" ] +then + use_branch="$(printf %s "${use_branch}" | sed "s/[^a-zA-Z0-9_.-]/_/g")" +fi + +# Figure out the branch/loadupsdir situation + +slash_branch="" +if [ -n "${use_branch}" ] +then + branches_dir="${MEDLEYDIR}/loadups/branches" + mkdir -p "${branches_dir}" + matches="$(cd "${branches_dir}" && ls -d "${use_branch}"*)" + echo ${matches} + if [ -z "${matches}" ] + then + output_error_msg "The \"--branch ${use_branch}\" argument was given on the command line${EOL}but a directory matching \"${branches_dir}/${use_branch}*\" does not exist.${EOL}Exiting." + exit 1 + else + count=0 + new_branch="" + for match in ${matches} + do + if [ "${match}" = "${use_branch}" ] + then + new_branch="${match}" + count=1 + break + else + new_branch="${match}" + count=$((count + 1)) + fi + done + if [ "${count}" -ge 2 ] + then + output_error_msg "The \"--branch ${use_branch}\" argument was given on the command line${EOL}but more than one subdirectory in \"${branches_dir}\" matches \"${use_branch}*\".${EOL}Exiting." + exit 1 + else + use_branch="${new_branch}" + fi + slash_branch="/branches/${use_branch}" + fi +fi + +loadups_dir="${MEDLEYDIR}/loadups${slash_branch}" +export MEDLEY_LOADUPS_DIR="${loadups_dir}" + # Figure out the sysout situation -loadups_dir="${MEDLEYDIR}/loadups" if [ -z "${sysout_arg}" ] then if [ -f "${LDEDESTSYSOUT}" ] @@ -1119,7 +1215,7 @@ but the directory \"${loadups_dir}\" where ${sysout_arg}.sysout is supposed to b cannot be found. Exiting." output_error_msg "${err_msg}" - exit 62 + exit 1 fi src_sysout="${loadups_dir}/${sysout_arg}.sysout" ;; @@ -1133,6 +1229,7 @@ then err_msg="Error: Cannot find the specified sysout file \"${src_sysout}\". Exiting." output_error_msg "${err_msg}" + exit 1 fi # Figure out screensize and geometry based on arguments @@ -1313,15 +1410,21 @@ fi # figure out title situation if [ -z "${title}" ] then - title="Medley Interlisp %i" + title="Medley%b%i" fi -if [ ! "${run_id}" = default ] +if [ "${run_id}" = default ] then - title="$(printf %s "${title}" | sed -e "s/%i/:: ${run_id}/")" -else title="$(printf %s "${title}" | sed -e "s/%i//")" +else + title="$(printf %s "${title}" | sed -e "s/%i/::${run_id}/")" +fi +if [ -n "${use_branch}" ] +then + short_branch="$(printf "%0.16s" "${use_branch}")" + title="$(printf %s "${title}" | sed -e "s/%b/::${short_branch}/")" +else + title="$(printf %s "${title}" | sed -e "s/%b//")" fi - # Figure out the maiko executable name # used for loadups (ldeinit) diff --git a/scripts/medley/medley_args.sh b/scripts/medley/medley_args.sh index 8920aa06..6fc754ea 100755 --- a/scripts/medley/medley_args.sh +++ b/scripts/medley/medley_args.sh @@ -49,6 +49,7 @@ borderwidth_arg="" remcm_arg="${LDEREMCM}" repeat_cm="" automation=false +use_branch="" # Add marker at end of args so we can accumulate pass-on args in args array set -- "$@" "--start_of_pass_args" @@ -63,6 +64,16 @@ do sysout_arg="apps" sysout_stage="${args_stage}" ;; + -br | -branch | --branch) + if [ "$2" = "-" ] + then + use_branch="-" + else + check_for_dash_or_end "$1" "$2" + use_branch="$2" + fi + shift + ;; -c | --config) # already handled so just skip both flag and value shift; @@ -415,4 +426,3 @@ do fi shift done - diff --git a/scripts/medley/medley_run.sh b/scripts/medley/medley_run.sh index 6bed350f..4c9a22a2 100644 --- a/scripts/medley/medley_run.sh +++ b/scripts/medley/medley_run.sh @@ -52,9 +52,69 @@ else fi export LDEDESTSYSOUT +# expand on use_branch, if needed + +if [ "${use_branch}" = "-" ] +then + git_commit_info "${MEDLEYDIR}" + use_branch="${BRANCH}" + if [ -z "${use_branch}" ] + then + output_warn_msg "A \"--branch -\" (\"-br -\") argument was given on the command line.${EOL}But either there is no git installed on this system or MEDLEYDIR (\"${MEDLEYDIR}\") is not a git directory.${EOL}Ignoring --branch argument.${EOL}" + fi +fi + +# clean use_branch of no alphanumeric chars + +if [ -n "${use_branch}" ] +then + use_branch="$(printf %s "${use_branch}" | sed "s/[^a-zA-Z0-9_.-]/_/g")" +fi + +# Figure out the branch/loadupsdir situation + +slash_branch="" +if [ -n "${use_branch}" ] +then + branches_dir="${MEDLEYDIR}/loadups/branches" + mkdir -p "${branches_dir}" + matches="$(cd "${branches_dir}" && ls -d "${use_branch}"*)" + echo ${matches} + if [ -z "${matches}" ] + then + output_error_msg "The \"--branch ${use_branch}\" argument was given on the command line${EOL}but a directory matching \"${branches_dir}/${use_branch}*\" does not exist.${EOL}Exiting." + exit 1 + else + count=0 + new_branch="" + for match in ${matches} + do + if [ "${match}" = "${use_branch}" ] + then + new_branch="${match}" + count=1 + break + else + new_branch="${match}" + count=$((count + 1)) + fi + done + if [ "${count}" -ge 2 ] + then + output_error_msg "The \"--branch ${use_branch}\" argument was given on the command line${EOL}but more than one subdirectory in \"${branches_dir}\" matches \"${use_branch}*\".${EOL}Exiting." + exit 1 + else + use_branch="${new_branch}" + fi + slash_branch="/branches/${use_branch}" + fi +fi + +loadups_dir="${MEDLEYDIR}/loadups${slash_branch}" +export MEDLEY_LOADUPS_DIR="${loadups_dir}" + # Figure out the sysout situation -loadups_dir="${MEDLEYDIR}/loadups" if [ -z "${sysout_arg}" ] then if [ -f "${LDEDESTSYSOUT}" ] @@ -73,7 +133,7 @@ but the directory \"${loadups_dir}\" where ${sysout_arg}.sysout is supposed to b cannot be found. Exiting." output_error_msg "${err_msg}" - exit 62 + exit 1 fi src_sysout="${loadups_dir}/${sysout_arg}.sysout" ;; @@ -87,6 +147,7 @@ then err_msg="Error: Cannot find the specified sysout file \"${src_sysout}\". Exiting." output_error_msg "${err_msg}" + exit 1 fi # Figure out screensize and geometry based on arguments @@ -188,15 +249,21 @@ fi # figure out title situation if [ -z "${title}" ] then - title="Medley Interlisp %i" + title="Medley%b%i" fi -if [ ! "${run_id}" = default ] +if [ "${run_id}" = default ] then - title="$(printf %s "${title}" | sed -e "s/%i/:: ${run_id}/")" -else title="$(printf %s "${title}" | sed -e "s/%i//")" +else + title="$(printf %s "${title}" | sed -e "s/%i/::${run_id}/")" +fi +if [ -n "${use_branch}" ] +then + short_branch="$(printf "%0.16s" "${use_branch}")" + title="$(printf %s "${title}" | sed -e "s/%b/::${short_branch}/")" +else + title="$(printf %s "${title}" | sed -e "s/%b//")" fi - # Figure out the maiko executable name # used for loadups (ldeinit) diff --git a/scripts/medley/medley_utils.sh b/scripts/medley/medley_utils.sh index a16bff7d..81808783 100644 --- a/scripts/medley/medley_utils.sh +++ b/scripts/medley/medley_utils.sh @@ -15,6 +15,9 @@ is_tput="$(command -v tput)" +export EOL=" +" + output_error_msg() { local_oem_file="${TMPDIR:-/tmp}"/oem_$$ echo "$1" >"${local_oem_file}" @@ -30,6 +33,16 @@ output_error_msg() { 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}" +} + check_for_dash_or_end() { local_err_msg=""; if [ -z "$2" ] || [ "$2" = "--" ] @@ -162,3 +175,16 @@ parse_nethub_data() { return 0 } + +git_commit_info () { + if [ -f "$(command -v git)" ] && [ -x "$(command -v git)" ] + then + if git -C "$1" rev-parse >/dev/null 2>/dev/null + then + # This does NOT indicate if there are any modified files! + COMMIT_ID="$(git -C "$1" rev-parse --short HEAD)" + BRANCH="$(git -C "$1" rev-parse --abbrev-ref HEAD)" + fi + fi +} +