Change 30308 by [EMAIL PROTECTED] on 2007/02/14 23:20:38

        Integrate:
        [ 27562]
        Upgrade to Digest-1.15
        
        [ 28580]
        Upgrade to ANSIColor-1.11

Affected files ...

... //depot/maint-5.8/perl/MANIFEST#336 integrate
... //depot/maint-5.8/perl/lib/Digest.pm#10 integrate
... //depot/maint-5.8/perl/lib/Digest/Changes#3 integrate
... //depot/maint-5.8/perl/lib/Term/ANSIColor.pm#7 integrate
... //depot/maint-5.8/perl/lib/Term/ANSIColor/ChangeLog#6 integrate
... //depot/maint-5.8/perl/lib/Term/ANSIColor/README#6 integrate
... //depot/maint-5.8/perl/lib/Term/ANSIColor/t/basic.t#1 branch
... //depot/maint-5.8/perl/lib/Term/ANSIColor/t/pod.t#1 branch
... //depot/maint-5.8/perl/lib/Term/ANSIColor/test.pl#5 delete

Differences ...

==== //depot/maint-5.8/perl/MANIFEST#336 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#335~30307~    2007-02-14 14:42:21.000000000 -0800
+++ perl/MANIFEST       2007-02-14 15:20:38.000000000 -0800
@@ -1903,7 +1903,8 @@
 lib/Term/ANSIColor/ChangeLog   Term::ANSIColor
 lib/Term/ANSIColor.pm          Perl module supporting termcap usage
 lib/Term/ANSIColor/README      Term::ANSIColor
-lib/Term/ANSIColor/test.pl     See if Term::ANSIColor works
+lib/Term/ANSIColor/t/basic.t   Tests for Term::ANSIColor
+lib/Term/ANSIColor/t/pod.t     Tests for Term::ANSIColor
 lib/termcap.pl                 Perl library supporting termcap usage
 lib/Term/Cap.pm                        Perl module supporting termcap usage
 lib/Term/Cap.t                 See if Term::Cap works

==== //depot/maint-5.8/perl/lib/Digest.pm#10 (text) ====
Index: perl/lib/Digest.pm
--- perl/lib/Digest.pm#9~26599~ 2006-01-03 04:44:38.000000000 -0800
+++ perl/lib/Digest.pm  2007-02-14 15:20:38.000000000 -0800
@@ -3,7 +3,7 @@
 use strict;
 use vars qw($VERSION %MMAP $AUTOLOAD);
 
-$VERSION = "1.14";
+$VERSION = "1.15";
 
 %MMAP = (
   "SHA-1"      => ["Digest::SHA1", ["Digest::SHA", 1], ["Digest::SHA2", 1]],
@@ -167,10 +167,26 @@
 
 This is just an alias for $ctx->new.
 
-=item $ctx->add( $data, ... )
+=item $ctx->add( $data )
 
-The $data provided as argument are appended to the message we
-calculate the digest for.  The return value is the $ctx object itself.
+=item $ctx->add( $chunk1, $chunk2, ... )
+
+The string value of the $data provided as argument is appended to the
+message we calculate the digest for.  The return value is the $ctx
+object itself.
+
+If more arguments are provided then they are all appended to the
+message, thus all these lines will have the same effect on the state
+of the $ctx object:
+
+  $ctx->add("a"); $ctx->add("b"); $ctx->add("c");
+  $ctx->add("a")->add("b")->add("c");
+  $ctx->add("a", "b", "c");
+  $ctx->add("abc");
+
+Most algorithms are only defined for strings of bytes and this method
+might therefore croak if the provided arguments contain chars with
+ordinal number above 255.
 
 =item $ctx->addfile( $io_handle )
 
@@ -178,29 +194,42 @@
 message we calculate the digest for.  The return value is the $ctx
 object itself.
 
+The addfile() method will croak() if it fails reading data for some
+reason.  If it croaks it is unpredictable what the state of the $ctx
+object will be in. The addfile() method might have been able to read
+the file partially before it failed.  It is probably wise to discard
+or reset the $ctx object if this occurs.
+
+In most cases you want to make sure that the $io_handle is in
+"binmode" before you pass it as argument to the addfile() method.
+
 =item $ctx->add_bits( $data, $nbits )
 
 =item $ctx->add_bits( $bitstring )
 
-The bits provided are appended to the message we calculate the digest
-for.  The return value is the $ctx object itself.
+The add_bits() method is an alternative to add() that allow partial
+bytes to be appended to the message.  Most users should just ignore
+this method as partial bytes is very unlikely to be of any practical
+use.
 
 The two argument form of add_bits() will add the first $nbits bits
-from data.  For the last potentially partial byte only the high order
+from $data.  For the last potentially partial byte only the high order
 C<< $nbits % 8 >> bits are used.  If $nbits is greater than C<<
 length($data) * 8 >>, then this method would do the same as C<<
-$ctx->add($data) >>, that is $nbits is silently ignored.
+$ctx->add($data) >>.
 
 The one argument form of add_bits() takes a $bitstring of "1" and "0"
 chars as argument.  It's a shorthand for C<< $ctx->add_bits(pack("B*",
 $bitstring), length($bitstring)) >>.
 
