Files
cdesktop/cde/programs/dtlogin/config/0015.sun.env.src
Marcin Cieslak 17a33f0430 Use KORNSHELL variable instead of /bin/ksh
This patch removes instances of hardcoded
invocation of /bin/ksh and allows to
replace it with, for, example,
/usr/local/bin/ksh93

Also "ksh93" is accepted whenever "ksh" is.

Tested using the following /bin/ksh:

----8<----
WHAT=`ps -o command= -p $PPID`
msg="Something tried to call /bin/ksh: $PPID: $WHAT"
print -u2 "$msg"
logger user.warn "$msg"
exit 99
----8<----
(Warning: first two lines are FreeBSD specific)

Scripts from Makefiles should now be executed either
with

$(KORNSHELL) korn-shell-script

or

$(SHELL) bourne-shell-script

therefore #!/bin/ksh has not been changed everywhere.

/usr/dt/bin/ scripts have been converted (e.g. Xsession)

Whenever possible Imake and CPP facilities have been used.

For C and C++ programs KORNSHELL needs to be defined to
"/path/to/your/ksh" (with quotes) so that it can make
a valid C constant.

Therefore, when adding KORNSHELL to Imakefile for C files,
you have to add

CXXEXTRA_DEFINES = -DKORNSHELL=\"$(KORNSHELL)\"

or similar (for example, see programs/dtprintinfo)

But for simple shell script substitution we usually change

 LOCAL_CPP_DEFINES = -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \
                     -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
                     -DCDE_LOGFILES_TOP=$(CDE_LOGFILES_TOP)

to:

 LOCAL_CPP_DEFINES = -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \
                     -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
                     -DCDE_LOGFILES_TOP=$(CDE_LOGFILES_TOP) \
                     -DKORNSHELL=$(KORNSHELL) \
                     -DXPROJECTROOT=X11ProjectRoot

since we don't want quotes for shell scripts.
2012-08-23 20:00:43 -06:00

157 lines
4.2 KiB
Plaintext

XCOMM!KORNSHELL
XCOMM ####################################################################
XCOMM ## File: 0015.sun.env.src
XCOMM ##
XCOMM ## Default Location: /usr/dt/config/Xsession.d/
XCOMM ##
XCOMM ## Purpose: Setup various items for Solaris desktop support
XCOMM ##
XCOMM ## Description: This script is invoked by means of the Xsession file
XCOMM ## at user login.
XCOMM ##
XCOMM ## Invoked by: /usr/dt/bin/Xsession
XCOMM ##
XCOMM ## Product: @(#)Common Desktop Environment 1.0
XCOMM ##
XCOMM ## $XConsortium: 0015.sun.env.src /main/3 1996/04/23 11:41:31 drk $
XCOMM ##
XCOMM ## (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM ##
XCOMM ####################################################################
#define HASH #
XCOMM ##########################################################################
XCOMM
XCOMM Directory specifications
XCOMM
XCOMM ##########################################################################
HASH
HASH Set OPENWINHOME
HASH
if [ -z "$OPENWINHOME" ]
then
export OPENWINHOME="/usr/openwin"
fi
HASH
HASH Set MANPATH
HASH
if [ -z "$MANPATH" ]
then
export MANPATH=/usr/man:$OPENWINHOME/share/man
else
export MANPATH=$MANPATH:$OPENWINHOME/share/man
fi
HASH
HASH Set HELPPATH
HASH
if [ -z "$HELPPATH" ]
then
export HELPPATH=$OPENWINHOME/lib/locale:$OPENWINHOME/lib/help
else
export HELPPATH=$HELPPATH:$OPENWINHOME/lib/locale:$OPENWINHOME/lib/help
fi
HASH
HASH Set AnswerBook path
HASH
if [ -z "$AB_CARDCATALOG" ]
then
export AB_CARDCATALOG=/usr/dt/share/answerbooks/$LANG/ab_cardcatalog
else
export AB_CARDCATALOG=/usr/dt/share/answerbooks/$LANG/ab_cardcatalog:$AB_CARDCATALOG
fi
HASH
HASH Set XFILESEARCHPATH
HASH
if [ -z "$XFILESEARCHPATH" ]
then
export XFILESEARCHPATH="$OPENWINHOME/lib/locale/%L/%T/%N%S:$OPENWINHOME/lib/%T/%N%S"
else
export XFILESEARCHPATH="$XFILESEARCHPATH:$OPENWINHOME/lib/locale/%L/%T/%N%S:$OPENWINHOME/lib/%T/%N%S"
fi
HASH Allocate default colormaps for dynamic non-default visuals
if [ -x $OPENWINHOME/bin/cmap_alloc ]
then
$OPENWINHOME/bin/cmap_alloc -allscreens
fi
HASH start virtual keyboard backend
HASH
HASH To start old OpenLook virtual keyboard for use with the OpenLook deskset
HASH applications, uncomment (remove "#" character from) the following 4 lines.
HASH Note, this may add a few extra seconds to your desktop start time.
HASH if [ -x $OPENWINHOME/bin/vkbd ]
HASH then
HASH $OPENWINHOME/bin/vkbd -nopopup &
HASH fi
HASH Init DeskSet colors (for OpenWindow applications)
if [ -x $OPENWINHOME/bin/ds_server_init ]
then
$OPENWINHOME/bin/ds_server_init
fi
HASH Add font paths in $HOME/.OWfontpath
if [ "$DTXSERVERLOCATION" != "remote" ]; then
HASH
HASH Since X server is local,
HASH making one call to xset.
HASH
ADDFONTPATH() {
HASH Combine lines together to make arguments for the xset command
FP=`nawk '
BEGIN { fp="fp+ " }
/^[ ]*$/ { fp=" +fp " ; continue }
{ fontsdir = sprintf("%s%s", $0,"/fonts.dir")
getline fontsdata < fontsdir
if (fontsdata != 0) {
printf("%s%s", fp, $0) ; fp="," ; fontsdata=0 } } ' $1`
if [ -n "$FP" ]; then
eval "$OPENWINHOME/bin/xset $FP"
fi
}
HASH Add personal fontpaths
if [ -r $HOME/.OWfontpath ]; then
ADDFONTPATH $HOME/.OWfontpath
fi
else
HASH
HASH Since X server is not local, we don't know if the font
HASH directories exist on the X server machine, so
HASH setting them one at a time.
HASH
if [ -r $HOME/.OWfontpath ]; then
nawk ' BEGIN {
fp=" fp+ "
XDIR=0
}
/^[ ]*$/ {
fp=" +fp " ; continue }
{cmd = sprintf("%s%s%s%s%s",XDIR,"/xset",fp, $0," 1>/dev/null");
system(cmd); } ' XDIR=$OPENWINHOME/bin .OWfontpath
fi
fi
XCOMM ######################### eof #####################