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

Modified Files:
      Tag: branch_0_24
        CLI.pm Engine.pm Services.pm Validation.pm 
Log Message:
Backport doc fixes from HEAD


Index: Services.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Services.pm,v
retrieving revision 1.152.2.5
retrieving revision 1.152.2.6
diff -u -d -r1.152.2.5 -r1.152.2.6
--- Services.pm 13 Jul 2005 02:24:10 -0000      1.152.2.5
+++ Services.pm 14 Jul 2005 03:01:33 -0000      1.152.2.6
@@ -412,30 +412,41 @@
 The optional %options are given as option=>value pairs. The following
 options are known:
 
-    quiet
+=over 4
 
-        If the option 'quiet' is not given or its value is false and
-        the command failed, a message including the return code is
-        sent to STDOUT.
+=item quiet
 
-    nonroot_okay
+If the option 'quiet' is not given or its value is false and the
+command failed, a message including the return code is sent to STDOUT.
 
-        If the value of the option 'nonroot_okay' is true, fink was
-        run with the --build-as-nobody flag, drop to user=nobody
-        when running the actual commands.
+=item nonroot_okay
 
-    delete_tempfile
+If the value of the option 'nonroot_okay' is true, fink was run with
+the --build-as-nobody flag, drop to user=nobody when running the
+actual commands.
 
-        Whether to delete temp-files that are created. The following
-        values are known:
+=item delete_tempfile
 
-            -1    Always delete
+Whether to delete temp-files that are created. The following values
+are known:
 
-            0 (or not passed)
-                  Delete if script was successful, do not delete if
-                  it failed
+=over 4
 
-            1     Never delete
+=item * -1
+
+Always delete
+
+=item * 0 (or not passed)
+
+Delete if script was successful, do not delete if it failed
+
+=item * 1
+
+Never delete
+
+=back
+
+=back
 
 =cut
 
@@ -1100,7 +1111,7 @@
                '3.1' => '3',
                '3.3' => '3.3',
                '4.0.0' => '4.0',
-               '4.0.1' => '4.0'
+               '4.0.1' => '4.0',
        );
        
        sub gcc_select_arg {
@@ -1190,7 +1201,7 @@
                $sw_vers =~ s/^(\d*\.\d*).*/$1/;
                $gcc = $osx_default{$sw_vers};
        } else {
-        my $darwin_version = (uname())[2];
+               my $darwin_version = (uname())[2];
                $current_system = "Darwin $darwin_version";
                $darwin_version =~ s/^(\d*).*/$1/;
                $gcc = $darwin_default{$darwin_version};
@@ -1203,6 +1214,7 @@
        }
 
        $gcc_select = gcc_selected() || '(unknown version)';
+       # We don't want to differentiate between 4.0.0 and 4.0.1 here
        $gcc_select =~ s/(\d+\.\d+)\.\d+/$1/;
 
        if ($gcc_select !~ /^$gcc/) {

Index: Engine.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Engine.pm,v
retrieving revision 1.242.2.5
retrieving revision 1.242.2.6
diff -u -d -r1.242.2.5 -r1.242.2.6
--- Engine.pm   13 Jul 2005 00:04:39 -0000      1.242.2.5
+++ Engine.pm   14 Jul 2005 03:01:32 -0000      1.242.2.6
@@ -54,6 +54,17 @@
        %EXPORT_TAGS = ( );             # eg: TAG => [ qw!name1 name2! ],
 }
 our @EXPORT_OK;
+=head1 NAME
+
+Fink::Engine - high-level actions for fink to perform
+
+=head1 DESCRIPTION
+
+=head2 Methods
+
+=over 4
+
+=cut
 
 # The list of commands. Maps command names to a list containing
 # a function reference, and three flags. The first flag indicates
@@ -493,6 +504,7 @@
                        next unless ( $vo->has_param("Description") && 
$vo->param("Description") =~ /\Q$pattern\E/i ) || $vo->get_name() =~ 
/\Q$pattern\E/i;  
                }
                if ($namelen && length($pname) > $namelen) {
+                       # truncate pkg name if wider than its field
                        $pname = substr($pname, 0, $namelen - 3)."...";
                }
 
