Update of /cvsroot/fink/fink/perlmod/Fink
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13108/perlmod/Fink

Modified Files:
        CLI.pm ChangeLog Configure.pm Engine.pm PkgVersion.pm 
        SelfUpdate.pm 
Log Message:
Add a new "intro" param to prompt_selection.


Index: PkgVersion.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/PkgVersion.pm,v
retrieving revision 1.365
retrieving revision 1.366
diff -u -d -r1.365 -r1.366
--- PkgVersion.pm       24 Feb 2005 16:31:03 -0000      1.365
+++ PkgVersion.pm       24 Feb 2005 20:32:55 -0000      1.366
@@ -1873,13 +1873,14 @@
                        if ($checksum ne $found_archive_sum) {
                                # mismatch, ask user what to do
                                $tries++;
-                               &print_breaking("The checksum of the file 
$archive of package ".
-                                                               
$self->get_fullname()." is incorrect. The most likely ".
-                                                               "cause for this 
is a corrupted or incomplete download\n".
-                                                               "Expected: 
$checksum \nActual: $found_archive_sum \n".
-                                                               "It is 
recommended that you download it ".
-                                                               "again. How do 
you want to proceed?");
+                               my $sel_intro = "The checksum of the file 
$archive of package ".
+                                       $self->get_fullname()." is incorrect. 
The most likely ".
+                                       "cause for this is a corrupted or 
incomplete download\n".
+                                       "Expected: $checksum\nActual: 
$found_archive_sum\n".
+                                       "It is recommended that you download it 
".
+                                       "again. How do you want to proceed?";
                                $answer = &prompt_selection("Make your choice: 
",
+                                                               intro   => 
$sel_intro,
                                                                default => [ 
value => ($tries >= 3) ? "error" : "redownload" ],
                                                                choices => [
                                                                  "Give up" => 
"error",

Index: SelfUpdate.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/SelfUpdate.pm,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- SelfUpdate.pm       24 Feb 2005 18:19:26 -0000      1.83
+++ SelfUpdate.pm       24 Feb 2005 20:32:57 -0000      1.84
@@ -86,8 +86,8 @@
        # The user has not chosen a selfupdatemethod yet, always ask
        # if the fink.conf setting is not there.
        if ((! defined($config->param("SelfUpdateMethod") )) and $useopt == 0){
-               &print_breaking("fink needs you to choose a SelfUpdateMethod. 
\n");
                $answer = &prompt_selection("Choose an update method",
+                                               intro   => "fink needs you to 
choose a SelfUpdateMethod.",
                                                default => [ value => "rsync" ],
                                                choices => [
                                                  "rsync" => "rsync",

Index: CLI.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/CLI.pm,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- CLI.pm      24 Feb 2005 19:49:08 -0000      1.22
+++ CLI.pm      24 Feb 2005 20:32:53 -0000      1.23
@@ -316,6 +316,11 @@
 
 Default value: no timeout
 
+=item intro (optional)
+
+A text block that will be displayed before the list of options. This
+contrasts with the $prompt, which is goes afterwards.
+
 =back
 
 =cut
@@ -343,10 +348,17 @@
                confess "Unknown default type ",$default->[0];
        }
 
+       print "\n";
+
+       if (defined $opts{intro}) {
+               &print_breaking($opts{intro});
+               print "\n";
+       }
+
        $count = 0;
        for (my $index = 0; $index <= $#choices; $index+=2) {
                $count++;
-               print "\n($count)        $choices[$index]";
+               print "($count)  $choices[$index]\n";
                if (!defined $default_value && (
                                                (
                                                 ($default->[0] eq "label" && 
$choices[$index]   eq $default->[1])
@@ -359,7 +371,7 @@
 
        }
        $default_value = 1 if !defined $default_value;
-       print "\n\n";
+       print "\n";
 
        $answer = &get_input("$prompt [$default_value]", $opts{timeout});
        chomp($answer);

Index: Engine.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Engine.pm,v
retrieving revision 1.245
retrieving revision 1.246
diff -u -d -r1.245 -r1.246
--- Engine.pm   24 Feb 2005 18:19:24 -0000      1.245
+++ Engine.pm   24 Feb 2005 20:32:55 -0000      1.246
@@ -1575,10 +1575,8 @@
                                if ($founddebcnt > 1) {
                                   $choice = 1; # Do not select anything if 
more than one choice is available
                                }
-                               print "\n";
-                               &print_breaking("fink needs help picking an 
alternative to satisfy ".
-                                                               "a virtual 
dependency. The candidates:");
                                $dname = &prompt_selection("Pick one:",
+                                       intro   => "fink needs help picking an 
alternative to satisfy a virtual dependency. The candidates:",
                                        default => [number=>$choice], choices 
=> [EMAIL PROTECTED]);
                        }
 

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.879
retrieving revision 1.880
diff -u -d -r1.879 -r1.880
--- ChangeLog   24 Feb 2005 18:36:02 -0000      1.879
+++ ChangeLog   24 Feb 2005 20:32:54 -0000      1.880
@@ -1,3 +1,9 @@
+2005-02-23  Daniel Macks  <[EMAIL PROTECTED]>
+
+       * CLI.pm: Added new "intro" param to prompt_selection
+       * Configure.pm, Engine.pm, PkgVersion.pm, SelfUpdate.pm: use new
+       "intro" param to prompt_selection
+
 2005-02-24  Dave Morrison  <[EMAIL PROTECTED]>
 
        *VirtPackage.pm: perl packages now Provide digest-pm (when >= 5.8.0)

Index: Configure.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Configure.pm,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- Configure.pm        22 Feb 2005 16:15:30 -0000      1.38
+++ Configure.pm        24 Feb 2005 20:32:54 -0000      1.39
@@ -277,12 +277,11 @@
                }
        }
        
-       &print_breaking("\nThe Fink team maintains mirrors known as \"Master\" 
mirrors, which contain ".
-                                 "the sources for all fink packages. You can 
choose to use these mirrors first, ".
-                                         "last, never, or mixed in with 
regular mirrors. If you don't care, just select the default.\n");
-       
        $mirror_order = &prompt_selection(
                "What mirror order should fink use when downloading sources?",
+               intro   => "The Fink team maintains mirrors known as \"Master\" 
mirrors, which contain ".
+                          "the sources for all fink packages. You can choose 
to use these mirrors first, ".
+                          "last, never, or mixed in with regular mirrors. If 
you don't care, just select the default.",
                default => [ value => $config->param_default("MirrorOrder", 
"MasterFirst") ], 
                choices => [
                        "Search \"Master\" source mirrors first." => 
"MasterFirst",
@@ -294,8 +293,8 @@
        $config->set_param("MirrorOrder", $mirror_order);
        
        ### step 1: choose a continent
-       &print_breaking("Choose a continent:");
        $continent = &prompt_selection("Your continent?",
+               intro   => "Choose a continent:",
                default => [ value => $config->param_default("MirrorContinent", 
"-") ],
                choices => [
                        map { length($_)==3 ? ($keyinfo->{$_},$_) : () }
@@ -305,9 +304,8 @@
        $config->set_param("MirrorContinent", $continent);
 
        ### step 2: choose a country
-       print "\n";
-       &print_breaking("Choose a country:");
        $country = &prompt_selection("Your country?",
+               intro   => "Choose a country:",
                default => [ value => $config->param_default("MirrorCountry", 
$continent) ],
                choices => [
                        "No selection - display all mirrors on the continent" 
=> $continent,
@@ -346,9 +344,8 @@
                        push @mirrors, map { ( $keyinfo->{$continent}.": $_" => 
$_ ) } @{$all_mirrors->{$continent}};
                }
 
-               print "\n";
-               &print_breaking("Choose a mirror for '$mirrortitle':");
                $answer = &prompt_selection("Mirror for $mirrortitle?",
+                                               intro   => "Choose a mirror for 
'$mirrortitle':",
                                                default => [ number => 1 ],
                                                choices => [EMAIL PROTECTED] );
                $config->set_param("Mirror-$mirrorname", $answer);



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Fink-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to