+The return value is the $ctx object itself.
+
 This example shows two calls that should have the same effect:
 
    $ctx->add_bits("111100001010");
    $ctx->add_bits("\xF0\xA0", 12);
 
-Most digest algorithms are byte based.  For those it is not possible
+Most digest algorithms are byte based and for these it is not possible
 to add bits that are not a multiple of 8, and the add_bits() method
 will croak if you try.
 
@@ -212,7 +241,7 @@
 read-once operation. Once it has been performed, the $ctx object is
 automatically C<reset> and can be used to calculate another digest
 value.  Call $ctx->clone->digest if you want to calculate the digest
-without reseting the digest state.
+without resetting the digest state.
 
 =item $ctx->hexdigest
 
@@ -268,6 +297,8 @@
 
 L<MIME::Base64>
 
+http://en.wikipedia.org/wiki/Cryptographic_hash_function
+
 =head1 AUTHOR
 
 Gisle Aas <[EMAIL PROTECTED]>
@@ -278,7 +309,7 @@
 This library is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.
 
-    Copyright 1998-2001,2003-2004 Gisle Aas.
-    Copyright 1995-1996 Neil Winton.
+    Copyright 1998-2006 Gisle Aas.
+    Copyright 1995,1996 Neil Winton.
 
 =cut

==== //depot/maint-5.8/perl/lib/Digest/Changes#3 (text) ====
Index: perl/lib/Digest/Changes
--- perl/lib/Digest/Changes#2~26599~    2006-01-03 04:44:38.000000000 -0800
+++ perl/lib/Digest/Changes     2007-02-14 15:20:38.000000000 -0800
@@ -1,3 +1,11 @@
+2006-13-20   Gisle Aas <[EMAIL PROTECTED]>
+
+   Release 1.15.
+
+   Improved documentation.
+
+
+
 2005-11-26   Gisle Aas <[EMAIL PROTECTED]>
 
    Release 1.14

==== //depot/maint-5.8/perl/lib/Term/ANSIColor.pm#7 (text) ====
Index: perl/lib/Term/ANSIColor.pm
--- perl/lib/Term/ANSIColor.pm#6~25382~ 2005-09-10 14:38:40.000000000 -0700
+++ perl/lib/Term/ANSIColor.pm  2007-02-14 15:20:38.000000000 -0800
@@ -1,7 +1,7 @@
 # Term::ANSIColor -- Color screen output using ANSI escape sequences.
-# $Id: ANSIColor.pm,v 1.10 2005/08/21 18:31:58 eagle Exp $
+# $Id: ANSIColor.pm 58 2006-07-12 22:30:55Z eagle $
 #
-# Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2005
+# Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2005, 2006
 #   by Russ Allbery <[EMAIL PROTECTED]> and Zenin
 #
 # This program is free software; you may redistribute it and/or modify it
@@ -32,9 +32,7 @@
                                  ON_CYAN ON_WHITE)]);
 Exporter::export_ok_tags ('constants');
 