@@ -2358,5 +2370,9 @@
        }
 }
 
+=back
+
+=cut
+
 ### EOF
 1;

Index: Validation.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Validation.pm,v
retrieving revision 1.170.2.1
retrieving revision 1.170.2.2
diff -u -d -r1.170.2.1 -r1.170.2.2
--- Validation.pm       12 Jul 2005 21:17:09 -0000      1.170.2.1
+++ Validation.pm       14 Jul 2005 03:01:34 -0000      1.170.2.2
@@ -249,6 +249,9 @@
 
 
 
+#
+# Check a given .deb file for standard compliance
+# 
 # Should check/verifies the following in .info files:
 #      + the filename matches %f.info
 #      + patch file (from Patch and PatchScript) is present
@@ -843,6 +846,7 @@
 # - only gettext should should have charset.alias
 # - If a package *Script uses debconf, it should Depends:debconf
 #   (TODO: should be in preinst not postinst, should be PreDepends not Depends)
+# - if a pkg is a -pmXXX but installs files that are not in a XXX-specific path
 # - any other ideas?
 #
 sub validate_dpkg_file {

Index: CLI.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/CLI.pm,v
retrieving revision 1.21.2.2
retrieving revision 1.21.2.3
diff -u -d -r1.21.2.2 -r1.21.2.3
--- CLI.pm      13 Jul 2005 19:12:30 -0000      1.21.2.2
+++ CLI.pm      14 Jul 2005 03:01:32 -0000      1.21.2.3
@@ -39,9 +39,10 @@
        # your exported package globals go here,
        # as well as any optionally exported functions
        @EXPORT_OK       = qw(&print_breaking &print_breaking_stderr
+                                         &rejoin_text
                                          &prompt &prompt_boolean 
&prompt_selection
                                          &print_optionlist
-                                         &get_term_width &rejoin_text);
+                                         &get_term_width);
 }
 our @EXPORT_OK;
 
@@ -64,8 +65,8 @@
 No functions are exported by default. You can get whichever ones you
 need with things like:
 
-    use Fink::Services '&prompt_boolean';
-    use Fink::Services qw(&print_breaking &prompt);
+    use Fink::CLI '&prompt_boolean';
+    use Fink::CLI qw(&print_breaking &prompt);
 
 =over 4
 
@@ -190,29 +191,34 @@
     my $answer = prompt $prompt, %options;
 
 Ask the user a question and return the answer. The user is prompted
-via STDOUT/STDIN using $prompt (which is word-wrapped).
+via STDOUT/STDIN using $prompt (which is word-wrapped). The trailing
+newline from the user's entry is removed.
 
 The %options are given as option => value pairs. The following
 options are known:
 
-       default (optional)
-       
-               If the option 'default' is given, then its value will be
-               returned if no input is detected.
-               
-               This can occur if the user enters a null string, or if Fink
-               is configured to automatically accept defaults (i.e., bin/fink
-               was invoked with the -y or --yes option).
-               
-               Default value: null string
-               
-       timeout (optional)
-       
-               The 'timeout' option establishes a wait period (in seconds) for
-               the prompt, after which the default answer will be used.
-               If a timeout is given, any existing alarm() is destroyed.
-               
-               Default value: no timeout
+=over 4
+
+=item default (optional)
+
+If the option 'default' is given, then its value will be
+returned if no input is detected.
+
+This can occur if the user enters a null string, or if Fink
+is configured to automatically accept defaults (i.e., bin/fink
+was invoked with the -y or --yes option).
+
+Default value: null string
+
+=item timeout (optional)
+
+The 'timeout' option establishes a wait period (in seconds) for
+the prompt, after which the default answer will be used.
+If a timeout is given, any existing alarm() is destroyed.
+
+Default value: no timeout
+
+=back
 
 =cut
 
@@ -238,24 +244,28 @@
 The %options are given as option => value pairs. The following
 options are known:
 
