[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1007121: /usr/share/bug/apt/script: 10: yesno: not found



Control: retitle -1 apt: "reportbug apt" gives "yesno: not found" - /usr/share/bug/apt/script should use bash

On 2022-03-11 16:26:06 +0100, Vincent Lefevre wrote:
> With reportbug on apt, I get errors like
> 
> /usr/share/bug/apt/script: 10: yesno: not found
> The package bug script /usr/share/bug/apt/script exited with an error status (return code = 32512). Do you still want to file a report [y|N|q|?]? 
> 
> A missing shell function?

Actually, this script should use bash:

reportbug (3.23) unstable; urgency=medium
[...]
  * Document that handling scripts must use #!/bin/bash to use getkey and
    yesno--this has always been the case since the days of bug, but never was
    documented anywhere.  (Closes: #294954)
[...]
 -- Chris Lawrence <lawrencc@debian.org>  Fri, 11 Aug 2006 18:16:50 -0500

See /usr/share/doc/reportbug/README.developers.gz:

While the script is executed, the following shell functions are
available ONLY IF IT IS RUN UNDER /bin/bash::

        getkey                          - asks for a key
        yesno <prompt> "yep"|"nop"      - ask for a yes/no answer (with i18n)
                                          leaves response as yep or nop
                                          in REPLY. The second argument is
                                          the default.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: