summary refs log tree commit diff
path: root/gnu/packages/bootstrap.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2016-11-13 11:48:23 +0200
committerEfraim Flashner <efraim@flashner.co.il>2017-02-20 12:58:06 +0200
commit653add37af10b0d5dbc20c8bc7ce30eec8cf4ae7 (patch)
tree3c15b2caa694e63d64fafa0e64cd8e5155f89ae9 /gnu/packages/bootstrap.scm
parentd15432ca9e9359b865aac63ae47863e94bbce0e4 (diff)
downloadguix-653add37af10b0d5dbc20c8bc7ce30eec8cf4ae7.tar.gz
gnu: %bootstrap-coreutils&co: Patch egrep/fgrep to work regardless of $PATH.
This is the bootstrap version of 1063d325ea76aa2b00dfcd3d436b16e412103df1

* gnu/packages/bootstrap.scm (%bootstrap-coreutils&co)[source]: Patch
the absolute location of 'grep' when called from 'egrep' or 'fgrep'.
Diffstat (limited to 'gnu/packages/bootstrap.scm')
-rw-r--r--gnu/packages/bootstrap.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 3be6e1246c..251d1fec7b 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -28,6 +28,7 @@
   #:use-module ((guix store) #:select (add-to-store add-text-to-store))
   #:use-module ((guix derivations) #:select (derivation))
   #:use-module ((guix utils) #:select (gnu-triplet->nix-system))
+  #:use-module ((guix build utils) #:select (elf-file?))
   #:use-module (guix memoization)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
@@ -325,6 +326,13 @@ $out/bin/guile --version~%"
                            (chmod "bin" #o755)
                            (patch-shebang "bin/egrep" path)
                            (patch-shebang "bin/fgrep" path)
+                           ;; Starting with grep@2.25 'egrep' and 'fgrep' are shell files
+                           ;; that call 'grep'.  If the bootstrap 'egrep' and 'fgrep'
+                           ;; are not binaries then patch them to execute 'grep' via its
+                           ;; absolute file name instead of searching for it in $PATH.
+                           (if (not (elf-file? "bin/egrep"))
+                             (substitute* '("bin/egrep" "bin/fgrep")
+                               (("^exec grep") (string-append (getcwd) "/bin/grep"))))
                            (chmod "bin" #o555)
                            #t)))