Github messages for voidlinux
 help / color / mirror / Atom feed
From: ahesford <ahesford@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] zsh: use /etc/zsh/zprofile instead of /etc/profile, fix paths in docs
Date: Tue, 29 Sep 2020 06:22:56 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-25184@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]

There is a new pull request by ahesford against master on the void-packages repository

https://github.com/ahesford/void-packages zsh
https://github.com/void-linux/void-packages/pull/25184

zsh: use /etc/zsh/zprofile instead of /etc/profile, fix paths in docs
By default, upstream zsh prefers to use `/etc/zprofile` as a system configuration for login shells. We were overriding this to `/etc/profile`, which is not desirable because it forces bash/dash and zsh to use the same login profile configuration.

This PR moves the zsh profile config to `/etc/zsh/zprofile` (for consistency with other `/etc/zsh/*` configuration files) and, to minimize breakage for existing users, installs a default `zprofile` that just sources `/etc/profile` in sh emulation mode. Because this is a `conf_file`, users can now separate zsh configuration from bash/dash if they desire.

NB: because `/etc/zsh/zprofile` was not an allowed configuration path for prior zsh packages, I do not expect users to have this file, so the first package update should almost universally copy the new `zprofile` in the proper place and carry forward the `/etc/profile` behavior.

As a bonus, I updated the man and texinfo pages to point to the proper paths of these files, hopefully avoiding confusion in the future.

cc: @leahneukirchen @sgn

A patch file from https://github.com/void-linux/void-packages/pull/25184.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-zsh-25184.patch --]
[-- Type: text/x-diff, Size: 2271 bytes --]

From feec4b14ec849409add965d917689476f8fd2b2f Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 28 Sep 2020 23:33:51 -0400
Subject: [PATCH] zsh: use /etc/zsh/zprofile instead of /etc/profile, fix paths
 in docs

---
 srcpkgs/zsh/files/zprofile |  1 +
 srcpkgs/zsh/template       | 13 ++++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/zsh/files/zprofile

diff --git a/srcpkgs/zsh/files/zprofile b/srcpkgs/zsh/files/zprofile
new file mode 100644
index 00000000000..6bfcdf7cb3b
--- /dev/null
+++ b/srcpkgs/zsh/files/zprofile
@@ -0,0 +1 @@
+emulate sh -c 'source /etc/profile'
diff --git a/srcpkgs/zsh/template b/srcpkgs/zsh/template
index 85ff5ba279c..a7aea22e18d 100644
--- a/srcpkgs/zsh/template
+++ b/srcpkgs/zsh/template
@@ -1,13 +1,13 @@
 # Template file for 'zsh'
 pkgname=zsh
 version=5.8
-revision=1
+revision=2
 build_style=gnu-configure
 make_build_target="all info"
 make_install_args="install.info"
 configure_args="--enable-etcdir=/etc/zsh --enable-zshenv=/etc/zsh/zshenv
  --enable-zlogin=/etc/zsh/zlogin --enable-zlogout=/etc/zsh/zlogout
- --enable-zprofile=/etc/profile --enable-zshrc=/etc/zsh/zshrc
+ --enable-zprofile=/etc/zsh/zprofile --enable-zshrc=/etc/zsh/zshrc
  --enable-maildir-support --enable-function-subdirs
  --enable-fndir=/usr/share/zsh/functions --with-term-lib=ncursesw
  --enable-scriptdir=/usr/share/zsh/scripts --enable-pcre
@@ -25,8 +25,9 @@ distfiles="http://www.zsh.org/pub/zsh-${version}.tar.xz"
 checksum=dcc4b54cc5565670a65581760261c163d720991f0d06486da61f8d839b52de27
 register_shell="/bin/zsh /usr/bin/zsh"
 lib32disabled=yes
+conf_files="/etc/zsh/*"
 
-pre_configure() {
+post_patch() {
 	# Set correct keymap path
 	sed -i 's#/usr/share/keymaps#/usr/share/kbd/keymaps#g' \
 		Completion/Unix/Command/_loadkeys
@@ -36,9 +37,15 @@ pre_configure() {
 		rm -rf Completion/$_fpath
 		sed "s#\s*Completion/$_fpath/\*/\*##g" -i Src/Zle/complete.mdd
 	done
+
 	rm -f Completion/Linux/Command/_{pkgtool,rpmbuild,yast}
 	rm -f Completion/Unix/Command/_{notmuch,osc,systemd}
+
+	vsed -i -e 's,/etc/z,/etc/zsh/z,g' \
+		Doc/zsh.texi Doc/{zsh,zshall,zshoptions,zshmodules}.1
 }
+
 post_install() {
 	vlicense LICENCE
+	vinstall "${FILESDIR}/zprofile" 644 etc/zsh
 }

             reply	other threads:[~2020-09-29  4:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29  4:22 ahesford [this message]
2020-09-29 16:21 ` [PR PATCH] [Merged]: " leahneukirchen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-25184@inbox.vuxu.org \
    --to=ahesford@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).