diff mbox series

[bug#35910] services: Add ‘/usr/bin/env’ special file.

Message ID 20190526020635.20780-1-me@tobias.gr
State Accepted
Headers show
Series [bug#35910] services: Add ‘/usr/bin/env’ special file. | expand

Checks

Context Check Description
cbaines/applying patch success Successfully applied

Commit Message

Tobias Geerinckx-Rice May 26, 2019, 2:06 a.m. UTC
* gnu/services/base.scm (%base-services): Add ‘/usr/bin/env‘ to
special-files-service-type.
---

Guix,

I didn't even realise this was ‘missing’.  Is there any reason not to include it next to /bin/sh?

Sure, it's not pure, but then why provide /bin/sh when nowadays /usr/bin/env is both more common, more flexible,>

Feel free to gently enlighten me.

Kind regards,

T G-R

gnu/services/base.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Tobias Geerinckx-Rice May 26, 2019, 2:59 a.m. UTC | #1
Tobias Geerinckx-Rice wrote:
> -                                            "/bin/sh"))))))
> +                                            "/bin/sh"))
> +                   ("/usr/bin/env" ,(file-append 
> (canonical-package coreutils)
> + 
> "/usr/bin/env"))))))

'course this won't work unless you, also, have the hunk

   #:use-module ((gnu packages base)
-                #:select (canonical-package glibc 
                  glibc-utf8-locales))
+                #:select (canonical-package coreutils glibc 
glibc-utf8-locales))

accidentally placed in another commit, which is unlikely.

Kind regards,

T G-R
Ludovic Courtès May 29, 2019, 9:06 p.m. UTC | #2
Hi,

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

> I didn't even realise this was ‘missing’.  Is there any reason not to include it next to /bin/sh?
>
> Sure, it's not pure, but then why provide /bin/sh when nowadays /usr/bin/env is both more common, more flexible,>
>
> Feel free to gently enlighten me.

The ‘special-files’ service, ‘extra-special-file’, and related
documentation, including a snippet for adding /usr/bin/env (info "(guix)
Base Services"), stem from this discussion:

  https://lists.gnu.org/archive/html/guix-devel/2017-02/msg00205.html

So, do people want to add /usr/bin/env by default?  :-)

Thanks,
Ludo’.
Jeff Bauer June 16, 2019, 8:48 p.m. UTC | #3
> So, do people want to add /usr/bin/env by default?  :-)

+1

This would provide some sanity in writing scripts that
could be portable between guix and non-guix systems.

I've used this in the past to write scripts what would
work between Linux and BSD systems.

-Jeff
diff mbox series

Patch

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index f709ca5519..444e48f137 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -8,6 +8,7 @@ 
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2382,6 +2383,8 @@  to handle."
 
         (service special-files-service-type
                  `(("/bin/sh" ,(file-append (canonical-package bash)
-                                            "/bin/sh"))))))
+                                            "/bin/sh"))
+                   ("/usr/bin/env" ,(file-append (canonical-package coreutils)
+                                                 "/usr/bin/env"))))))
 
 ;;; base.scm ends here