r46891 - in /branches/upstream/libv-perl: ./ current/ current/Changes current/MANIFEST current/META.yml current/Makefile.PL current/README current/V.pm current/t/ current/t/01basic.t current/t/02useit.t current/t/03bug.t

jeremiah-guest at users.alioth.debian.org jeremiah-guest at users.alioth.debian.org
Sat Nov 7 20:23:06 UTC 2009


Author: jeremiah-guest
Date: Sat Nov  7 20:22:54 2009
New Revision: 46891

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=46891
Log:
[svn-inject] Installing original source of libv-perl

Added:
    branches/upstream/libv-perl/
    branches/upstream/libv-perl/current/
    branches/upstream/libv-perl/current/Changes
    branches/upstream/libv-perl/current/MANIFEST
    branches/upstream/libv-perl/current/META.yml
    branches/upstream/libv-perl/current/Makefile.PL
    branches/upstream/libv-perl/current/README
    branches/upstream/libv-perl/current/V.pm
    branches/upstream/libv-perl/current/t/
    branches/upstream/libv-perl/current/t/01basic.t   (with props)
    branches/upstream/libv-perl/current/t/02useit.t   (with props)
    branches/upstream/libv-perl/current/t/03bug.t

Added: branches/upstream/libv-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libv-perl/current/Changes?rev=46891&op=file
==============================================================================
--- branches/upstream/libv-perl/current/Changes (added)
+++ branches/upstream/libv-perl/current/Changes Sat Nov  7 20:22:54 2009
@@ -1,0 +1,127 @@
+These changes are from the Subversion repository at
+        Url: http://source.test-smoke.org/svn/V
+
+The filelists have a short symbolic indicator:
+        !  modified
+        +  added
+        -  deleted
+       !>  merged change
+       !<  replaced
+
+Enjoy!
+___________________________________________________________________________
+[  1126] By: abeltje                          on 2007-11-07 01:10:02 +0100
+        Log: * [CHANGE]
+	       * FIX: bug reported by Merijn:
+		     my $version = map { "$_ " . V::get_version( $_ ) }
+		     qw/ Cwd /;
+		 "Modification of a read-only value attempted"
+		 * local()ize $_ before reading the file to find the
+		   version
+        Url: http://source.test-smoke.org/svn/V
+           + /V/t/03bug.t
+           ! /V/MANIFEST, /V/V.pm
+___________________________________________________________________________
+[   938] By: abeltje                          on 2006-03-31 17:29:56 +0200
+        Log: * [CORE]
+	       * put the tests for the core-distribution in their own
+		 directory
+        Url: http://source.test-smoke.org/svn/V
+           + /V/core-t, /V/core-t/02useit.t
+           - /V/t/01core.t
+          !> /V/core-t/01core.t =(/V/t/01core.t:936)
+___________________________________________________________________________
+[   937] By: abeltje                          on 2006-03-31 17:28:21 +0200
+        Log: * [CHANGE]
+	       * small rework of the AUTHOR/LICENSE sections in pod
+        Url: http://source.test-smoke.org/svn/V
+           ! /V/V.pm
+___________________________________________________________________________
+[   933] By: abeltje                          on 2006-02-03 18:07:51 +0100
+        Log: * Regenerate Changes for V 0.11
+        Url: http://source.test-smoke.org/svn/V
+           ! /V/Changes
+___________________________________________________________________________
+[   932] By: abeltje                          on 2006-02-03 17:04:17 +0100
+        Log: * [CHANGE]
+	       + add untainting stuff by Stas Bekman (2004/03/24)
+        Url: http://source.test-smoke.org/svn/V
+           ! /V/V.pm
+___________________________________________________________________________
+[   661] By: abeltje                          on 2004-03-24 07:44:42 +0100
+        Log: * Regen Changes for 0.10
+        Url: http://source.test-smoke.org/svn/V
+           ! /V/Changes
+___________________________________________________________________________
+[   660] By: abeltje                          on 2004-03-24 07:43:27 +0100
+        Log: * [CHANGE]
+	       * added the license stuff
+        Url: http://source.test-smoke.org/svn/V
+           ! /V/V.pm
+___________________________________________________________________________
+[   576] By: abeltje                          on 2004-01-16 14:13:13 +0100
+        Log: * regen Changes for 0.09
+        Url: http://source.test-smoke.org/svn/V
+           ! /V/Changes
+___________________________________________________________________________
+[   575] By: abeltje                          on 2004-01-16 14:09:03 +0100
+        Log: * [ADD]
+	       + feature request by Merijn Brand:
+		 * Can you add a sub that returns the version only for a
+		   given module
+	       + added a test for V::get_version
+	       * VERSION += 0.01
+        Url: http://source.test-smoke.org/svn/V
+           ! /V/README, /V/V.pm, /V/t/01basic.t, /V/t/02useit.t
+___________________________________________________________________________
+[   574] By: abeltje                          on 2004-01-16 13:58:27 +0100
+        Log: * [FIX] by Merijn Brand
+	       * fix a syntax error in the PREREQ_PM target
+        Url: http://source.test-smoke.org/svn/V
+           ! /V/Makefile.PL
+___________________________________________________________________________
+[   406] By: abeltje                          on 2003-08-22 03:51:06 +0200
+        Log: * [CHANGE]
+	       * general cleanup and $VERSION += 0.01
+        Url: http://source.test-smoke.org/svn/V
+           ! /V/MANIFEST, /V/Makefile.PL, /V/README, /V/V.pm
+___________________________________________________________________________
+[   405] By: abeltje                          on 2003-08-22 03:49:41 +0200
+        Log: * [FIX] make the tests pass again
+        Url: http://source.test-smoke.org/svn/V
+           ! /V/t/01basic.t, /V/t/02useit.t
+___________________________________________________________________________
+[   404] By: abeltje                          on 2003-08-22 03:46:32 +0200
+        Log: * [REMOVE] No more Test::More, make it a PREREQ
+        Url: http://source.test-smoke.org/svn/V
+           - /V/t/lib
+___________________________________________________________________________
+[    52] By: abeltje                          on 2003-03-10 00:40:16 +0100
+        Log: $VERSION += 0.01
+        Url: http://source.test-smoke.org/svn/V
+           ! /V/README
+___________________________________________________________________________
+[    51] By: abeltje                          on 2003-03-10 00:38:13 +0100
+        Log: $VERSION += 0.01
+        Url: http://source.test-smoke.org/svn/V
+           ! /V/V.pm
+___________________________________________________________________________
+[    50] By: abeltje                          on 2003-03-10 00:37:05 +0100
+        Log: Change the way we C<< use lib $lib; >> for Test-More
+        Url: http://source.test-smoke.org/svn/V
+           ! /V/t/01basic.t, /V/t/02useit.t
+___________________________________________________________________________
+[    49] By: abeltje                          on 2003-03-10 00:17:33 +0100
+        Log: Initial import of V-0.06
+        Url: http://source.test-smoke.org/svn/V
+           + /V/Changes, /V/MANIFEST, /V/Makefile.PL, /V/README, /V/V.pm,
+	     /V/t, /V/t/01basic.t, /V/t/02useit.t, /V/t/lib,
+	     /V/t/lib/Test, /V/t/lib/Test/Builder.pm,
+	     /V/t/lib/Test/More.pm, /V/t/lib/Test/Simple.pm
+___________________________________________________________________________
+[    48] By: abeltje                          on 2003-03-10 00:16:24 +0100
+        Log: Create space for the V module
+        Url: http://source.test-smoke.org/svn/V
+           + /V
+
+-- Generated by 'svnchanges' (0.013) --

