unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* zsh and fish missed in /etc/shells?
@ 2015-03-09  2:33 Axel
  2015-03-09  8:59 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Axel @ 2015-03-09  2:33 UTC (permalink / raw)
  To: guix-devel

Could we append /etc/shells with `zsh` or `fish` paths after these
shells installed in the system? And I think these shells should be
linked to /run/current-system/profile/bin/ as `bash` does.

-- 
Александр Графов

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: zsh and fish missed in /etc/shells?
  2015-03-09  2:33 zsh and fish missed in /etc/shells? Axel
@ 2015-03-09  8:59 ` Ludovic Courtès
  2015-03-10 22:30   ` Axel
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2015-03-09  8:59 UTC (permalink / raw)
  To: Axel; +Cc: guix-devel

Axel <grafov@gmail.com> skribis:

> Could we append /etc/shells with `zsh` or `fish` paths after these
> shells installed in the system?

Sure!  Would you like to submit a patch?  This is in gnu/system.scm.

> And I think these shells should be linked to
> /run/current-system/profile/bin/ as `bash` does.

To do that, all you need to do is to add them to the ‘packages’ field of
the ‘operating-system’ declaration:

  (operating-system
    ;; ...
    (packages (cons* fish zsh %base-packages)))

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: zsh and fish missed in /etc/shells?
  2015-03-09  8:59 ` Ludovic Courtès
@ 2015-03-10 22:30   ` Axel
  2015-03-10 23:49     ` Axel
  2015-03-11  9:43     ` Ludovic Courtès
  0 siblings, 2 replies; 7+ messages in thread
From: Axel @ 2015-03-10 22:30 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1242 bytes --]

Thank you for explanation, I installed these packages system wide and
got symbolic links. I prepared the patch for gnu/system.scm but I
unsure about the way I used to check packages availability
(find-packages-by-name). I see only the problem when one user
installed the package and other don't — the new shell will be added to
the list anyway. But I not found how to check that package was
installed system wide.

And generally should we check that shells really installed or just
unconditionally add paths to /etc/shells? I will modify patch then.



2015-03-09 11:59 GMT+03:00 Ludovic Courtès <ludo@gnu.org>:
> Axel <grafov@gmail.com> skribis:
>
>> Could we append /etc/shells with `zsh` or `fish` paths after these
>> shells installed in the system?
>
> Sure!  Would you like to submit a patch?  This is in gnu/system.scm.
>
>> And I think these shells should be linked to
>> /run/current-system/profile/bin/ as `bash` does.
>
> To do that, all you need to do is to add them to the ‘packages’ field of
> the ‘operating-system’ declaration:
>
>   (operating-system
>     ;; ...
>     (packages (cons* fish zsh %base-packages)))
>
> Thanks,
> Ludo’.



-- 
Александр Графов

