unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: bug#58417: Installer script no longer works with `yes` utility
       [not found] <9e3dc221-9013-d58a-402b-696b117a99a6@posteo.de>
@ 2022-10-11 16:26 ` Tobias Geerinckx-Rice
  2022-10-11 18:38   ` zimoun
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Tobias Geerinckx-Rice @ 2022-10-11 16:26 UTC (permalink / raw)
  To: Jonas Freimuth, Maxim Cournoyer; +Cc: Guix-devel

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

[Shunted to guix-devel@]

Jonas Freimuth 写道:
> bash -c 'yes | bash guix-install.sh'

While this happens to work (again) now, that doesn't mean it 
always will or should be considered supported.

We should reserve the right to ask future questions to which the 
safe/sane/common answer is ‘no’, without phrasing it awkwardly 
just to make an unthinking stream of ‘y’s happy.

  $ guix-install.sh
  …
  Would you like to NOT enable the Cool Experimental Feature? 
  (DANGER) [Y/n]

Conversely, I'd like to add a comment that does commit to always 
keeping ‘yes '' | bash guix-install.sh’ working, assuming there 
was no other input or detected issues.  Also nice for humans in a 
hurry.

Does that seem unreasonable to anyone?

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-11 16:26 ` bug#58417: Installer script no longer works with `yes` utility Tobias Geerinckx-Rice
@ 2022-10-11 18:38   ` zimoun
  2022-10-17  1:22     ` Maxim Cournoyer
  2022-10-11 19:29   ` Maxim Cournoyer
  2022-10-11 19:32   ` Maxim Cournoyer
  2 siblings, 1 reply; 8+ messages in thread
From: zimoun @ 2022-10-11 18:38 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice, Jonas Freimuth, Maxim Cournoyer; +Cc: Guix-devel

Hi Tobias,

On Tue, 11 Oct 2022 at 18:26, Tobias Geerinckx-Rice <me@tobias.gr> wrote:
> Jonas Freimuth 写道:

>> bash -c 'yes | bash guix-install.sh'
>
> While this happens to work (again) now, that doesn't mean it 
> always will or should be considered supported.
>
> We should reserve the right to ask future questions to which the 
> safe/sane/common answer is ‘no’, without phrasing it awkwardly 
> just to make an unthinking stream of ‘y’s happy.
>
>   $ guix-install.sh
>   …
>   Would you like to NOT enable the Cool Experimental Feature? 
>   (DANGER) [Y/n]

Personally, I am always confused by the negative form of a question. :-)


> Conversely, I'd like to add a comment that does commit to always 
> keeping ‘yes '' | bash guix-install.sh’ working, assuming there 
> was no other input or detected issues.  Also nice for humans in a 
> hurry.
>
> Does that seem unreasonable to anyone?

From my point of view, it could nice to have a way to run the
installation script without any human action.  For instance, install
Guix in some GitHub/Gitlab CI.


Cheers,
simon


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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-11 16:26 ` bug#58417: Installer script no longer works with `yes` utility Tobias Geerinckx-Rice
  2022-10-11 18:38   ` zimoun
@ 2022-10-11 19:29   ` Maxim Cournoyer
  2022-10-11 19:32   ` Maxim Cournoyer
  2 siblings, 0 replies; 8+ messages in thread
From: Maxim Cournoyer @ 2022-10-11 19:29 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: Jonas Freimuth, Guix-devel

Hi,

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

> [Shunted to guix-devel@]
>
> Jonas Freimuth 写道:
>> bash -c 'yes | bash guix-install.sh'
>
> While this happens to work (again) now, that doesn't mean it always
> will or should be considered supported.
>
> We should reserve the right to ask future questions to which the
> safe/sane/common answer is ‘no’, without phrasing it awkwardly just to
> make an unthinking stream of ‘y’s happy.
>
>  $ guix-install.sh
>  …
>  Would you like to NOT enable the Cool Experimental Feature?
>  (DANGER) [Y/n]
>
> Conversely, I'd like to add a comment that does commit to always
> keeping ‘yes '' | bash guix-install.sh’ working, assuming there was no
> other input or detected issues.  Also nice for humans in a hurry.
>
> Does that seem unreasonable to anyone?

To the contrary, that seems pretty reasonable.  You may be interested in
this version of a biased prompt, gracefully shared by Earnestly from
#bash:

--8<---------------cut here---------------start------------->8---
confirm() {
    local -l reply
    local prompt bias=$1
    shift

    case $bias in
        yes) prompt=Y/n ;;
        no)  prompt=y/N
    esac

    # shellcheck disable=SC2059
    printf -- "\033[1m* $1 [$prompt]\033[0m " "${@:2}"
    read -r reply

    case $bias in
        yes) [[ $reply = y || ! $reply ]] ;;
        no)  [[ $reply = y ]]
    esac
}
--8<---------------cut here---------------end--------------->8---

The first arguments is the default argument (yes or no).  The rest works
the same (but they used printf to format things).  We can adapt our
version with that.

If you make the change you'll want to write a news so that 'yes' users
can transition to "yes ''".

-- 
Thanks,
Maxim


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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-11 16:26 ` bug#58417: Installer script no longer works with `yes` utility Tobias Geerinckx-Rice
  2022-10-11 18:38   ` zimoun
  2022-10-11 19:29   ` Maxim Cournoyer
@ 2022-10-11 19:32   ` Maxim Cournoyer
  2 siblings, 0 replies; 8+ messages in thread
From: Maxim Cournoyer @ 2022-10-11 19:32 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: Jonas Freimuth, Guix-devel

Hi again,

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

> [Shunted to guix-devel@]
>
> Jonas Freimuth 写道:
>> bash -c 'yes | bash guix-install.sh'
>
> While this happens to work (again) now, that doesn't mean it always
> will or should be considered supported.
>
> We should reserve the right to ask future questions to which the
> safe/sane/common answer is ‘no’, without phrasing it awkwardly just to
> make an unthinking stream of ‘y’s happy.
>
>  $ guix-install.sh
>  …
>  Would you like to NOT enable the Cool Experimental Feature?
>  (DANGER) [Y/n]
>
> Conversely, I'd like to add a comment that does commit to always
> keeping ‘yes '' | bash guix-install.sh’ working, assuming there was no
> other input or detected issues.  Also nice for humans in a hurry.
>
> Does that seem unreasonable to anyone?

I forgot to add: I think we should only introduce such a change if/when
the need occurs.  We may never need it, and having a 'yes' only bias
forces us to offer only quality additions that we think users ought to
want enabled ;-).

-- 
Thanks,
Maxim


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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-11 18:38   ` zimoun
@ 2022-10-17  1:22     ` Maxim Cournoyer
  2022-10-17  7:55       ` zimoun
  0 siblings, 1 reply; 8+ messages in thread
From: Maxim Cournoyer @ 2022-10-17  1:22 UTC (permalink / raw)
  To: zimoun; +Cc: Tobias Geerinckx-Rice, Jonas Freimuth, Guix-devel

Hi Simon,

zimoun <zimon.toutoune@gmail.com> writes:

[...]

>> Conversely, I'd like to add a comment that does commit to always 
>> keeping ‘yes '' | bash guix-install.sh’ working, assuming there 
>> was no other input or detected issues.  Also nice for humans in a 
>> hurry.
>>
>> Does that seem unreasonable to anyone?
>
> From my point of view, it could nice to have a way to run the
> installation script without any human action.  For instance, install
> Guix in some GitHub/Gitlab CI.

If I understood Tobias, they were not suggesting to make the
non-interactive installation use case harder/impossible, just to change
it from 'yes | ./install.sh' to 'yes "" | ./install.sh', which would
give us the freedom to choose a default value of either yes or no for
each question.

Hope that helps!

-- 
Thanks,
Maxim


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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-17  1:22     ` Maxim Cournoyer
@ 2022-10-17  7:55       ` zimoun
  2022-10-17 21:22         ` Maxim Cournoyer
  0 siblings, 1 reply; 8+ messages in thread
From: zimoun @ 2022-10-17  7:55 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: Tobias Geerinckx-Rice, Jonas Freimuth, Guix-devel

Hi Maxim,

On dim., 16 oct. 2022 at 21:22, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

> If I understood Tobias, they were not suggesting to make the
> non-interactive installation use case harder/impossible, just to change
> it from 'yes | ./install.sh' to 'yes "" | ./install.sh', which would
> give us the freedom to choose a default value of either yes or no for
> each question.

Thanks for explaining.

IIUC, is the point to have 'default | ./install.sh'?


Cheers,
simon


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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-17  7:55       ` zimoun
@ 2022-10-17 21:22         ` Maxim Cournoyer
  2022-10-17 21:58           ` zimoun
  0 siblings, 1 reply; 8+ messages in thread
From: Maxim Cournoyer @ 2022-10-17 21:22 UTC (permalink / raw)
  To: zimoun; +Cc: Tobias Geerinckx-Rice, Jonas Freimuth, Guix-devel

Hi,

zimoun <zimon.toutoune@gmail.com> writes:

> Hi Maxim,
>
> On dim., 16 oct. 2022 at 21:22, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
>
>> If I understood Tobias, they were not suggesting to make the
>> non-interactive installation use case harder/impossible, just to change
>> it from 'yes | ./install.sh' to 'yes "" | ./install.sh', which would
>> give us the freedom to choose a default value of either yes or no for
>> each question.
>
> Thanks for explaining.
>
> IIUC, is the point to have 'default | ./install.sh'?

What do you mean by 'default | ./install.sh' ?  I think Tobias' point
was to have the ability for a newline (RET) to mean either YES or NO,
compared to the current case where it always mean YES.  "yes ''" does
this: enter nothing then RET, repeatedly.

-- 
Thanks,
Maxim


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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-17 21:22         ` Maxim Cournoyer
@ 2022-10-17 21:58           ` zimoun
  0 siblings, 0 replies; 8+ messages in thread
From: zimoun @ 2022-10-17 21:58 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: Tobias Geerinckx-Rice, Jonas Freimuth, Guix-devel

Hi,

On Mon, 17 Oct 2022 at 17:22, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

> What do you mean by 'default | ./install.sh' ?

Nothing relevant. :-)

>                                                 I think Tobias' point
> was to have the ability for a newline (RET) to mean either YES or NO,
> compared to the current case where it always mean YES.  "yes ''" does
> this: enter nothing then RET, repeatedly.

Ah, yes.  For sure.   Sorry for the noise.


Cheers,
simon


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

end of thread, other threads:[~2022-10-18 10:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <9e3dc221-9013-d58a-402b-696b117a99a6@posteo.de>
2022-10-11 16:26 ` bug#58417: Installer script no longer works with `yes` utility Tobias Geerinckx-Rice
2022-10-11 18:38   ` zimoun
2022-10-17  1:22     ` Maxim Cournoyer
2022-10-17  7:55       ` zimoun
2022-10-17 21:22         ` Maxim Cournoyer
2022-10-17 21:58           ` zimoun
2022-10-11 19:29   ` Maxim Cournoyer
2022-10-11 19:32   ` Maxim Cournoyer

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