Added: branches/upstream/libv-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libv-perl/current/MANIFEST?rev=46891&op=file
==============================================================================
--- branches/upstream/libv-perl/current/MANIFEST (added)
+++ branches/upstream/libv-perl/current/MANIFEST Sat Nov  7 20:22:54 2009
@@ -1,0 +1,9 @@
+MANIFEST	# $Id: MANIFEST 1126 2007-11-07 00:10:02Z abeltje $
+Changes
+Makefile.PL
+README
+V.pm
+t/01basic.t
+t/02useit.t
+t/03bug.t
+META.yml                                 Module meta-data (added by MakeMaker)

Added: branches/upstream/libv-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libv-perl/current/META.yml?rev=46891&op=file
==============================================================================
--- branches/upstream/libv-perl/current/META.yml (added)
+++ branches/upstream/libv-perl/current/META.yml Sat Nov  7 20:22:54 2009
@@ -1,0 +1,14 @@
+--- #YAML:1.0
+name:                V
+version:             0.13
+abstract:            Print version of the specified module(s).
+license:             ~
+generated_by:        ExtUtils::MakeMaker version 6.36
+distribution_type:   module
+requires:     
+    Test::More:                    0
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
+    version: 1.2
+author:
+    - Abe Timmerman <abeltje at cpan.org>

