GNU bug report logs -
#78308
[PATCH 0/9] VTE integration support / Shell startup files refactor
Previous Next
Full log
Message #47 received at 78308 <at> debbugs.gnu.org (full text, mbox):
This causes Bash to treat /etc/bashrc as a startup file, removing the need to
source /etc/bashrc from ~/.bashrc.
* gnu/packages/bash.scm (bash-fixed): New package, with added SYS_BASHRC
define.
(bash) [replacement]: Use it.
* gnu/system/shadow.scm (%default-bashrc): Do not source /etc/bashrc, now done
implicitly.
Change-Id: I5b0afd7d81653ef19c482e5501efdf7e50ef37c0
---
gnu/packages/bash.scm | 20 ++++++++++++++++++++
gnu/system/shadow.scm | 3 ---
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index c88f38f5376..bcd78d7d2a9 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -10,6 +10,7 @@
;;; Copyright © 2024 Oleg Pykhalov <go.wigust <at> gmail.com>
;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke <at> gnu.org>
;;; Copyright © 2024 chris <chris <at> bumblehead.com>
+;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -137,6 +138,7 @@ (define-public bash
(version "5.1"))
(package
(name "bash")
+ (replacement bash-fixed)
(source (origin
(method url-fetch)
(uri (string-append
@@ -254,6 +256,24 @@ (define-public bash
(license license:gpl3+)
(home-page "https://www.gnu.org/software/bash/"))))
+(define bash-fixed
+ (package
+ (inherit bash)
+ (arguments
+ (substitute-keyword-arguments (package-arguments bash)
+ ((#:modules modules '%default-gnu-modules)
+ (append '((ice-9 receive)
+ (srfi srfi-1)
+ (srfi srfi-26))
+ modules))
+ ((#:configure-flags flags)
+ #~(receive (cppflags flags)
+ (partition (cut string-prefix? "CPPFLAGS" <>)
+ #$flags)
+ (cons (string-append (first cppflags)
+ " -DSYS_BASHRC='\"/etc/bashrc\"'")
+ flags)))))))
+
(define-public bash-minimal
;; A stripped-down Bash for non-interactive use.
(package/inherit bash
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index d0f1b6b2b14..50ac102707e 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -164,9 +164,6 @@ (define %default-bashrc
return
fi
-# Source the system-wide file.
-[ -f /etc/bashrc ] && source /etc/bashrc
-
alias ls='ls -p --color=auto'
alias ll='ls -l'
alias grep='grep --color=auto'
--
2.49.0
This bug report was last modified 18 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.