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

50 lines
2.0 KiB
Plaintext

XCOMM!KORNSHELL
XCOMM $XConsortium: dtlslocale.src /main/6 1996/11/19 11:42:40 drk $
XCOMM
XCOMM Common Desktop Environment
XCOMM
XCOMM (c) Copyright 1996 Digital Equipment Corporation.
XCOMM (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
XCOMM (c) Copyright 1993,1994,1996 International Business Machines Corp.
XCOMM (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
XCOMM (c) Copyright 1996 Novell, Inc.
XCOMM (c) Copyright 1996 FUJITSU LIMITED.
XCOMM (c) Copyright 1996 Hitachi.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM
XCOMM Generate list of installed locales and locale desciptive names
XCOMM
(
echo "LOCALELIST" # indicate start of locale list
/usr/bin/locale -a # generate locale list
echo "LSMLELIST" # indicate start of locale information list
/usr/lib/nls/lsmle -c # generate locale information list
) |
/usr/bin/awk '
/LOCALELIST/ {state=0; next} # start of installed locale list
/LSMLELIST/ {state=1; next} # start of locale information list
state==0 { # processing locale list item
split($0, a, "\."); # split item on blank
lang[a[1]]=" " a[1]; # first element is language name
}
state==1 { # item format is: codeset desc desc [locale]
split($0, a, " "); # split item on blank
name=a[NF]; # get locale name
sub(/\[/, "", name); # strip [
sub(/\]/, "", name); # strip ]
if (name in lang) { # was locale returned by locale -a?
a[NF]=a[1]; # move codeset from front to end of array
delete a[1]; # delete old codeset element in array
lang[name]=""; # blank description
for (i in a) { # use resulting array as desciption
lang[name]=lang[name] " " a[i];
}
}
}
END {
for (i in lang) { # if locale returned by locale -a
print i lang[i]; # print "locale description"
}
}'