-# Don't use the CVS revision as the version, since this module is also in Perl
-# core and too many things could munge CVS magic revision strings.
-$VERSION = '1.10';
+$VERSION = '1.11';
 
 ##############################################################################
 # Internal data structures
@@ -209,9 +207,10 @@
     print "This text is bold blue.\n";
     print color 'reset';
     print "This text is normal.\n";
-    print colored ("Yellow on magenta.\n", 'yellow on_magenta');
+    print colored ("Yellow on magenta.", 'yellow on_magenta'), "\n";
     print "This text is normal.\n";
-    print colored ['yellow on_magenta'], "Yellow on magenta.\n";
+    print colored ['yellow on_magenta'], 'Yellow on magenta.';
+    print "\n";
 
     use Term::ANSIColor qw(uncolor);
     print uncolor '01;31', "\n";
@@ -269,10 +268,12 @@
 the string, but if you set $Term::ANSIColor::EACHLINE to some string, that
 string will be considered the line delimiter and the attribute will be set
 at the beginning of each line of the passed string and reset at the end of
-each line.  This is often desirable if the output is being sent to a program
-like a pager that can be confused by attributes that span lines.  Normally
-you'll want to set $Term::ANSIColor::EACHLINE to C<"\n"> to use this
-feature.
+each line.  This is often desirable if the output contains newlines and
+you're using background colors, since a background color that persists
+across a newline is often interpreted by the terminal as providing the
+default background color for the next line.  Programs like pagers can also
+be confused by attributes that span lines.  Normally you'll want to set
+$Term::ANSIColor::EACHLINE to C<"\n"> to use this feature.
 
 Alternately, if you import C<:constants>, you can use the constants CLEAR,
 RESET, BOLD, DARK, UNDERLINE, UNDERSCORE, BLINK, REVERSE, CONCEALED, BLACK,
@@ -280,11 +281,14 @@
 ON_YELLOW, ON_BLUE, ON_MAGENTA, ON_CYAN, and ON_WHITE directly.  These are
 the same as color('attribute') and can be used if you prefer typing:
 
-    print BOLD BLUE ON_WHITE "Text\n", RESET;
+    print BOLD BLUE ON_WHITE "Text", RESET, "\n";
 
 to
 
-    print colored ("Text\n", 'bold blue on_white');
+    print colored ("Text", 'bold blue on_white'), "\n";
+
+(Note that the newline is kept separate to avoid confusing the terminal as
+described above since a background color is being used.)
 
 When using the constants, if you don't want to have to remember to add the
 C<, RESET> at the end of each print line, you can set
@@ -298,7 +302,9 @@
 
     print BOLD, BLUE, "Text\n";
 
-will not.
+will not.  If you are using background colors, you will probably want to
+print the newline with a separate print statement to avoid confusing the
+terminal.
 
 The subroutine interface has the advantage over the constants interface in
 that only two subroutines are exported into your namespace, versus
@@ -306,7 +312,7 @@
 interface has the advantage of better compile time error checking, since
 misspelled names of colors or attributes in calls to color() and colored()
 won't be caught until runtime whereas misspelled names of constants will be
-caught at compile time.  So, polute your namespace with almost two dozen
+caught at compile time.  So, pollute your namespace with almost two dozen
 subroutines that you may not even use that often, or risk a silly bug by
 mistyping an attribute.  Your choice, TMTOWTDI after all.
 
@@ -391,7 +397,7 @@
 constants aren't required, in which case you may feel free to insert commas
 unless you're using $Term::ANSIColor::AUTORESET.)
 
-For easier debuging, you may prefer to always use the commas when not
+For easier debugging, you may prefer to always use the commas when not
 setting $Term::ANSIColor::AUTORESET so that you'll get a fatal compile error
 rather than a warning.
 
@@ -465,8 +471,8 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 1996, 1997, 1998, 2000, 2001, 2002 Russ Allbery <[EMAIL PROTECTED]>
-and Zenin.  This program is free software; you may redistribute it and/or
-modify it under the same terms as Perl itself.
+Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2005, 2006 Russ Allbery
+<[EMAIL PROTECTED]> and Zenin.  This program is free software; you may
+redistribute it and/or modify it under the same terms as Perl itself.
 
 =cut

