summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew T Hoare2017-12-10 02:09:10 +0000
committerMatthew T Hoare2017-12-10 02:09:10 +0000
commitb26420f28b912b16ef9d98b9379162ff3b7d95e1 (patch)
tree1a04001939963fd2e8457703563444b821525a89
parent503144b8236c21d0cb6169006484f063fcdfc10f (diff)
downloadaur-b26420f28b912b16ef9d98b9379162ff3b7d95e1.tar.gz
Fixed https://bugs.archlinux.org/task/56652
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD2
-rw-r--r--mksh.install37
3 files changed, 37 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6117f570a3a1..45b28bd7509c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Wed Nov 1 17:07:03 UTC 2017
+# Sun Dec 10 02:08:46 UTC 2017
pkgbase = mksh-git
pkgdesc = The MirBSD Korn Shell - an enhanced version of the public domain ksh (development version)
pkgver = 56.r3179.0e478dc
- pkgrel = 1
+ pkgrel = 2
url = https://www.mirbsd.org/mksh.htm
install = mksh.install
arch = i686
diff --git a/PKGBUILD b/PKGBUILD
index c1a67de089bf..e81de5c88f52 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@ pkgname=mksh-git
_pkgname=mksh
_pkgver=R56b
pkgver=56.r3179.0e478dc
-pkgrel=1
+pkgrel=2
pkgdesc='The MirBSD Korn Shell - an enhanced version of the public domain ksh (development version)'
url='https://www.mirbsd.org/mksh.htm'
license=('custom')
diff --git a/mksh.install b/mksh.install
index 20c2f51136de..4abd6346f6e3 100644
--- a/mksh.install
+++ b/mksh.install
@@ -1,14 +1,45 @@
+pre_install() {
+ :
+}
+
post_install() {
grep -x '/bin/mksh' /etc/shells 2>/dev/null || echo '/bin/mksh' >> /etc/shells
+ # need to also add /usr/bin/mksh to /etc/shells to avoid https://bugs.archlinux.org/task/55053
grep -x '/usr/bin/mksh' /etc/shells 2>/dev/null || echo '/usr/bin/mksh' >> /etc/shells
}
+pre_upgrade() {
+ :
+}
+
post_upgrade() {
post_install
}
-post_remove() {
- sed -i -r '/^(\/usr)?\/bin\/mksh$/d' /etc/shells
+pre_remove() {
+ # This is only necessary on alternate shells. sh and bash
+ # are at the base of Arch and cannot be removed.
+ # To test this you should have a spare root shell already open.
+ # Otherwise, if this doesn't work, you will need to learn how to bypass
+ # the default shell on login.
+ # http://stackoverflow.com/questions/11059067/what-is-the-nix-command-to-view-a-users-default-login-shell
+ if getent passwd root | cut -d: -f7 | grep -qle '/bin/mksh'; then
+ echo '**********************************************'
+ echo '*** Warning: ROOT HAS mksh as the login shell.'
+ echo '*** Shell changed to sh to prevent loss of root access.'
+ echo '**********************************************'
+ # sh is more likely to guarantee a login than bash because sh is typically
+ # unmodified. Crappy, but guaranteed.
+ chsh -s '/bin/sh'
+ fi
+ sed -i -r '/^(\/usr)?\/bin\/mksh$/d' '/etc/shells'
}
-# vim:set ts=2 sw=2 et:
+post_remove() {
+ mandb -q
+ # /usr/bin/mksh is also detected
+ if getent passwd | cut -d: -f7 | grep -qle '/bin/mksh'; then
+ echo '*** Warning: Some users have mksh as their login shell.'
+ echo '*** Fix promptly to restore access.'
+ fi
+}