[-- Attachment #2: 0001-system-Add-fish-and-zsh-to-shells-list.patch --]
[-- Type: application/octet-stream, Size: 1458 bytes --]

From 68c873e2d476f717f64cb15b98318985ca1eca74 Mon Sep 17 00:00:00 2001
From: "Alexander I.Grafov (Axel)" <grafov@gmail.com>
Date: Wed, 11 Mar 2015 00:35:07 +0300
Subject: [PATCH] system: Add fish and zsh to shells list.

* gnu/system.scm (etc-directory): Add "fish" and "zsh" to /etc/shells
  if they was installed.
---
 gnu/system.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 1a0aee4..c098b1e 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -417,10 +417,14 @@ settings for 'guix.el' to work out-of-the-box."
        (sudoers    (text-file "sudoers" sudoers))
        (login.defs (text-file "login.defs" "# Empty for now.\n"))
        (shells     (text-file "shells"            ; used by xterm and others
-                              "\
+                              (string-append "\
 /bin/sh
 /run/current-system/profile/bin/sh
-/run/current-system/profile/bin/bash\n"))
+/run/current-system/profile/bin/bash\n"
+                              (if (not (null? (find-packages-by-name "fish")))
+                                  "/run/current-system/profile/bin/fish\n")
+                              (if (not (null? (find-packages-by-name "zsh")))
+                                  "/run/current-system/profile/bin/zsh\n"))))
        (emacs      (emacs-site-directory))
        (issue      (text-file "issue" issue))
        (nsswitch   (text-file "nsswitch.conf"
-- 
2.2.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: zsh and fish missed in /etc/shells?
  2015-03-10 22:30   ` Axel
@ 2015-03-10 23:49     ` Axel
  2015-03-11  9:43     ` Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Axel @ 2015-03-10 23:49 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

I found tcsh in packages list and maybe missed some other shells.
Seems like we need more general solution than patch proposed by me.
Also maybe merge all shells to a new common package "gnu shells"
instead of separate packages?

2015-03-11 1:30 GMT+03:00 Axel <grafov@gmail.com>:
> Thank you for explanation, I installed these packages system wide and
> got symbolic links. I prepared the patch for gnu/system.scm but I
> unsure about the way I used to check packages availability
> (find-packages-by-name). I see only the problem when one user
> installed the package and other don't — the new shell will be added to
> the list anyway. But I not found how to check that package was
> installed system wide.
>
> And generally should we check that shells really installed or just
> unconditionally add paths to /etc/shells? I will modify patch then.
>
>
>
> 2015-03-09 11:59 GMT+03:00 Ludovic Courtès <ludo@gnu.org>:
>> Axel <grafov@gmail.com> skribis:
>>
>>> Could we append /etc/shells with `zsh` or `fish` paths after these
>>> shells installed in the system?
>>
>> Sure!  Would you like to submit a patch?  This is in gnu/system.scm.
>>
>>> And I think these shells should be linked to
>>> /run/current-system/profile/bin/ as `bash` does.
>>
>> To do that, all you need to do is to add them to the ‘packages’ field of
>> the ‘operating-system’ declaration:
>>
>>   (operating-system
>>     ;; ...
>>     (packages (cons* fish zsh %base-packages)))
>>
>> Thanks,
>> Ludo’.
>
>
>
> --
> Александр Графов



-- 
Александр Графов

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: zsh and fish missed in /etc/shells?
  2015-03-10 22:30   ` Axel
  2015-03-10 23:49     ` Axel
@ 2015-03-11  9:43     ` Ludovic Courtès
  2015-03-11 12:42       ` Axel
  1 sibling, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2015-03-11  9:43 UTC (permalink / raw)
  To: Axel; +Cc: guix-devel

Axel <grafov@gmail.com> skribis:

> And generally should we check that shells really installed or just
> unconditionally add paths to /etc/shells? I will modify patch then.

I think it’s enough to just add them unconditionally.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: zsh and fish missed in /etc/shells?
  2015-03-11  9:43     ` Ludovic Courtès
@ 2015-03-11 12:42       ` Axel
  2015-03-12 20:29         ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Axel @ 2015-03-11 12:42 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 825 bytes --]

Well, I modified the patch and now it just trivially add paths for
fish, tcsh and zsh.

For example Debian has add-shell/remove-shell scripts triggered on
package installing and removing. FTP servers like proftpd by default
check for installed shells and with this patch they will allow for a
user shells that don't really exist in a system. Probably it is not a
problem though. I noted in a changelog what we add paths
unconditionally.


2015-03-11 12:43 GMT+03:00 Ludovic Courtès <ludo@gnu.org>:
> Axel <grafov@gmail.com> skribis:
>
>> And generally should we check that shells really installed or just
>> unconditionally add paths to /etc/shells? I will modify patch then.
>
> I think it’s enough to just add them unconditionally.
>
> Thanks,
> Ludo’.



-- 
Александр Графов

[-- Attachment #2: 0001-PATCH-system-Add-fish-tcsh-zsh-to-etc-shells.patch --]
[-- Type: application/octet-stream, Size: 1045 bytes --]

From d17569a3b3f00066531361b9f29b840be2444982 Mon Sep 17 00:00:00 2001
From: "Alexander I.Grafov (Axel)" <grafov@gmail.com>
Date: Wed, 11 Mar 2015 15:17:24 +0300
Subject: [PATCH] system: Add fish/tcsh/zsh to /etc/shells

* gnu/system.scm (etc-directory): Add fish, tcsh and zsh paths
  to /etc/shells. We don't check that these shells really installed.
---
 gnu/system.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 1a0aee4..c5abb98 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -420,7 +420,10 @@ settings for 'guix.el' to work out-of-the-box."
                               "\
 /bin/sh
 /run/current-system/profile/bin/sh
-/run/current-system/profile/bin/bash\n"))
+/run/current-system/profile/bin/bash
+/run/current-system/profile/bin/fish
+/run/current-system/profile/bin/tcsh
+/run/current-system/profile/bin/zsh\n"))
        (emacs      (emacs-site-directory))
        (issue      (text-file "issue" issue))
        (nsswitch   (text-file "nsswitch.conf"
-- 
2.2.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: zsh and fish missed in /etc/shells?
  2015-03-11 12:42       ` Axel
@ 2015-03-12 20:29         ` Ludovic Courtès
  0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2015-03-12 20:29 UTC (permalink / raw)
  To: Axel; +Cc: guix-devel

Axel <grafov@gmail.com> skribis:

> Well, I modified the patch and now it just trivially add paths for
> fish, tcsh and zsh.
>
> For example Debian has add-shell/remove-shell scripts triggered on
> package installing and removing. FTP servers like proftpd by default
> check for installed shells and with this patch they will allow for a
> user shells that don't really exist in a system. Probably it is not a
> problem though.

I think it’s fine.

> I noted in a changelog what we add paths unconditionally.

I moved this explanation as a comment in the code itself; we only
mention in change logs the actual changes, and explanations usually go
to comments (info "(standards) Change Logs").

> From d17569a3b3f00066531361b9f29b840be2444982 Mon Sep 17 00:00:00 2001
> From: "Alexander I.Grafov (Axel)" <grafov@gmail.com>
> Date: Wed, 11 Mar 2015 15:17:24 +0300
> Subject: [PATCH] system: Add fish/tcsh/zsh to /etc/shells
>
> * gnu/system.scm (etc-directory): Add fish, tcsh and zsh paths
>   to /etc/shells. We don't check that these shells really installed.

Applied, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-03-12 20:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-09  2:33 zsh and fish missed in /etc/shells? Axel
2015-03-09  8:59 ` Ludovic Courtès
2015-03-10 22:30   ` Axel
2015-03-10 23:49     ` Axel
2015-03-11  9:43     ` Ludovic Courtès
2015-03-11 12:42       ` Axel
2015-03-12 20:29         ` Ludovic Courtès

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).