==== //depot/maint-5.8/perl/lib/Term/ANSIColor/ChangeLog#6 (text) ====
Index: perl/lib/Term/ANSIColor/ChangeLog
--- perl/lib/Term/ANSIColor/ChangeLog#5~25382~  2005-09-10 14:38:40.000000000 
-0700
+++ perl/lib/Term/ANSIColor/ChangeLog   2007-02-14 15:20:38.000000000 -0800
@@ -1,3 +1,18 @@
+2006-07-12  Russ Allbery  <[EMAIL PROTECTED]>
+
+       * ANSIColor.pm: Version 1.11 released.
+
+2006-06-22  Russ Allbery  <[EMAIL PROTECTED]>
+
+       * ANSIColor.pm: Clarify in the documentation the behavior of
+       terminals when background colors are set across newlines, and
+       rewrite some of the examples to avoid doing things that confuse
+       the terminal.  Fix a couple of spelling errors.
+
+       * test.pl: Moved to...
+       * t/basic.t: ...here.
+       * t/pod.t: New test for POD validity.
+
 2005-08-21  Russ Allbery  <[EMAIL PROTECTED]>
 
        * ANSIColor.pm: Version 1.10 released.

==== //depot/maint-5.8/perl/lib/Term/ANSIColor/README#6 (text) ====
Index: perl/lib/Term/ANSIColor/README
--- perl/lib/Term/ANSIColor/README#5~25382~     2005-09-10 14:38:40.000000000 
-0700
+++ perl/lib/Term/ANSIColor/README      2007-02-14 15:20:38.000000000 -0800
@@ -1,7 +1,7 @@
-                       Term::ANSIColor version 1.10
+                       Term::ANSIColor version 1.11
               (A simple ANSI text attribute control module)
 
-  Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2005 Russ Allbery
+  Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2005, 2006 Russ Allbery
   <[EMAIL PROTECTED]> and Zenin.  This program is free software; you may
   redistribute it and/or modify it under the same terms as Perl itself.
 
@@ -98,4 +98,7 @@
   To James Bowlin for catching a bug in colored when $EACHLINE is set that
   caused it to not color lines consisting solely of 0.
 
+  To Helge Kreutzmann for pointing out the need for warnings in the
+  documentation about background colors that span newlines.
+
   To Larry Wall, as always, for Perl.