-       default (optional)
-       
-               If the option 'default' is given, then its B<truth>-value will 
be
-               returned if no input is detected.
-               
-               This can occur if the user enters a null string, or if Fink
-               is configured to automatically accept defaults (i.e., bin/fink
-               was invoked with the -y or --yes option).
-               
-               Default value: true
-               
-       timeout (optional)
-       
-               The 'timeout' option establishes a wait period (in seconds) for
-               the prompt, after which the default answer will be used.
-               If a timeout is given, any existing alarm() is destroyed.
-               
-               Default value: no timeout
+=over 4
+
+=item default (optional)
+
+If the option 'default' is given, then its B<truth>-value will be
+returned if no input is detected.
+
+This can occur if the user enters a null string, or if Fink
+is configured to automatically accept defaults (i.e., bin/fink
+was invoked with the -y or --yes option).
+
+Default value: true
+
+=item timeout (optional)
+
+The 'timeout' option establishes a wait period (in seconds) for
+the prompt, after which the default answer will be used.
+If a timeout is given, any existing alarm() is destroyed.
+
+Default value: no timeout
+
+=back
 
 =cut
 
@@ -295,46 +305,49 @@
 
     my $answer = prompt_selection $prompt, %options;
 
-Ask the user a multiple-choice question and return the answer. The
-user is prompted via STDOUT/STDIN using $prompt (which is
+Ask the user a multiple-choice question and return the value for the
+choice. The user is prompted via STDOUT/STDIN using $prompt (which is
 word-wrapped) and a list of choices. The choices are numbered
 (beginning with 1) and the user selects by number.
 
 The %options are given as option => value pairs. The following
 options are known:
-       
-       choices (required)
-               
-               The option 'choices' must be a reference to an ordered pairwise
-               array [ label1 => value1, label2 => value2, ... ]. The labels 
will
-               be displayed to the user; the values are the return values if 
that
-               option is chosen.
-       
-       default (optional)
-       
-               If the option 'default' is given, then it determines which 
choice
-               will be returned if no input is detected.
-               
-               This can occur if the user enters a null string, or if Fink
-               is configured to automatically accept defaults (i.e., bin/fink
-               was invoked with the -y or --yes option).
-               
-               The following formats are recognized for the 'default' option:
-               
-                 @default = [];                   # choice 1
-                 @default = ["number", $number];  # choice $number
-                 @default = ["label", $label];    # first choice with label 
$label
-                 @default = ["value", $label];    # first choice with value 
$value
-               
-               Default value: choice 1
-               
-       timeout (optional)
-       
-               The 'timeout' option establishes a wait period (in seconds) for
-               the prompt, after which the default answer will be used.
-               If a timeout is given, any existing alarm() is destroyed.
-               
-               Default value: no timeout
+=over 4
+
+=item choices (required)
+
+The option 'choices' must be a reference to an ordered pairwise
+array [ label1 => value1, label2 => value2, ... ]. The labels will
+be displayed to the user; the values are the return values if that
+option is chosen.
+
+=item default (optional)
+
+If the option 'default' is given, then it determines which choice
+will be returned if no input is detected.
+
+This can occur if the user enters a null string, or if Fink
+is configured to automatically accept defaults (i.e., bin/fink
+was invoked with the -y or --yes option).
+
+The following formats are recognized for the 'default' option:
+
+  @default = [];                   # choice 1
+  @default = ["number", $number];  # choice $number
+  @default = ["label", $label];    # first choice with label $label
+  @default = ["value", $label];    # first choice with value $value
+
+Default value: choice 1
+
+=item timeout (optional)
+
+The 'timeout' option establishes a wait period (in seconds) for
+the prompt, after which the default answer will be used.
+If a timeout is given, any existing alarm() is destroyed.
+
+Default value: no timeout
+
+=back
 
 =cut
 
@@ -413,6 +426,8 @@
 expires or immediately (without waiting for input) if fink is run with
 the -y option. If not -y, this function destroys any pre-existing
 alarm().
+STDIN is flushed before accepting input, so stray keystrokes prior to
+the prompt are ignored.
 
 =cut
 
@@ -420,7 +435,7 @@
        my $prompt = shift;
        my $timeout = shift || 0;
 
-       use POSIX qw(:termios_h tcflush);
+       use POSIX qw(tcflush TCIFLUSH);
        
        # print the prompt string (leaving cursor on the same line)
        $prompt = "" if !defined $prompt;



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to