fix #467025 - Ksh fails to initialise environment when login from graphic

console
This commit is contained in:
Michal Hlavinka 2008-10-21 17:16:49 +00:00
parent a8955dc0a5
commit 9d5844ce66
3 changed files with 44 additions and 1 deletions

8
dotkshrc Normal file
View File

@ -0,0 +1,8 @@
# .kshrc
# Source global definitions
if [ -f /etc/kshrc ]; then
. /etc/kshrc
fi
# User specific aliases and functions

View File

@ -8,10 +8,12 @@ URL: http://www.kornshell.com/
Group: System Environment/Shells
License: CPL
Version: 20080725
Release: 3%{?dist}
Release: 4%{?dist}
Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.tgz
Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{releasedate}.tgz
Source2: http://www.research.att.com/~gsf/download/tgz/ast-ksh-locale.%{releasedate}.tgz
Source3: kshrc.rhs
Source4: dotkshrc
#Patch0: ksh-20041225-gcc4.patch
Patch1: ksh-20070328-uname.patch
Patch2: ksh-20070328-useex.patch
@ -67,6 +69,9 @@ install -m 644 share/lib/locale/$i/LC_MESSAGES/* \
$RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES/
done
ln -sf /bin/ksh $RPM_BUILD_ROOT/usr/bin/ksh
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/skel
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.kshrc
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/kshrc
%post
if [ ! -f /etc/shells ]; then
@ -100,11 +105,16 @@ fi
/usr//bin/ksh
%{_datadir}/locale/*/LC_MESSAGES/*
%{_mandir}/man1/*
%config(noreplace) %{_sysconfdir}/skel/.kshrc
%config(noreplace) %{_sysconfdir}/kshrc
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Tue Oct 21 2008 Michal Hlavinka <mhlavink@redhat.com> 20080202-4
- fix #467025 - Ksh fails to initialise environment when login from graphic console
* Wed Aug 06 2008 Tomas Smetana <tsmetana@redhat.com> 20080725-3
- fix BuildRequires, rebuild

25
kshrc.rhs Normal file
View File

@ -0,0 +1,25 @@
#
# /etc/kshrc is sourced in interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
# Set prompts
#PROMPT='[%n@%m]%~%# ' # default prompt
#RPROMPT=' %~' # prompt for right side of screen
_src_etc_profile_d()
{
# from zshrc, with ksh fixes
if [[ ! -o login ]]; then # We're not a login shell
for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
fi
}
_src_etc_profile_d
unset -f _src_etc_profile_d