unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#65573] [PATCH] Make bash source /etc/bashrc
@ 2023-08-27 19:59 GB
  0 siblings, 0 replies; only message in thread
From: GB @ 2023-08-27 19:59 UTC (permalink / raw)
  To: 65573


[-- Attachment #1.1: Type: text/plain, Size: 161 bytes --]

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 #1.2: Type: text/html, Size: 190 bytes --]

[-- Attachment #2: use-system-bashrc.patch --]
[-- Type: text/x-patch, Size: 2052 bytes --]

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

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-28  0:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-27 19:59 [bug#65573] [PATCH] Make bash source /etc/bashrc GB

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).