1
0
mirror of synced 2026-01-29 13:31:48 +00:00
Files
Interlisp.medley/scripts/medley/medley_args.sh
Frank Halasz f2ef7cc8f6 Installers for Linux: workflow changes and more to support standard Linux installations (#1058)
* Adding LANG environment variable to docker image; adding MAIKO_ and MEDLEY_INSTALLDIR environment variables; Changing /usr/local/bin/run-medley to a symbolic link instead of a shell script

* Added draft input to all workflows, so that can create draft releases as well as regular releases

* Update buildDocker.yml to handle deprecation of set-output and to update versions of actions to handle node 12 to node 16 transition.

* Added scripts and updated github workflows to support creation of deb installers for Linux and WSL

* Fix minor bug in buildLoadup.yml

* First pass implementation of deb installer

* Fixing wget of vncviewer in build_deb.sh

* Fix typo in buildLoadup.yml in call to build_deb.sh

* Multiple small fixes to medley.sh from debugging.  Change postinst script and how its created in build_deb.  Add postrm script in build_deb.

* Reworking vnc portion of Medley.sh - including removing dependency on startx and xinit

* Misc fixes to medley_vnc.sh script; fix creation of postinst and postrm in build_deb.sh

* Cleaning up window geometry amd screen size in medley.sh

* Created apps.sysout loadup with rooms, notecards, clos on top of full.sysout; added plumbing for -apps flag to run-medley to run this syout; created a new init file for this sysout that calls MEDLEYDIR-INIT;  all of this is based on online.sysout

* Create UNIXUTILS file in library with ShellWhich function - linux which command equivalent.  Also move ShellCommand from UNIXPRINT to UNIXUTILS.

* Adding UNIXUTILS to LOADUP-FULL so it gets included in full.sysout

* Change of names from open(er) to browse(r). Refine the browse(r) functions a bit

* Minor bug fixes

* Update Apps.ShowDoc to new ShellBrowsefunction

* Adding apps support into the .github builds;  adding xdg-utils as dependecy in debs

* fixing bug as to where notecards is checked out in BuildLoadup.  Needs to be before loadups so app.sysout can be built

* Added defaulting to Interlisp exec tomedley.sh and APPS-INIT.  Works only in apps.sysout.  Added wlsu package to wsl debs since wlsview is not always installed by defailt.  Fixed Notefiles directories issues in Apps.Init.   Made medley.sh compute medleydir based on where the script is located. Can now work for /usr/lcal/interlisp as well as local directories.

* Added -id - feature to medley.sh so id can be directory mae.  Removed extraneous set -x commands in medley.sh from debugging.  In build_deb.sh changed compression to xz for deb files since debian does not support the zstd compression that ubuntu uses.

* For wsl deb files, make sure wslu package is not 4.0 - which is bad.  Change how we choose an open port and open display in medley_vnc.sh.  Add notecards download to build_deb.sh.  Fix type in medley.sh

* Add (FILES UNIXUTILS) to UNIXPRINTCOMS so that ShellCommand is loaded in case only UNIXPRINT is loaded.  For backward compatibility.

* Moved medley.sh and associates to script/medley dir; fixed up args to medley.sh;  added usage and --help to medley.sh

* Add comprehensive tar files to releases to match deb files for local installs; add --id -- arg to medley.sh

* Remove remaining reference to usr/local/interlisp to ensure local install works

* Fix bug in buildLoadup - couldn't file install tars

* Add medley symbolic linkto loadups, so it comes thru to local install tars

* Fix up error messaging in medley.sh scripts

* Created man page for medley and added it throughout build up, installers, etc.

* Add support for a downloads page on OIO, including creating said page while building a release

* Fix full_release_tag in downloads section of buildLoadup.yml

* Misc fixups on downloads page

* Adding online man page stored on oio static server.

* Fix minor bug in man installation in deb file
2023-01-30 22:19:07 -08:00

205 lines
4.7 KiB
Bash

###############################################################################
#
# medley_args.sh - script for processing the args to medley.sh script.
#
# !!!! This script is meant to be SOURCEd from the scripts/medley.sh script.
# !!!! It should not be run as a standlone script.
#
# 2023-01-12 Frank Halasz
#
# Copyright 2023 Interlisp.org
#
###############################################################################
# load usage function
source ${SCRIPTDIR}/medley_usage.sh
# Process args
run_args=()
run_id="default"
use_vnc='false'
geometry=""
screensize=""
noscroll='false'
pass_args=false
lisp_flag=false
full_flag=false
apps_flag=false
sysout_flag=false
sysout_arg=""
err_msg=""
greet_specified='false'
while [ "$#" -ne 0 ];
do
if [ ${pass_args} = false ];
then
case "$1" in
-i | --id)
if [ "$2" = "-" ];
then
run_id=$( basename ${MEDLEYDIR} )
elif [ "$2" = "--" ];
then
run_id=$(cd ${MEDLEYDIR}; cd ..; basename $(pwd))
else
check_for_dash_or_end "$1" "$2"
run_id=$(echo "$2" | sed s/[^A-Za-z0-9]//g)
fi
shift
;;
-v | --vnc)
if [[ ${wsl} = true && $(uname -m) = x86_64 ]];
then
use_vnc=true
else
echo "Warning: The -v or --vnc flag was set."
echo "But the vnc option is only available when running on "
echo "Windows System for Linux (wsl) on x86_64 machines."
echo "Ignoring the -v or --vnc flag."
use_vnc=false
fi
;;
-g | --geometry)
check_for_dash_or_end "$1" "$2"
geometry="$2"
shift
;;
-s | --screensize)
check_for_dash_or_end "$1" "$2"
screensize="$2"
shift
;;
-n | --noscroll)
noscroll=true
run_args+=("-noscroll")
;;
-e | --interlisp)
export MEDLEY_EXEC="inter"
;;
-a | --apps)
sysout_arg="apps"
apps_flag=true
;;
-f | --full)
sysout_arg="-full"
full_flag=true
;;
-l | --lisp)
sysout_arg="-lisp"
lisp_flag=true
;;
-m | --mem)
check_for_dash_or_end "$1" "$2"
run_args+=(-m $2)
shift
;;
-t | --title)
check_for_dash_or_end "$1" "$2"
run_args+=(-title $2)
shift
;;
-d | --display)
check_for_dash_or_end "$1" "$2"
run_args+=(-d $2)
shift
;;
-r | --greet)
if [[ "$2" = "-" || "$2" = "--" ]];
then
run_args+=("--nogreet")
else
check_for_dash_or_end "$1" "$2"
check_file_readable "$1" "$2"
run_args+=("-greet" "$2")
fi
greet_specified='true'
shift
;;
-p | --vmem)
check_for_dash_or_end "$1" "$2"
check_file_writeable_or_creatable "$1" "$2"
export LDEDESTSYSOUT="$2"
shift
;;
-x | --logindir)
if [[ "$2" = "-" || "$2" = "--" ]];
then
check_dir_writeable_or_creatable "$1" "${MEDLEYDIR}/logindir"
LOGINDIR="${MEDLEYDIR}/logindir"
else
check_for_dash_or_end "$1" "$2"
check_dir_writeable_or_creatable "$1" "$2"
LOGINDIR="$2"
fi
shift
;;
-h | --help)
usage
;;
-z | --man)
/usr/bin/man -l "${MEDLEYDIR}/docs/man-page/medley.1.gz"
exit 0
;;
--)
pass_args=true
;;
-*)
err_msg=("ERROR: Unknown flag: $1" )
usage "${err_msg[@]}"
;;
*)
if [[ $# -eq 1 || "$2" = "--" ]];
then
sysout_flag=true
sysout_arg="$2"
else
err_msg=(
"ERROR: sysout argument must be last argument"
"or last argument before the \"--\" flag"
)
usage "${err_msg[@]}"
fi
;;
esac
else
run_args+=("$1")
fi
shift
done
# Figure out screensize and geometry based on arguments
source ${SCRIPTDIR}/medley_geometry.sh
# Figure out the sysout situation
ctr=0
for x in ${lisp_flag} ${full_flag} ${apps_flag} ${sysout_flag};
do
if [ "${x}" = "true" ];
then
(( ctr++ ))
fi
done
if [ ${ctr} -gt 1 ];
then
err_msg=(
"Error: only one sysout can be specified. Two or more sysouts were specified"
"via the -l (--lisp), -f (--full), -a (--apps) flags and/or a sysout filename"
)
usage "${err_msg[@]}"
fi
if [ "${sysout_arg}" = "apps" ];
then
export LDESRCESYSOUT="$MEDLEYDIR/loadups/apps.sysout"
if [ "${greet_specified}" = "false" ];
then
export LDEINIT="$MEDLEYDIR/greetfiles/APPS-INIT.LCOM"
fi
else
# pass on to run-medley
export LDESRCESYSOUT=""
run_args+=("${sysout_arg}")
fi