Update of /cvsroot/fink/fink/perlmod/Fink In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4654
Modified Files: PkgVersion.pm CLI.pm ChangeLog Log Message: (Re)introduce CLI::prompt_selection() with timeout; remove timeout from CLI::prompt_selection_new(). Index: PkgVersion.pm =================================================================== RCS file: /cvsroot/fink/fink/perlmod/Fink/PkgVersion.pm,v retrieving revision 1.343 retrieving revision 1.344 diff -u -d -r1.343 -r1.344 --- PkgVersion.pm 14 Jan 2005 19:21:08 -0000 1.343 +++ PkgVersion.pm 17 Jan 2005 06:07:09 -0000 1.344 @@ -2883,7 +2883,7 @@ "the file manually to save disk space. ". "Continuing with normal procedure."); - die("buildlock failure") if $lock_failed; + die "buildlock failure\n" if $lock_failed; # successfully get lock, so record ourselves $self->{_lockpkg} = $lockpkg; Index: CLI.pm =================================================================== RCS file: /cvsroot/fink/fink/perlmod/Fink/CLI.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- CLI.pm 17 Jan 2005 03:47:27 -0000 1.16 +++ CLI.pm 17 Jan 2005 06:07:09 -0000 1.17 @@ -39,7 +39,7 @@ # your exported package globals go here, # as well as any optionally exported functions @EXPORT_OK = qw(&print_breaking &print_breaking_stderr - &prompt &prompt_boolean &prompt_selection_new + &prompt &prompt_boolean &prompt_selection_new &prompt_selection &print_optionlist &get_term_width); } @@ -238,7 +238,23 @@ =item prompt_selection_new my $answer = prompt_selection_new $prompt, [EMAIL PROTECTED], @choices; - my $answer = prompt_selection_new $prompt, [EMAIL PROTECTED], @choices, $timeout; + +Compatibility during API migration. Use prompt_selection() instead. + +=cut + +sub prompt_selection_new { + my $prompt = shift; + my $default = shift; + my @choices = @_; + + &prompt_selection($prompt, $default, [EMAIL PROTECTED]); +} + +=item prompt_selection + + my $answer = prompt_selection $prompt, [EMAIL PROTECTED], [EMAIL PROTECTED]; + my $answer = prompt_selection $prompt, [EMAIL PROTECTED], [EMAIL PROTECTED], $timeout; Ask the user a multiple-choice question and return the answer. The user is prompted via STDOUT/STDIN using $prompt (which is @@ -261,16 +277,17 @@ =cut -sub prompt_selection_new { +sub prompt_selection { my $prompt = shift; my $default = shift; - my @choices = @_; + my $choices = shift; + my @choices = @$choices; my $timeout = shift || 0; my ($count, $answer, $default_value); if (@choices/2 != int(@choices/2)) { - confess "Odd number of elements in [EMAIL PROTECTED]"; + confess 'Odd number of elements in @choices'; } if (!defined $default->[0]) { Index: ChangeLog =================================================================== RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v retrieving revision 1.808 retrieving revision 1.809 diff -u -d -r1.808 -r1.809 --- ChangeLog 17 Jan 2005 05:04:43 -0000 1.808 +++ ChangeLog 17 Jan 2005 06:07:09 -0000 1.809 @@ -1,3 +1,9 @@ +2005-01-17 Daniel Macks <[EMAIL PROTECTED]> + + * CLI.pm: (Re)introduce prompt_selection() with timeout; remove + timeout from prompt_selection_new(). + * PkgVersion.pm: Fix error msg for buildlock failure. + 2005-01-16 Daniel Macks <[EMAIL PROTECTED]> * CLI.pm: Add $timeout param to prompt() and prompt_selection_new(). ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Fink-commits mailing list Fink-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fink-commits