aboutsummaryrefslogtreecommitdiff
path: root/utils/mksh/patches
diff options
context:
space:
mode:
authorThorsten Glaser <tg@mirbsd.org>2014-10-09 10:52:57 +0200
committerThorsten Glaser <tg@mirbsd.org>2014-10-09 14:15:19 +0200
commita219ffc012ffa9059e81ff53a46cbd386a13ebce (patch)
treecc0ad12029552eeec375bb1accb47ba929756fb2 /utils/mksh/patches
parentf42d4f63eed430a5c1bb95806ac666e9d161c491 (diff)
mksh: moved to github
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
Diffstat (limited to 'utils/mksh/patches')
-rw-r--r--utils/mksh/patches/100-dot_mkshrc50
1 files changed, 50 insertions, 0 deletions
diff --git a/utils/mksh/patches/100-dot_mkshrc b/utils/mksh/patches/100-dot_mkshrc
new file mode 100644
index 000000000..7cdd162fc
--- /dev/null
+++ b/utils/mksh/patches/100-dot_mkshrc
@@ -0,0 +1,50 @@
+From 2bee59bb9e6b142a78c94f5e77a54e4e2366c1b8 Mon Sep 17 00:00:00 2001
+From: Thorsten Glaser <tg@freewrt.org>
+Date: Thu, 25 Jul 2013 22:07:33 +0200
+Subject: [PATCH] Make default mkshrc file suitable for OpenWrt environment:
+
+* Part of the FreeWRT patches:
+ - no hostname(1)
+ - ls(1) has no -o option
+* OpenWrt and FreeWRT-1.0 fix:
+ - since this is not ~/.mkshrc make sure subshells find it
+---
+ dot.mkshrc | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/dot.mkshrc b/dot.mkshrc
+index c10b8fd..3a389b2 100644
+--- a/dot.mkshrc
++++ b/dot.mkshrc
+@@ -28,8 +28,8 @@ case $KSH_VERSION in
+ *) return 0 ;;
+ esac
+
+-PS1='#'; (( USER_ID )) && PS1='$'; [[ ${HOSTNAME:=$(ulimit -c 0; hostname -s \
+- 2>/dev/null)} = *([ ]|localhost) ]] && HOSTNAME=$(ulimit -c 0; hostname \
++PS1='#'; (( USER_ID )) && PS1='$'; [[ ${HOSTNAME:=$(</proc/sys/kernel/hostname
++ )} = *([ ]|localhost) ]] && HOSTNAME=$(ulimit -c 0; hostname \
+ 2>/dev/null); : ${EDITOR:=/bin/ed} ${HOSTNAME:=nil} ${TERM:=vt100}
+ : ${MKSH:=$(whence -p mksh)}; PS4='[$EPOCHREALTIME] '; PS1=$'\001\r''${|
+ local e=$?
+@@ -50,7 +50,7 @@ unalias ls
+ alias l='ls -F'
+ alias la='l -a'
+ alias ll='l -l'
+-alias lo='l -alo'
++alias lo='l -al'
+ alias doch='fc -ln -1 | sudo mksh -s'
+ whence -p rot13 >/dev/null || alias rot13='tr \
+ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \
+@@ -413,4 +413,8 @@ alias cls='print -n \\033c'
+
+ unset p
+
++# we need this in OpenWrt for subshells that are not login shells
++: ${ENV=/etc/mkshrc}
++[[ -z $ENV ]] || export ENV
++
+ : place customisations above this line
+--
+1.8.3.2
+