Added: branches/upstream/libv-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libv-perl/current/Makefile.PL?rev=46891&op=file
==============================================================================
--- branches/upstream/libv-perl/current/Makefile.PL (added)
+++ branches/upstream/libv-perl/current/Makefile.PL Sat Nov  7 20:22:54 2009
@@ -1,0 +1,17 @@
+#! usr/bin/perl -w
+use strict;
+
+# $Id: Makefile.PL 574 2004-01-16 12:58:27Z abeltje $
+
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+    NAME               => 'V',
+    VERSION_FROM       => 'V.pm',
+    PREREQ_PM          => { 'Test::More' => 0  },
+
+    ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
+        (ABSTRACT_FROM => 'V.pm',
+         AUTHOR        => 'Abe Timmerman <abeltje at cpan.org>') : ()
+    ),
+);

Added: branches/upstream/libv-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libv-perl/current/README?rev=46891&op=file
==============================================================================
--- branches/upstream/libv-perl/current/README (added)
+++ branches/upstream/libv-perl/current/README Sat Nov  7 20:22:54 2009
@@ -1,0 +1,46 @@
+V version 0.09
+==============
+
+This module uses stolen code from C<Module::Info> to find the location
+and version of the specified module(s). It prints them and exit()s.
+
+It works by definening C<import()> and is based on an idea from Michael Schwern
+on the perl5-porters list. See the discussion:
+
+L<http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2002-01/msg00760.html>
+
+    $ perl -MV=CPAN
+
+or if you want more than one
+
+    $ perl -MV=CPAN,V
+
+
+INSTALLATION
+
+To install this module type the following:
+
+   perl Makefile.PL
+   make test
+   make install
+
+DEPENDENCIES
+
+This module requires no other modules or libraries (exept Test::More
+for the test-suite).
+
+COPYRIGHT AND LICENCE
+
+Copyright (c) 2002 Abe Timmerman <abeltje at cpan.org>. All rights reserved. 
+
+This program is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself. 
+
+See:
+    * http://www.perl.com/perl/misc/Artistic.html
+    * http://www.gnu.org/copyleft/gpl.html
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+

