Files
cdesktop/cde/programs/dtlogin/config/0050.dtxmodmap.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

116 lines
3.5 KiB
Plaintext

XCOMM!KORNSHELL
XCOMM ####################################################################
XCOMM ## File: 0050.dtxmodmap
XCOMM ##
XCOMM ## Default Location: CDE_INSTALLATION_TOP/config/Xsession.d/
XCOMM ##
XCOMM ## Purpose: Perform keyboard mapping
XCOMM ##
XCOMM ## Description:
XCOMM ## This script is invoked by means of the Xsession file
XCOMM ## at user login. It invokes xmodmap to setup the
XCOMM ## keyboard mapping required for selected locales.
XCOMM ##
XCOMM ## Invoked by: CDE_INSTALLATION_TOP/bin/Xsession
XCOMM ##
XCOMM ## Product: @(#)Common Desktop Environment 1.0
XCOMM ##
XCOMM ## Note:
XCOMM ##
XCOMM ## The CDE_INSTALLATION_TOP/config/Xsession.d/0050.dtxmodmap file is a
XCOMM ## factory-default file and will be unconditionally overwritten upon
XCOMM ## subsequent installation. To customize keyboard mapping
XCOMM ## behavior, copy this file to the configuration directory,
XCOMM ## CDE_CONFIGURATION_TOP/config/Xsession.d and customize that version
XCOMM ## of the file.
XCOMM ##
XCOMM ## Revision: $XConsortium: 0050.dtxmodmap.src /main/5 1996/07/18 15:26:04 drk $
XCOMM ##
XCOMM ## (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM ## (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM ## (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM ## (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM ## Novell, Inc.
XCOMM ##
XCOMM ####################################################################
XCOMM
XCOMM Determine the xmodmap keyboard to be used.
XCOMM
sys_version=`uname -v`
if [ "$sys_version" = "3" ]
then
Cname=C.hft
else
Cname=C
fi
if [ ${DISPLAY%.*} = ":0" ]
then
KBD=""
XDIR=/usr/lpp/X11/defaults/xmodmap
KBD_LANG=`/usr/lpp/X11/bin/querykbd`
if [ "$KBD_LANG" = "NULL" ]
then
dspmsg $XINITRCMSG/xinit.cat 2 'xinit: Odm keyboard id is NULL.\n'
else
if [ "$KBD_LANG" != "$Cname" ]
then
if [ -r $IMKEYMAPPATH/$KBD_LANG/keyboard ]
then
KBD=$IMKEYMAPPATH/$KBD_LANG/keyboard
else
if [ "$IMKEYMAPPATH" = "/usr/lib/nls/im.alt" ]
then
if [ "$sys_version" = "3" /
-a -r $XDIR/$KBD_LANG/keyboard.alt ]
then
KBD=$XDIR/$KBD_LANG/keyboard.alt
else
if [ -r $XDIR/${KBD_LANG}@alt/keyboard ]
then
KBD=$XDIR/${KBD_LANG}@alt/keyboard
fi
fi
fi
if [ "$KBD" = "" ]
then
if [ -r $XDIR/$KBD_LANG/keyboard ]
then
KBD=$XDIR/$KBD_LANG/keyboard
fi
fi
fi
fi
fi
if [ "$KBD" != "" ]
then
xmodmap $KBD
else
if [ "$IMKEYMAPPATH" = "/usr/lib/nls/im.alt" ]
then
if [ "$sys_version" = "3" /
-a -r $XDIR/$KBD_LANG/keyboard.alt ]
then
xmodmap $XDIR/$KBD_LANG/keyboard.alt
exit
fi
if [ -r $XDIR/${KBD_LANG}@alt/keyboard ]
then
xmodmap $XDIR/${KBD_LANG}@alt/keyboard
exit
fi
fi
if [ -r $XDIR/$LANG/keyboard ]
then
xmodmap $XDIR/$LANG/keyboard
fi
fi
fi
XCOMM ######################### eof #####################