==== //depot/maint-5.8/perl/lib/Term/ANSIColor/t/basic.t#1 (text) ====
Index: perl/lib/Term/ANSIColor/t/basic.t
--- /dev/null   2007-01-16 11:55:45.526841103 -0800
+++ perl/lib/Term/ANSIColor/t/basic.t   2007-02-14 15:20:38.000000000 -0800
@@ -0,0 +1,133 @@
+#!/usr/bin/perl
+# $Id: basic.t 55 2006-06-22 17:56:02Z eagle $
+#
+# t/basic.t -- Test suite for the Term::ANSIColor Perl module.
+
+##############################################################################
+# Ensure module can be loaded
+##############################################################################
+
+BEGIN { $| = 1; print "1..16\n" }
+END   { print "not ok 1\n" unless $loaded }
+delete $ENV{ANSI_COLORS_DISABLED};
+use Term::ANSIColor qw(:constants color colored uncolor);
+$loaded = 1;
+print "ok 1\n";
+
+##############################################################################
+# Test suite
+##############################################################################
+
+# Test simple color attributes.
+if (color ('blue on_green', 'bold') eq "\e[34;42;1m") {
+    print "ok 2\n";
+} else {
+    print "not ok 2\n";
+}
+
+# Test colored.
+if (colored ("testing", 'blue', 'bold') eq "\e[34;1mtesting\e[0m") {
+    print "ok 3\n";
+} else {
+    print "not ok 3\n";
+}
+
+# Test the constants.
+if (BLUE BOLD "testing" eq "\e[34m\e[1mtesting") {
+    print "ok 4\n";
+} else {
+    print "not ok 4\n";
+}
+
+# Test AUTORESET.
+$Term::ANSIColor::AUTORESET = 1;
+if (BLUE BOLD "testing" eq "\e[34m\e[1mtesting\e[0m\e[0m") {
+    print "ok 5\n";
+} else {
+    print "not ok 5\n";
+}
+
+# Test EACHLINE.
+$Term::ANSIColor::EACHLINE = "\n";
+if (colored ("test\n\ntest", 'bold')
+    eq "\e[1mtest\e[0m\n\n\e[1mtest\e[0m") {
+    print "ok 6\n";
+} else {
+    print colored ("test\n\ntest", 'bold'), "\n";
+    print "not ok 6\n";
+}
+
+# Test EACHLINE with multiple trailing delimiters.
+$Term::ANSIColor::EACHLINE = "\r\n";
+if (colored ("test\ntest\r\r\n\r\n", 'bold')
+    eq "\e[1mtest\ntest\r\e[0m\r\n\r\n") {
+    print "ok 7\n";
+} else {
+    print "not ok 7\n";
+}
+
+# Test the array ref form.
+$Term::ANSIColor::EACHLINE = "\n";
+if (colored (['bold', 'on_green'], "test\n", "\n", "test")
+    eq "\e[1;42mtest\e[0m\n\n\e[1;42mtest\e[0m") {
+    print "ok 8\n";
+} else {
+    print colored (['bold', 'on_green'], "test\n", "\n", "test");
+    print "not ok 8\n";
+}
+
+# Test uncolor.
+my @names = uncolor ('1;42', "\e[m", '', "\e[0m");
+if (join ('|', @names) eq 'bold|on_green|clear') {
+    print "ok 9\n";
+} else {
+    print join ('|', @names), "\n";
+    print "not ok 9\n";
+}
+
+# Test ANSI_COLORS_DISABLED.
+$ENV{ANSI_COLORS_DISABLED} = 1;
+if (color ('blue') eq '') {
+    print "ok 10\n";
+} else {
+    print "not ok 10\n";
+}
+if (colored ('testing', 'blue', 'on_red') eq 'testing') {
+    print "ok 11\n";
+} else {
+    print "not ok 11\n";
+}
+if (GREEN 'testing' eq 'testing') {
+    print "ok 12\n";
+} else {
+    print "not ok 12\n";
+}
+delete $ENV{ANSI_COLORS_DISABLED};
+
+# Make sure DARK is exported.  This was omitted in versions prior to 1.07.
+if (DARK "testing" eq "\e[2mtesting\e[0m") {
+    print "ok 13\n";
+} else {
+    print "not ok 13\n";
+}
+
+# Test colored with 0 and EACHLINE.
+$Term::ANSIColor::EACHLINE = "\n";
+if (colored ('0', 'blue', 'bold') eq "\e[34;1m0\e[0m") {
+    print "ok 14\n";
+} else {
+    print "not ok 14\n";
+}
+if (colored ("0\n0\n\n", 'blue', 'bold')
+    eq "\e[34;1m0\e[0m\n\e[34;1m0\e[0m\n\n") {
+    print "ok 15\n";
+} else {
+    print "not ok 15\n";
+}
+
+# Test colored with the empty string and EACHLINE.
+if (colored ('', 'blue', 'bold') eq '') {
+    print "ok 16\n";
+} else {
+    print "not ok 16\n";
+}

==== //depot/maint-5.8/perl/lib/Term/ANSIColor/t/pod.t#1 (text) ====
Index: perl/lib/Term/ANSIColor/t/pod.t
--- /dev/null   2007-01-16 11:55:45.526841103 -0800
+++ perl/lib/Term/ANSIColor/t/pod.t     2007-02-14 15:20:38.000000000 -0800
@@ -0,0 +1,12 @@
+#!/usr/bin/perl
+# $Id: pod.t 55 2006-06-22 17:56:02Z eagle $
+#
+# t/pod.t -- Test POD formatting for Term::ANSIColor.
+
+eval 'use Test::Pod 1.00';
+if ($@) {
+    print "1..1\n";
+    print "ok 1 # skip - Test::Pod 1.00 required for testing POD\n";
+    exit;
+}
+all_pod_files_ok ();
End of Patch.

Reply via email to