r14667 - in /branches/upstream/libtk-pod-perl/current: Changes META.yml Makefile.PL Pod.pm Pod/FindPods.pm Pod/Search_db.pm Pod/Text.pm Pod/WWWBrowser.pm TODO t/basic.t

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Sun Feb 10 02:16:34 UTC 2008


Author: gregoa-guest
Date: Sun Feb 10 02:16:33 2008
New Revision: 14667

URL: http://svn.debian.org/wsvn/?sc=1&rev=14667
Log:
[svn-upgrade] Integrating new upstream version, libtk-pod-perl (0.9938)

Modified:
    branches/upstream/libtk-pod-perl/current/Changes
    branches/upstream/libtk-pod-perl/current/META.yml
    branches/upstream/libtk-pod-perl/current/Makefile.PL
    branches/upstream/libtk-pod-perl/current/Pod.pm
    branches/upstream/libtk-pod-perl/current/Pod/FindPods.pm
    branches/upstream/libtk-pod-perl/current/Pod/Search_db.pm
    branches/upstream/libtk-pod-perl/current/Pod/Text.pm
    branches/upstream/libtk-pod-perl/current/Pod/WWWBrowser.pm
    branches/upstream/libtk-pod-perl/current/TODO
    branches/upstream/libtk-pod-perl/current/t/basic.t

Modified: branches/upstream/libtk-pod-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libtk-pod-perl/current/Changes?rev=14667&op=diff
==============================================================================
--- branches/upstream/libtk-pod-perl/current/Changes (original)
+++ branches/upstream/libtk-pod-perl/current/Changes Sun Feb 10 02:16:33 2008
@@ -1,4 +1,10 @@
 History for Tk::Pod
+
+version 0.9938	So  3 Feb 2008 19:12:04 CET
+	o The internal man viewer can handle utf-8 now.
+	o Upgraded to newer WWWBrowser version (changed Windows support)
+	o fix for ActivePerl: perl documentation is in "pods" directory
+	o special handling for a2p pod
 
 version 0.9937
 	o Make sure the displayed Pods in the tree match the actual @INC path

Modified: branches/upstream/libtk-pod-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libtk-pod-perl/current/META.yml?rev=14667&op=diff
==============================================================================
--- branches/upstream/libtk-pod-perl/current/META.yml (original)
+++ branches/upstream/libtk-pod-perl/current/META.yml Sun Feb 10 02:16:33 2008
@@ -2,7 +2,7 @@
     version: 1.3
     url: http://module-build.sourceforge.net/META-spec-v1.3.html
 name:         Tk-Pod
-version:      0.9937
+version:      0.9938
 abstract: Pod browser widget for Tk
 author:
     - Slaven Rezic <srezic at cpan.org>

Modified: branches/upstream/libtk-pod-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libtk-pod-perl/current/Makefile.PL?rev=14667&op=diff
==============================================================================
--- branches/upstream/libtk-pod-perl/current/Makefile.PL (original)
+++ branches/upstream/libtk-pod-perl/current/Makefile.PL Sun Feb 10 02:16:33 2008
@@ -2,7 +2,7 @@
 
 use ExtUtils::MakeMaker;
 
-$DIST_VERSION = "0.9937";
+$DIST_VERSION = "0.9938";
 $is_devel_host = defined $ENV{USER} && $ENV{USER} eq 'eserte' && $^O =~ /bsd/i && -f "../../perl.release.mk";
 if ($is_devel_host) {
     open(P, "Pod.pm") or die "Can't open Pod.pm: $!";
@@ -24,6 +24,15 @@
 	my $meta = YAML::LoadFile("META.yml");
 	if ($meta->{version} ne $DIST_VERSION) {
 	    die "Please fix version in META.yml!\n";
+	}
+	my $meta_schema = "../Kwalify/t/testdata/META-spec-1.3.yml";
+	if (is_in_path("pkwalify") && -f $meta_schema) {
+	    system("pkwalify", "-f", $meta_schema, "META.yml");
+	    if ($? != 0) {
+		die "Cannot validate META.yml against $meta_schema";
+	    }
+	} else {
+	    warn "Prerequisites for validating META.yml are missing";
 	}
     }
 }
