[PATCH] Make bash source /etc/bashrc

  • Open
  • quality assurance status badge
Details
One participant
  • GB
Owner
unassigned
Submitted by
GB
Severity
normal
G
(address . guix-patches@gnu.org)
CALveDrWPRXtz=7gk3Z=g1fX4khV2UaCvB3NRTiX3PC00Z06gtw@mail.gmail.com
At the moment, login shells source /etc/bashrc properly, while non-login
shells don't, which makes bash-completion not work unless you source the
file manually.
Attachment: file
From bc4a68e73c0f281ec45e7e94e734f407793c254c Mon Sep 17 00:00:00 2001
From: "German Bichkovich" <g.bickovich@gmail.com>
Date: Sun, 27 Aug 2023 17:04:13 +0300
Subject: [PATCH] Patch bash to use /etc/bashrc

---
gnu/packages/bash.scm | 5 +++--
gnu/packages/patches/bash-use-system-bashrc.patch | 14 ++++++++++++++
2 files changed, 17 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/bash-use-system-bashrc.patch

Toggle diff (38 lines)
diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index bb3359d5d1..22a57dd09b 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -140,8 +140,9 @@ (define-public bash
(base32
"1alv68wplnfdm6mh39hm57060xgssb9vqca4yr1cyva0c342n0fc"))
(patch-flags '("-p0"))
- (patches (cons (search-patch "bash-linux-pgrp-pipe.patch")
- %patch-series-5.1))))
+ (patches (cons* (search-patch "bash-linux-pgrp-pipe.patch")
+ (search-patch "bash-use-system-bashrc.patch")
+ %patch-series-5.1))))
(version (string-append version "." (number->string (length %patch-series-5.1))))
(build-system gnu-build-system)
diff --git a/gnu/packages/patches/bash-use-system-bashrc.patch b/gnu/packages/patches/bash-use-system-bashrc.patch
new file mode 100644
index 0000000000..df06d1a311
--- /dev/null
+++ b/gnu/packages/patches/bash-use-system-bashrc.patch
@@ -0,0 +1,14 @@
+Source /etc/bashrc by default. Otherwise, default login shell sources
+bash completion, while non-login shells don't.
+
+--- config-top.h 2020-11-16 17:34:26.000000000 +0200
++++ config-top.h 2023-08-27 14:14:41.404569202 +0300
+@@ -91,7 +91,7 @@
+ #define DEFAULT_BASHRC "~/.bashrc"
+
+ /* System-wide .bashrc file for interactive shells. */
+-/* #define SYS_BASHRC "/etc/bash.bashrc" */
++#define SYS_BASHRC "/etc/bashrc"
+
+ /* System-wide .bash_logout for login shells. */
+ /* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */
--
2.41.0
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 65573@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 65573
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch