Signed-off-by: Thorsten Glaser <t...@mirbsd.org> Hi,
this is an overdue update of the mksh package. I’ve only rebased the patch and added support for Link-Time Optimisation to the compilation scriptlet (and removed an obsolete option). Untested since I do not currently have access to an OpenWrt development environment, but “should” work. Please test and commit. Index: packages/utils/mksh/patches/100-dot_mkshrc =================================================================== --- packages/utils/mksh/patches/100-dot_mkshrc (revision 29504) +++ packages/utils/mksh/patches/100-dot_mkshrc (working copy) @@ -2,36 +2,37 @@ • Part of the FreeWRT patches: – no hostname(1) - – ls has no -o - • OpenWrt fix: + – ls(1) has no -o option + • OpenWrt and FreeWRT-1.0 fix: – since this is not ~/.mkshrc make sure subshells find it ---- a/dot.mkshrc -+++ b/dot.mkshrc -@@ -20,7 +20,7 @@ +--- a/dot.mkshrc Sat Nov 26 18:15:38 2011 ++++ b/dot.mkshrc Sun Dec 11 21:31:27 2011 +@@ -21,7 +21,7 @@ #- - # ~/.mkshrc: mksh initialisation file for interactive shells + # ${ENV:-~/.mkshrc}: mksh initialisation file for interactive shells -: ${EDITOR:=/bin/ed} ${TERM:=vt100} ${HOSTNAME:=$(ulimit -c 0;hostname -s 2>&-)} +: ${EDITOR:=/bin/ed} ${TERM:=vt100} ${HOSTNAME:=$(</proc/sys/kernel/hostname)} [[ $HOSTNAME = @(localhost|*([ ])) ]] && HOSTNAME=$(ulimit -c 0;hostname 2>&-) : ${HOSTNAME:=nil}; if (( USER_ID )); then PS1='$'; else PS1='#'; fi function precmd { -@@ -38,7 +38,7 @@ unalias ls +@@ -40,7 +40,7 @@ unalias ls alias l='ls -F' alias la='l -a' alias ll='l -l' -alias lo='l -alo' +alias lo='l -al' - alias which='whence -p' whence -p rot13 >&- || alias rot13='tr \ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \ -@@ -304,4 +304,8 @@ function Lstripcom { - done; } - } + nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM' +@@ -365,5 +365,9 @@ alias cls='print -n \\033c' + #export LANG=C LC_CTYPE=$p LC_MEASUREMENT=$p LC_MESSAGES=$p LC_PAPER=$p + unset p ++ +# we need this in OpenWrt for subshells that are not login shells +: ${ENV=/etc/mkshrc} +[[ -z $ENV ]] || export ENV -+ - : place customsations above this line + + : place customisations above this line Index: packages/utils/mksh/Makefile =================================================================== --- packages/utils/mksh/Makefile (revision 29504) +++ packages/utils/mksh/Makefile (working copy) @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mksh -PKG_VERSION:=39 -PKG_RELEASE:=2 +PKG_VERSION:=40d +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-R$(PKG_VERSION).cpio.gz PKG_SOURCE_URL:=http://www.mirbsd.org/MirOS/dist/mir/mksh -PKG_MD5SUM:=b2eeb4fe4ccac2704e1440e53cd2672c +PKG_MD5SUM:=c6428401103367730a95b99284bf47dc PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) @@ -35,13 +35,14 @@ derivate currently being actively developed. It includes bug fixes and feature improvements, in order to produce a modern, robust shell good for interactive and especially script use. -mksh has UTF-8 support (e.g. in the emacs editing mode); R38c -corresponds to OpenBSD 4.5-current ksh (without GNU bash-like -$PS1 and fancy character classes). The code has throughoutly +mksh has UTF-8 support (in substring operations and the Emacs +editing mode) and, while R40d corresponds to OpenBSD 5.0-cur- +rent ksh (without GNU bash-like PS1 and fancy character clas- +ses), adheres to SUSv4 and is much more robust. The code has been cleaned up and simplified, bugs fixed, standards compli- ance added, and several enhancements (for extended compatibi- lity to other modern shells - as well as a couple of its own) -have been placed. +are available. It has sensible defaults as usual with BSD. endef define Build/Compile @@ -50,17 +51,14 @@ # UTF-8 mode, neither use setlocale/nl_langinfo # nor look at $LC_* and $LANG (not recommended) # HAVE_CAN_FSTACKPROTECTORALL=0 ⇒ nuke libssp dependency - # HAVE_REALPATH=x ⇒ add the realpath builtin, which was - # disabled by MKSH_SMALL, back if realpath() exists cd $(PKG_BUILD_DIR); \ CC="$(TARGET_CC)" \ TARGET_OS="$(shell uname -s)" \ CFLAGS="$(TARGET_CFLAGS)" \ CPPFLAGS="-DMKSH_SMALL=1 -DMKSH_ASSUME_UTF8=0" \ HAVE_CAN_FSTACKPROTECTORALL=0 \ - HAVE_REALPATH=x \ LDFLAGS="$(TARGET_LDFLAGS)" \ - $(BASH) Build.sh -Q -r + $(BASH) Build.sh -Q -r -c lto endef define Package/mksh/postinst bye, //mirabilos -- FWIW, I'm quite impressed with mksh interactively. I thought it was much *much* more bare bones. But it turns out it beats the living hell out of ksh93 in that respect. I'd even consider it for my daily use if I hadn't wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel