r68749 - in /branches/upstream/libvendorlib-perl/current: Changes META.yml lib/vendorlib.pm t/01basic.t
periapt-guest at users.alioth.debian.org
periapt-guest at users.alioth.debian.org
Tue Feb 15 23:01:38 UTC 2011
Author: periapt-guest
Date: Tue Feb 15 23:01:09 2011
New Revision: 68749
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=68749
Log:
[svn-upgrade] new version libvendorlib-perl (0.10)
Modified:
branches/upstream/libvendorlib-perl/current/Changes
branches/upstream/libvendorlib-perl/current/META.yml
branches/upstream/libvendorlib-perl/current/lib/vendorlib.pm
branches/upstream/libvendorlib-perl/current/t/01basic.t
Modified: branches/upstream/libvendorlib-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvendorlib-perl/current/Changes?rev=68749&op=diff
==============================================================================
--- branches/upstream/libvendorlib-perl/current/Changes (original)
+++ branches/upstream/libvendorlib-perl/current/Changes Tue Feb 15 23:01:09 2011
@@ -1,4 +1,19 @@
Revision history for vendorlib
+
+0.10 2011-01-17 02:36:15
+ - fix a bug in the tests
+
+0.09 2011-01-16 07:25:10
+ - do not use directories that don't exist
+
+0.08 2011-01-14 05:45:08
+ - some fixes for Win32
+
+0.07 2011-01-11 09:49:29
+ - add tilde expansion from Config values
+
+0.06 2011-01-09 12:22:12
+ - added checks for loading core modules in t/01basic.t
0.05 2011-01-06 11:04:51
- add repository to META.yml
Modified: branches/upstream/libvendorlib-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvendorlib-perl/current/META.yml?rev=68749&op=diff
==============================================================================
--- branches/upstream/libvendorlib-perl/current/META.yml (original)
+++ branches/upstream/libvendorlib-perl/current/META.yml Tue Feb 15 23:01:09 2011
@@ -22,8 +22,8 @@
provides:
vendorlib:
file: lib/vendorlib.pm
- version: 0.05
+ version: 0.10
resources:
license: http://dev.perl.org/licenses/
repository: git://github.com/rkitover/vendorlib.git
-version: 0.05
+version: 0.10
Modified: branches/upstream/libvendorlib-perl/current/lib/vendorlib.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvendorlib-perl/current/lib/vendorlib.pm?rev=68749&op=diff
==============================================================================
--- branches/upstream/libvendorlib-perl/current/lib/vendorlib.pm (original)
+++ branches/upstream/libvendorlib-perl/current/lib/vendorlib.pm Tue Feb 15 23:01:09 2011
@@ -10,7 +10,7 @@
=cut
-our $VERSION = '0.05';
+our $VERSION = '0.10';
=head1 SYNOPSIS
@@ -38,12 +38,51 @@
=cut
sub import {
- my @paths = ('/etc/perl', @Config{qw/
+ my @paths = (($^O ne 'MSWin32' ? ('/etc/perl') : ()), @Config{qw/
vendorarch
vendorlib
archlib
privlib
/});
+
+ # This grep MUST BE on copies of the paths to not trigger Config overload
+ # magic.
+ @paths = grep $_, @paths;
+
+ # remove duplicates
+ my @result;
+ while (my $path = shift @paths) {
+ if (@paths && $path eq $paths[0]) {
+ # ignore
+ }
+ else {
+ push @result, $path;
+ }
+ }
+ @paths = @result;
+
+ # fixup slashes for @INC on Win32
+ if ($^O eq 'MSWin32') {
+ s{\\}{/}g for @paths;
+ }
+
+ # expand tildes
+ if ($^O ne 'MSWin32') {
+ for my $path (@paths) {
+ if ($path =~ m{^~/+}) {
+ my $home = (getpwuid($<))[7];
+ $path =~ s|^~/+|${home}/|;
+ }
+ elsif (my ($user) = $path =~ /^~(\w+)/) {
+ my $home = (getpwnam($user))[7];
+ $path =~ s|^~${user}/+|${home}/|;
+ }
+ }
+ }
+
+ # remove any directories that don't actually exist
+ # this will also remove /etc/perl on non-Debian systems
+ @paths = grep -d, @paths;
@INC = @paths;
}
Modified: branches/upstream/libvendorlib-perl/current/t/01basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvendorlib-perl/current/t/01basic.t?rev=68749&op=diff
==============================================================================
--- branches/upstream/libvendorlib-perl/current/t/01basic.t (original)
+++ branches/upstream/libvendorlib-perl/current/t/01basic.t Tue Feb 15 23:01:09 2011
@@ -1,11 +1,60 @@
use strict;
use warnings;
-use Test::More tests => 1;
+use Test::More tests => 3;
use lib 't/lib';
use vendorlib;
+# check that we can load core XS and non-XS modules
+use Data::Dumper;
+use File::Basename;
+use Config;
+
eval "require Foo;";
ok $@, '@INC scrubbed';
+
+# test bare tilde expansion
+SKIP: {
+ skip 'no tilde expansion on Win32', 1 if $^O eq 'MSWin32';
+
+ local @INC;
+
+ my %config = %Config;
+
+ *vendorlib::Config = \%config;
+
+ local $config{vendorarch} = '~/';
+
+ vendorlib->import;
+
+ my $expanded = (getpwuid($<))[7] . '/';
+
+ shift @INC if $INC[0] eq '/etc/perl';
+
+ is $INC[0], $expanded, 'bare tilde expansion';
+}
+
+# test tilde expansion with user name
+SKIP: {
+ skip 'no tilde expansion on Win32', 1 if $^O eq 'MSWin32';
+
+ local @INC;
+
+ my %config = %Config;
+
+ *vendorlib::Config = \%config;
+
+ my $whoami = (getpwuid($<))[0];
+
+ local $config{vendorarch} = "~${whoami}/";
+
+ vendorlib->import;
+
+ my $expanded = (getpwuid($<))[7] . '/';
+
+ shift @INC if $INC[0] eq '/etc/perl';
+
+ is $INC[0], $expanded, 'tilde expansion with user name';
+}
More information about the Pkg-perl-cvs-commits
mailing list