diff mbox series

[bug#54394,core-updates,07/12] gnu: gash-utils-boot: Create 'echo' wrapper.

Message ID 20220314225712.19869-7-samplet@ngyro.com
State Accepted
Headers show
Series Remove old GNU utilities from early bootstrap | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Timothy Sample March 14, 2022, 10:57 p.m. UTC
* gnu/packages/commencement.scm (gash-utils-boot)[arguments]: Add a
phase that generates an external wrapper for Gash's 'echo' built-in.
---
 gnu/packages/commencement.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index e63c0b3437..df91f57b59 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -242,7 +242,19 @@  (define gash-utils-boot
                  (copy-file (string-append gash-godir "/gash/compat.go")
                             (string-append godir "/gash/compat.go"))
                  (copy-recursively (string-append gash-godir "/gash/compat")
-                                   (string-append godir "/gash/compat")))))))))
+                                   (string-append godir "/gash/compat")))))
+           ;; We need an external echo.
+           (add-after 'install 'make-echo
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (gash (assoc-ref inputs "gash")))
+                 (with-output-to-file (string-append out "/bin/echo")
+                   (lambda ()
+                     (display (string-append "#!" gash "/bin/gash\n"))
+                     (newline)
+                     (display "echo \"$@\"")
+                     (newline)))
+                 (chmod (string-append out "/bin/echo") #o755))))))))
     (inputs `(("gash" ,gash-boot)
               ("guile" ,%bootstrap-guile)))
     (native-inputs `(("bootar" ,bootar)))))