Added: branches/upstream/libv-perl/current/V.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libv-perl/current/V.pm?rev=46891&op=file
==============================================================================
--- branches/upstream/libv-perl/current/V.pm (added)
+++ branches/upstream/libv-perl/current/V.pm Sat Nov  7 20:22:54 2009
@@ -1,0 +1,190 @@
+package V;
+use strict;
+
+# $Id: V.pm 1126 2007-11-07 00:10:02Z abeltje $
+
+use vars qw( $VERSION $NO_EXIT );
+$VERSION  = '0.13';
+
+$NO_EXIT ||= 0; # prevent import() from exit()ing and fall of the edge
+
+=head1 NAME
+
+V - Print version of the specified module(s).
+
+=head1 SYNOPSIS
+
+    $ perl -MV=V
+
+or if you want more than one
+
+    $ perl -MV=CPAN,V
+
+Can now also be used as a light-weight module for getting versions of
+modules without loading them:
+
+    BEGIN { $V::NO_EXIT = 1 }
+    require V;
+
+    printf "%s has version '%s'\n", "V", V::get_version( "V" );
+
+=head1 DESCRIPTION
+
+This module uses stolen code from L<Module::Info> to find the location 
+and version of the specified module(s). It prints them and exit()s.
+
+It defines C<import()> and is based on an idea from Michael Schwern
+on the perl5-porters list. See the discussion:
+
+  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2002-01/msg00760.html
+
+=head1 AUTHOR
+
+Abe Timmerman C<< <abeltje at cpan.org> >>.
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2002-2006 Abe Timmerman, All Rights Reserved.
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+=cut
+
+sub report_pkg($@) {
+    my $pkg = shift;
+
+    print "$pkg\n";
+    @_ or print "\tNot found\n";
+    for my $module ( @_ ) {
+        printf "\t%s: %s\n", $module->file, $module->version || '?';
+    }
+}
+
+sub import {
+    shift;
+    @_ or push @_, 'V';
+ 
+   for my $pkg ( @_ ) {
+        my @modules = V::Module::Info->all_installed( $pkg );
+        report_pkg $pkg, @modules;
+    }
+    exit() unless $NO_EXIT;
+}
+
+sub get_version {
+    my( $pkg ) = @_;
+    my( $first ) = V::Module::Info->all_installed( $pkg );
+    return $first ? $first->version : undef;
+}
+
+caller or V->import( @ARGV );
+
+1;
+
+# Okay I did the AUTOLOAD() bit, but this is a Copy 'n Paste job.
+# Thank you Michael Schwern for Module::Info! This one is mostly that!
+
+package V::Module::Info;
+
+require File::Spec;
+
+sub new_from_file {
+    my($proto, $file) = @_;
+    my($class) = ref $proto || $proto;
+
+    return unless -r $file;
+
+    my $self = {};
+    $self->{file} = File::Spec->rel2abs($file);
+    $self->{dir}  = '';
+    $self->{name} = '';
+
+    return bless $self, $class;
+}
+
+sub all_installed {
+    my($proto, $name, @inc) = @_;
+    my($class) = ref $proto || $proto;
+
+    @inc = @INC unless @inc;
+    my $file = File::Spec->catfile(split m/::/, $name) . '.pm';
+    
+    my @modules = ();
+    foreach my $dir (@inc) {
+        # Skip the new code ref in @INC feature.
+        next if ref $dir;
+
+        my $filename = File::Spec->catfile($dir, $file);
+        if( -r $filename ) {
+            my $module = $class->new_from_file($filename);
+            $module->{dir} = File::Spec->rel2abs($dir);
+            $module->{name} = $name;
+            push @modules, $module;
+        }
+    }
+              
+    return @modules;
+}
+
+# Thieved from ExtUtils::MM_Unix 1.12603
+sub version {
+    my($self) = shift;
+
+    my $parsefile = $self->file;
+
+    local *MOD;
+    open(MOD, $parsefile) or die $!;
+
+    my $inpod = 0;
+    my $result;
+    local $_;
+    while (<MOD>) {
+        $inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod;
+        next if $inpod || /^\s*#/;
+
+        chomp;
+        next unless m/([\$*])(([\w\:\']*)\bVERSION)\b.*\=/;
+        { local($1, $2); ($_ = $_) = m/(.*)/; } # untaint
+        my $eval = qq{
+            package V::Module::Info::_version;
+            no strict;
+
+            local $1$2;
+            \$$2=undef; do {
+                $_
+            }; \$$2
+        };
+        local $^W = 0;
+        $result = eval($eval);
+        warn "Could not eval '$eval' in $parsefile: $@" if $@;
+        $result = "undef" unless defined $result;
+        last;
+    }
+    close MOD;
+    return $result;
+}
+
+sub accessor {
+    my $self = shift;
+    my $field = shift;
+
+    $self->{ $field } = $_[0] if @_;
+    return $self->{ $field };
+}
+
+sub AUTOLOAD {
+    my( $self ) = @_;
+
+    use vars qw( $AUTOLOAD );
+    my( $method ) = $AUTOLOAD =~ m|.+::(.+)$|;
+
+    if ( exists $self->{ $method } ) {
+        splice @_, 1, 0, $method;
+        goto &accessor;
+    }
+}

Added: branches/upstream/libv-perl/current/t/01basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libv-perl/current/t/01basic.t?rev=46891&op=file
==============================================================================
--- branches/upstream/libv-perl/current/t/01basic.t (added)
+++ branches/upstream/libv-perl/current/t/01basic.t Sat Nov  7 20:22:54 2009
@@ -1,0 +1,35 @@
+#!/usr/bin/perl -w
+use strict;
+
+# $Id: 01basic.t 575 2004-01-16 13:09:03Z abeltje $
+
+use Test::More tests => 3;
+
+require_ok( 'V' );
+
+ok( $V::VERSION, '$V::VERSION is there' );
+
+SKIP: {
+    local *PIPE;
+    my $out;
+    if ( open PIPE, qq!$^X -Mblib -MV |! ) {
+        $out = do { local $/; <PIPE> };
+        unless ( close PIPE ) {
+            if ( open PIPE, qq!$^X -I. -e 'use V;' |! ) {
+                $out = do { local $/; <PIPE> };
+                skip "Error in pipe(2): $! [$?]", 1 unless close PIPE;
+            } else {
+                skip "Could not fork: $!", 1;
+            }
+            $out or skip "Error in pipe(1): $! [$?]", 1;
+        }
+    } else {
+        skip "Could not fork: $!";
+    }
+
+    my( $version ) = $out =~ /^.+?([\d._]+)$/m;
+
+    is( $version, $V::VERSION, "Version ok ($version)" );
+}
+
+__END__

Propchange: branches/upstream/libv-perl/current/t/01basic.t
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libv-perl/current/t/02useit.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libv-perl/current/t/02useit.t?rev=46891&op=file
==============================================================================
--- branches/upstream/libv-perl/current/t/02useit.t (added)
+++ branches/upstream/libv-perl/current/t/02useit.t Sat Nov  7 20:22:54 2009
@@ -1,0 +1,38 @@
+#!/usr/bin/perl -w
+use strict;
+
+$|=1;
+
+# $Id: 02useit.t 575 2004-01-16 13:09:03Z abeltje $
+
+use Test::More tests => 6;
+
+package Catch;
+sub TIEHANDLE { bless \( my $self ), shift }
+sub PRINT  { my $self = shift; $$self .= $_[0] }
+sub PRINTF { 
+    my $self = shift;
+    my $format = shift;
+    $$self .= sprintf $format, @_;
+}
+
+package main;
+
+my $out;
+local *CATCHOUT;
+#BEGIN {
+    $out = tie *CATCHOUT, 'Catch'; 
+    select CATCHOUT;
+    require_ok( 'V' );
+    $V::NO_EXIT = 1;
+#}
+
+V->import( 'V' );
+select STDOUT; # Stop gathering output via *CATCHOUT;
+
+ok( $$out, "V->import() produced output" );
+like( $$out, qr/^V\n/, "Module is V" );
+like( $$out, qr/^\t(.+?)V\.pm: $V::VERSION$/m, "VERSION is $V::VERSION" );
+is( $V::NO_EXIT, 1 , "Packagevar \$V::NO_EXIT set" );
+
+is V::get_version( 'V' ), $V::VERSION, "get_version()";

Propchange: branches/upstream/libv-perl/current/t/02useit.t
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libv-perl/current/t/03bug.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libv-perl/current/t/03bug.t?rev=46891&op=file
==============================================================================
--- branches/upstream/libv-perl/current/t/03bug.t (added)
+++ branches/upstream/libv-perl/current/t/03bug.t Sat Nov  7 20:22:54 2009
@@ -1,0 +1,23 @@
+#! perl
+use warnings;
+use strict;
+
+# $Id: 03bug.t 1126 2007-11-07 00:10:02Z abeltje $
+use Test::More tests => 2;
+
+BEGIN { $V::NO_EXIT = $V::NO_EXIT = 1 }
+
+require_ok 'V';
+
+my @modules = map {
+    s{/}{::}g; s{\.pm$}{};
+    $_
+} grep /\.pm$/ && ! /^Config\.pm$/ => keys %INC;
+
+
+my $versions = eval {
+    join ", ", map { "$_: " . V::get_version( $_ ) } qw/ Cwd /;
+};
+
+is $@, "", "readonly bug";
+




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