[pacman-dev] -Sc and -Scc default actions

Dag Odenhall dag.odenhall at gmail.com
Wed Jun 6 14:19:43 EDT 2007


On Monday 04 June 2007 03:51:38 Dan McGee wrote:
> On 6/3/07, Roman Kyrylych <roman.kyrylych at gmail.com> wrote:
> >                 /* full cleanup */
> > -               if(!yesno(_("Do you want to remove all packages from
> > cache? [Y/n] "))) +               if(yesno(_("Do you want to remove all
> > packages from cache? [y/N] "))) return(0);
> >                 printf(_("removing all packages from cache... "));
>
> This change doesn't work quite as you intended, Roman. yesno() returns
> a 1 on three conditions- a 'Y' or 'YES' is entered, or nothing at all
> was entered. Thus, there is no easy way to change the default answer
> from Y. yesno() will need to be rewritten to support a parameter
> saying which answer should be the default.

Can't it simply return 1 for a yes, 0 for a nothing-at-all and -1 for a no, or 
something like it? I think it would be cleaner.

-- 
Dag Odenhall <xmpp:dag.odenhall at jabber.se>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: This is a digitally signed message part.
URL: <http://archlinux.org/pipermail/pacman-dev/attachments/20070606/30a6be3f/attachment.pgp>


More information about the pacman-dev mailing list