@@ -93,19 +102,94 @@
 
 update-WWWBrowser:
 	perl -nle '\
-	    BEGIN { print "# DO NOT EDIT\n" } \
-	    BEGIN { print "# DO NOT USE THIS MODULE IN YOUR PROJECTS\n" } \
+	    BEGIN { print "# DO NOT EDIT\n# Created by the update-WWWBrowser makefile rule\n\n# DO NOT USE THIS MODULE IN YOUR PROJECTS\n# (That is, the module\047s code is OK, but don\047t rely on the package\n# name or the API of this module)" } \
 	    s{package WWWBrowser}{package # hide from PAUSE indexer\n\tTk::Pod::WWWBrowser}; \
 	    s{package Launcher::WWW}{package # hide from PAUSE indexer\n\tTk::Pod::Launcher::WWW}; \
+	    if (m{#.*Forward compatibility}) { \
+		$$skip_forward_compat++; \
+	    } elsif ($$skip_forward_compat && m|^}|) { \
+		$$skip_forward_compat = 0; next; \
+	    } \
 	    if (m{__END__}) { \
 		$$do_not_print++; \
 	    } \
-	    print if (!$$do_not_print); \
+	    print if (!$$do_not_print && !$$skip_forward_compat); \
 	    ' \
-	    < ../../perl/WWWBrowser/WWWBrowser.pm > Pod/WWWBrowser.pm
+	    < ../../perl/WWWBrowser/WWWBrowser.pm > Pod/WWWBrowser.pm~
+	    perl -c Pod/WWWBrowser.pm~
+	    mv Pod/WWWBrowser.pm~ Pod/WWWBrowser.pm
 
 EOF
     }
 
     $postamble;
 }
+
+# REPO BEGIN
+# REPO NAME is_in_path /home/e/eserte/work/srezic-repository 
+# REPO MD5 c9844dc5bfa1798245e913b3e53ba4e1
+
+=head2 is_in_path($prog)
+
+=for category File
+
+Return the pathname of $prog, if the program is in the PATH, or undef
+otherwise.
+
+DEPENDENCY: file_name_is_absolute
+
+=cut
+
+sub is_in_path {
+    my($prog) = @_;
+    return $prog if (file_name_is_absolute($prog) and -f $prog and -x $prog);
+    require Config;
+    %Config::Config = %Config::Config if 0; # cease -w
+    my $sep = $Config::Config{'path_sep'} || ':';
+    foreach (split(/$sep/o, $ENV{PATH})) {
+	if ($^O eq 'MSWin32') {
+	    # maybe use $ENV{PATHEXT} like maybe_command in ExtUtils/MM_Win32.pm?
+	    return "$_\\$prog"
+		if (-x "$_\\$prog.bat" ||
+		    -x "$_\\$prog.com" ||
+		    -x "$_\\$prog.exe" ||
+		    -x "$_\\$prog.cmd");
+	} else {
+	    return "$_/$prog" if (-x "$_/$prog" && !-d "$_/$prog");
+	}
+    }
+    undef;
+}
+# REPO END
+
+# REPO BEGIN
+# REPO NAME file_name_is_absolute /home/e/eserte/work/srezic-repository 
+# REPO MD5 89d0fdf16d11771f0f6e82c7d0ebf3a8
+
+=head2 file_name_is_absolute($file)
+
+=for category File
+
+Return true, if supplied file name is absolute. This is only necessary
+for older perls where File::Spec is not part of the system.
+
+=cut
+
+BEGIN {
+    if (eval { require File::Spec; defined &File::Spec::file_name_is_absolute }) {
+	*file_name_is_absolute = \&File::Spec::file_name_is_absolute;
+    } else {
+	*file_name_is_absolute = sub {
+	    my $file = shift;
+	    my $r;
+	    if ($^O eq 'MSWin32') {
+		$r = ($file =~ m;^([a-z]:(/|\\)|\\\\|//);i);
+	    } else {
+		$r = ($file =~ m|^/|);
+	    }
+	    $r;
+	};
+    }
+}
+# REPO END
+

Modified: branches/upstream/libtk-pod-perl/current/Pod.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtk-pod-perl/current/Pod.pm?rev=14667&op=diff
==============================================================================
--- branches/upstream/libtk-pod-perl/current/Pod.pm (original)
+++ branches/upstream/libtk-pod-perl/current/Pod.pm Sun Feb 10 02:16:33 2008
@@ -4,8 +4,8 @@
 use Tk::Toplevel;
 
 use vars qw($VERSION $DIST_VERSION @ISA);
-$VERSION = sprintf("%d.%02d", q$Revision: 5.19 $ =~ /(\d+)\.(\d+)/);
-$DIST_VERSION = "0.9937";
+$VERSION = sprintf("%d.%02d", q$Revision: 5.20 $ =~ /(\d+)\.(\d+)/);
+$DIST_VERSION = "0.9938";
 
 @ISA = qw(Tk::Toplevel);
 
@@ -153,7 +153,7 @@
 
   [Cascade => '~View', -menuitems =>
    [
-    [Checkbutton => $compound->('~Pod Tree'),
+    [Checkbutton => $compound->('Pod ~Tree'),
      '-variable' => \$w->{Tree_on},
      '-command' => sub { $w->tree($w->{Tree_on}) },
     ],
@@ -170,7 +170,7 @@
      '-command' => [$w, 'zoom_out'],
     ],
     '-',
-    [Button => $compound->('Pod on search.cpan.org'),
+    [Button => $compound->('Pod on ~search.cpan.org'),
      '-command' => sub {
 	 require Tk::Pod::Util;
 	 my $url = $p->{pod_title};
@@ -181,7 +181,7 @@
 	 Tk::Pod::Util::start_browser("http://search.cpan.org/perldoc?" . $url);
      },
     ],
-    [Button => $compound->('Pod on annocpan.org'),
+    [Button => $compound->('Pod on ~annocpan.org'),
      '-command' => sub {
 	 require Tk::Pod::Util;
 	 my $url = $p->{pod_title};

Modified: branches/upstream/libtk-pod-perl/current/Pod/FindPods.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtk-pod-perl/current/Pod/FindPods.pm?rev=14667&op=diff
==============================================================================
--- branches/upstream/libtk-pod-perl/current/Pod/FindPods.pm (original)
+++ branches/upstream/libtk-pod-perl/current/Pod/FindPods.pm Sun Feb 10 02:16:33 2008
@@ -1,7 +1,7 @@
 # -*- perl -*-
 
 #
-# $Id: FindPods.pm,v 5.10 2007/11/07 21:38:48 eserte Exp $
+# $Id: FindPods.pm,v 5.11 2008/02/03 16:10:51 eserte Exp $
 # Author: Slaven Rezic
 #
 # Copyright (C) 2001,2003,2004,2005,2007 Slaven Rezic. All rights reserved.
@@ -38,7 +38,7 @@
 
 @EXPORT_OK = qw/%pods $has_cache pod_find/;
 
-$VERSION = sprintf("%d.%02d", q$Revision: 5.10 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 5.11 $ =~ /(\d+)\.(\d+)/);
 
 BEGIN {  # Make a DEBUG constant very first thing...
   if(defined &DEBUG) {
@@ -273,15 +273,19 @@
     } elsif ($^O =~ /^darwin/) {
 	$f =~ s|^pods/||; # ... and on MacOSX
     } elsif ($^O eq 'MSWin32') {
+	# oldstyle:
 	$f =~ s|^pod/perl|perl|i;
 	$f =~ s|^pod/Win32|Win32|i;
+	# newstyle:
+	$f =~ s|^pods/||;
     }
     $f;
 }
 
 sub type {
     local $_ = shift;
-    if    (/^perl/) { return "perl" }
+    if    (/^(?:perl|activeperl)/) { return "perl" }
+    elsif (/^a2p$/) { return "script" }
     elsif (/^[a-z]/ && !/^(mod_perl|lwpcook|lwptut|cgi_to_mod_perl|libapreq)/)
 	            { return "pragma" }
     else            { return "mod" }

Modified: branches/upstream/libtk-pod-perl/current/Pod/Search_db.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtk-pod-perl/current/Pod/Search_db.pm?rev=14667&op=diff
==============================================================================
--- branches/upstream/libtk-pod-perl/current/Pod/Search_db.pm (original)
+++ branches/upstream/libtk-pod-perl/current/Pod/Search_db.pm Sun Feb 10 02:16:33 2008
@@ -15,7 +15,7 @@
 use strict;
 use vars qw($VERSION);
 
-$VERSION = sprintf("%d.%02d", q$Revision: 5.5 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 5.6 $ =~ /(\d+)\.(\d+)/);
 
 use Carp;
 use Fcntl;
@@ -94,7 +94,7 @@
     my $restrict_pod = $args{-restrictpod};
     if (defined $restrict_pod) {
 	my(@modparts) = split /::/, $restrict_pod;
-	$restrict_pod = join('[/\\]', map { quotemeta } @modparts);
+	$restrict_pod = join('[/\\\\]', map { quotemeta } @modparts);
     }
 
     #print "try words|", join('|', at _),"\n";

Modified: branches/upstream/libtk-pod-perl/current/Pod/Text.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtk-pod-perl/current/Pod/Text.pm?rev=14667&op=diff
==============================================================================
--- branches/upstream/libtk-pod-perl/current/Pod/Text.pm (original)
+++ branches/upstream/libtk-pod-perl/current/Pod/Text.pm Sun Feb 10 02:16:33 2008
@@ -26,7 +26,7 @@
 use vars qw($VERSION @ISA @POD $IDX
 	    @tempfiles @gv_pids $terminal_fallback_warn_shown);
 
-$VERSION = sprintf("%d.%02d", q$Revision: 5.17 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 5.18 $ =~ /(\d+)\.(\d+)/);
 
 @ISA = qw(Tk::Frame Tk::Pod::SimpleBridge Tk::Pod::Cache);
 
@@ -730,8 +730,18 @@
     my $menu = $more->menu;
     $t->configure(-menu => $menu);
     local $SIG{PIPE} = "IGNORE";
+    my $can_langinfo = $] >= 5.008 && eval { require I18N::Langinfo; 1 };
+    local $ENV{LANG} = $ENV{LANG};
+    if (!$can_langinfo) {
+	$ENV{LANG} = "C";
+    }
     open(MAN, $man_exe . (defined $mansec ? " $mansec" : "") . " $man |")
 	or die $!;
+    if ($can_langinfo) {
+	my $codeset = I18N::Langinfo::langinfo(I18N::Langinfo::CODESET());
+	eval qq{ binmode MAN, q{:encoding($codeset)} };
+	warn $@ if $@;
+    }
     if (eof MAN) {
 	$more->insert("end", "No entry for for $man" . (defined $mansec ? " in section $mansec of" : "") . " the manual");
     } else {

Modified: branches/upstream/libtk-pod-perl/current/Pod/WWWBrowser.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtk-pod-perl/current/Pod/WWWBrowser.pm?rev=14667&op=diff
==============================================================================
--- branches/upstream/libtk-pod-perl/current/Pod/WWWBrowser.pm (original)
+++ branches/upstream/libtk-pod-perl/current/Pod/WWWBrowser.pm Sun Feb 10 02:16:33 2008
@@ -1,15 +1,17 @@
 # DO NOT EDIT
+# Created by the update-WWWBrowser makefile rule
 
 # DO NOT USE THIS MODULE IN YOUR PROJECTS
-
-#!/usr/bin/env perl
+# (That is, the module's code is OK, but don't rely on the package
+# name or the API of this module)
 # -*- perl -*-
 
 #
-# $Id: WWWBrowser.pm,v 1.1 2007/10/25 19:58:50 eserte Exp $
+# $Id: WWWBrowser.pm,v 1.5 2008/01/26 11:40:14 eserte Exp $
 # Author: Slaven Rezic
 #
-# Copyright (C) 1999,2000,2001,2003,2005,2006 Slaven Rezic. All rights reserved.
+# Copyright (C) 1999,2000,2001,2003,2005,2006,2007,2008 Slaven Rezic.
+# All rights reserved.
 # This package is free software; you can redistribute it and/or
 # modify it under the same terms as Perl itself.
 #
@@ -17,6 +19,8 @@
 # WWW:  http://www.rezic.de/eserte/
 #
 
+# TODO: check Win32::WebBrowser
+
 package # hide from PAUSE indexer
 	Tk::Pod::WWWBrowser;
 
@@ -26,7 +30,7 @@
 	    $VERSION $VERBOSE $initialized $os $fork
 	    $got_from_config $ignore_config);
 
-$VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/);
 
 @available_browsers = qw(_debian_browser _internal_htmlview
 			 _default_gnome _default_kde
@@ -67,25 +71,7 @@
     my(%args) = @_;
 
     if ($os eq 'win') {
-	if (!eval 'require Win32Util;
-	           Win32Util::start_html_viewer($url)') {
-	    # If this fails, just try the url only.
-	    # XXX There are reports that "start" and Tk programms
-	    # do not work well together (slow startup and such).
-	    system("start $url");
-	    if ($?/256 != 0) {
-		# otherwise explicitely use explorer
-		system("start explorer $url");
-		# maybe: system("start", "explorer", $url);
-		# or:    system("start explorer \"$url\"");
-		if ($?/256 != 0) {
-		    # or die ...
-		    status_message("Can't find HTML viewer.", "err");
-		    return 0;
-		}
-	    }
-	}
-	return 1;
+	return start_browser_windows($url, %args);
     }
 
     if ($os eq 'macosx') {
@@ -202,6 +188,47 @@
     return 0;
 }
 
+sub start_browser_windows {
+    my($url, %args) = @_;
+    my @methods;
+    if ($ENV{OS} && $ENV{OS} eq 'Windows_NT') { # NT, 2000, XP, Vista...
+	@methods = qw(rundll start win32util explorer);
+    } else {
+	@methods = qw(win32util start explorer);
+    }
+
+    for my $method (@methods) {
+        if ($method eq 'rundll') {
+	    system("rundll32 url.dll,FileProtocolHandler \"$url\"");
+            if ($?/256 == 0) {
+	        return 1;
+	    }
+        } elsif ($method eq 'start') {
+	    # XXX There are reports that "start" and Tk programms
+	    # do not work well together (slow startup and such).
+	    system("start /b \"$url\"");
+	    if ($?/256 == 0) {
+		return 1;
+	    }
+	} elsif ($method eq 'explorer') {
+	    system("start explorer \"$url\"");
+	    # maybe: system("start", "explorer", $url);
+	    # or:    system("start explorer \"$url\"");
+	    if ($?/256 == 0) {
+		return 1;
+	    }
+	} elsif ($method eq 'win32util' &&
+		 eval { require Win32Util; 1 }) {
+	    if (eval { Win32Util::start_html_viewer($url) }) {
+		return 1;
+	    }
+	}
+    }
+
+    status_message("Can't find HTML viewer.", "err");
+    return 0;
+}
+
 sub open_in_konqueror {
     my $url = shift;
     my(%args) = @_;
@@ -568,15 +595,6 @@
 }
 # REPO END
 
-# XXX Forward compatibility
-{
-    package # hide from PAUSE indexer
-	Tk::Pod::Launcher::WWW;
-    sub launch {
-	WWWBrowser::start_browser(@_);
-    }
-    *Launcher::WWW = \&Launcher::WWW::launch;
-}
 
 1;
 

Modified: branches/upstream/libtk-pod-perl/current/TODO
URL: http://svn.debian.org/wsvn/branches/upstream/libtk-pod-perl/current/TODO?rev=14667&op=diff
==============================================================================
--- branches/upstream/libtk-pod-perl/current/TODO (original)
+++ branches/upstream/libtk-pod-perl/current/TODO Sun Feb 10 02:16:33 2008
@@ -76,6 +76,19 @@
 The location of the cache file is predictable and on /tmp which is
 bad. Either choose a unpredictable but unique filename, or use
 techniques like O_EXCL (is this supported everywhere?).
+
+=back
+
+=head3 Tk::Pod::Search
+
+=over
+
+=item *
+
+Reorder modules in the fulltext search results to reflect @INC
+order.
+
+=back
 
 =head3 Tk::Pod::Tree
 
@@ -220,14 +233,26 @@
 
 =item *
 
-encoding support, especially for utf-8
-
-=item *
-
 It should probably be possible to create the menus Section and History
 independently of the main Tk::Pod frame, so the user may add these
 menus to the context menu of the PodText window.
 
+=item *
+
+Have a new popup menu entry "Copy Pod location", and maybe a new menu
+entry View -> Pod info which shows path and basic Pod information.
+
+=item *
+
+If a Pod could not be found: add a button "Look at search.cpan.org" to
+the error dialog.
+
+=item *
+
+"Open Pod by name" dialog could be done nicer, e.g. by using a rich
+Tk::Text instead of the label/message and use "sans serif"+"monospace"
+fonts.
+
 =back
 
 =head3 Tk::More
@@ -314,6 +339,12 @@
 =item *
 
 Implement C<-rememberopen> in C<Fill> method.
+
+=item *
+
+Mark modules which appear multiple times in the @INC tree, e.g. with
+an exclamation mark, and maybe show the paths and versions(?) of
+both/all versions.
 
 =back
 

Modified: branches/upstream/libtk-pod-perl/current/t/basic.t
URL: http://svn.debian.org/wsvn/branches/upstream/libtk-pod-perl/current/t/basic.t?rev=14667&op=diff
==============================================================================
--- branches/upstream/libtk-pod-perl/current/t/basic.t (original)
+++ branches/upstream/libtk-pod-perl/current/t/basic.t Sun Feb 10 02:16:33 2008
@@ -14,6 +14,7 @@
     Test->import;
   }
 use strict;
+use Tk;
 ##
 ## Test all widget classes:  load module, create, pack, and
 ## destory an instance. Check in configure does not return
@@ -23,6 +24,7 @@
 use vars '@class';
 use vars '@tk_pod_modules';
 
+my $tests;
 BEGIN 
   {
     @class =
@@ -36,7 +38,8 @@
     @tk_pod_modules = qw(Cache FindPods Search_db Search SimpleBridge Styles
 			 Util WWWBrowser);
 
-   plan test => (10*@class+3+ at tk_pod_modules);
+    $tests = 10*@class+ at tk_pod_modules;
+    plan test => $tests;
 
   };
 
@@ -46,13 +49,16 @@
     $ENV{BATCH} = 1;
 }
 
-eval { require Tk; };
-ok($@, "", "loading Tk module");
-
 my $mw;
 eval {$mw = Tk::MainWindow->new();};
-ok($@, "", "can't create MainWindow");
-ok(Tk::Exists($mw), 1, "MainWindow creation failed");
+if (!Tk::Exists($mw))
+  {
+    for (1..$tests) 
+      {
+	skip("Cannot create MainWindow", 1, 1);
+      }
+    CORE::exit(0);
+  }
 
 my $w;
 foreach my $class (@class)




More information about the Pkg-perl-cvs-commits mailing list