r5723 - in /packages/libdata-optlist-perl/trunk: ./ debian/ inc/Module/ inc/Module/Install/ lib/Data/ t/

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Wed Jul 11 10:18:53 UTC 2007


Author: eloy
Date: Wed Jul 11 10:18:53 2007
New Revision: 5723

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=5723
Log:
new upstream version

Added:
    packages/libdata-optlist-perl/trunk/LICENSE
      - copied unchanged from r5722, packages/libdata-optlist-perl/branches/upstream/current/LICENSE
    packages/libdata-optlist-perl/trunk/t/perl-critic.t
      - copied unchanged from r5722, packages/libdata-optlist-perl/branches/upstream/current/t/perl-critic.t
Modified:
    packages/libdata-optlist-perl/trunk/Changes
    packages/libdata-optlist-perl/trunk/MANIFEST
    packages/libdata-optlist-perl/trunk/META.yml
    packages/libdata-optlist-perl/trunk/README
    packages/libdata-optlist-perl/trunk/debian/changelog
    packages/libdata-optlist-perl/trunk/inc/Module/Install.pm
    packages/libdata-optlist-perl/trunk/inc/Module/Install/Base.pm
    packages/libdata-optlist-perl/trunk/inc/Module/Install/Can.pm
    packages/libdata-optlist-perl/trunk/inc/Module/Install/Fetch.pm
    packages/libdata-optlist-perl/trunk/inc/Module/Install/Makefile.pm
    packages/libdata-optlist-perl/trunk/inc/Module/Install/Metadata.pm
    packages/libdata-optlist-perl/trunk/inc/Module/Install/Win32.pm
    packages/libdata-optlist-perl/trunk/inc/Module/Install/WriteAll.pm
    packages/libdata-optlist-perl/trunk/lib/Data/OptList.pm
    packages/libdata-optlist-perl/trunk/t/hash.t
    packages/libdata-optlist-perl/trunk/t/mkopt.t
    packages/libdata-optlist-perl/trunk/t/pod.t

Modified: packages/libdata-optlist-perl/trunk/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/Changes?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/Changes (original)
+++ packages/libdata-optlist-perl/trunk/Changes Wed Jul 11 10:18:53 2007
@@ -1,9 +1,12 @@
 Revision history for Sub-Exporter
+
+0.102   2006-07-04
+        improved documentation
+        tweaked some Perl::Critic-offending code
 
 0.100   2006-06-05
         broken out of Sub-Exporter into its own dist
         renamed routines to be easier to type
-
 
 0.040   2006-05-11 (in Sub-Exporter)
         tweaks to Data::OptList, moving toward its own dist: now it exports

Modified: packages/libdata-optlist-perl/trunk/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/MANIFEST?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/MANIFEST (original)
+++ packages/libdata-optlist-perl/trunk/MANIFEST Wed Jul 11 10:18:53 2007
@@ -16,3 +16,5 @@
 t/pod-coverage.t
 README
 Changes
+t/perl-critic.t
+LICENSE

Modified: packages/libdata-optlist-perl/trunk/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/META.yml?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/META.yml (original)
+++ packages/libdata-optlist-perl/trunk/META.yml Wed Jul 11 10:18:53 2007
@@ -1,14 +1,18 @@
-author: 'Ricardo SIGNES <rjbs at cpan.org>'
+--- 
+author: Ricardo SIGNES <rjbs at cpan.org>
 distribution_type: module
-generated_by: Module::Install version 0.62
+generated_by: Module::Install version 0.67
 license: perl
+meta-spec: 
+  url: http://module-build.sourceforge.net/META-spec-v1.3.html
+  version: 1.3
 name: Data-OptList
-no_index:
-  directory:
+no_index: 
+  directory: 
     - inc
     - t
-requires:
+requires: 
   List::Util: 0
   Params::Util: 0.14
   Sub::Install: 0.92
-version: 0.101
+version: 0.102

Modified: packages/libdata-optlist-perl/trunk/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/README?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/README (original)
+++ packages/libdata-optlist-perl/trunk/README Wed Jul 11 10:18:53 2007
@@ -1,20 +1,131 @@
+NAME
+    Data::OptList - parse and validate simple name/value option pairs
 
-This is the README file for Data-Oplist, which provides a method to parse and
-validate simple name/value option pairs.
+VERSION
+    version 0.102
 
-For its documentation, consult its POD.
+      $Id: /my/cs/projects/Data-OptList/trunk/lib/Data/OptList.pm 31979 2007-07-05T02:17:36.805594Z rjbs  $
 
-  $ perldoc Data::OptList
+SYNOPSIS
+      use Data::OptList;
 
-Example:
+      my $options = Data::Optlist::mkopt([
+        qw(key1 key2 key3 key4),
+        key5 => { ... },
+        key6 => [ ... ],
+        key7 => sub { ... },
+        key8 => { ... },
+        key8 => [ ... ],
+      ]);
 
-  use Data::OptList;
+    ...is the same thing, more or less, as:
 
-  my $options = Data::Optlist::mkopt([
-    qw(key1 key2 key3 key4),
-    key5 => { ... },
-    key6 => [ ... ],
-    key7 => sub { ... },
-    key8 => { ... },
-    key8 => [ ... ],
-  ]);
+      my $options = [
+        [ key1 => undef,        ],
+        [ key2 => undef,        ],
+        [ key3 => undef,        ],
+        [ key4 => undef,        ],
+        [ key5 => { ... },      ],
+        [ key6 => [ ... ],      ],
+        [ key7 => sub { ... },  ],
+        [ key8 => { ... },      ],
+        [ key8 => [ ... ],      ],
+      ]);
+
+DESCRIPTION
+    Hashes are great for storing named data, but if you want more than one
+    entry for a name, you have to use a list of pairs. Even then, this is
+    really boring to write:
+
+      $values = [
+        foo => undef,
+        bar => undef,
+        baz => undef,
+        xyz => { ... },
+      ];
+
+    Just look at all those undefs! Don't worry, we can get rid of those:
+
+      $values = [
+        map { $_ => undef } qw(foo bar baz),
+        xyz => { ... },
+      ];
+
+    Aaaauuugh! We've saved a little typing, but now it requires thought to
+    read, and thinking is even worse than typing.
+
+    With Data::OptList, you can do this instead:
+
+      $values = Data::OptList::mkopt([
+        qw(foo bar baz),
+        xyz => { ... },
+      ]);
+
+    This works by assuming that any defined scalar is a name and any
+    reference following a name is its value.
+
+FUNCTIONS
+  mkopt
+      my $opt_list = Data::OptList::mkopt(
+        $input,
+        $moniker,
+        $require_unique,
+        $must_be,
+      );
+
+    This produces an array of arrays; the inner arrays are name/value pairs.
+    Values will be either "undef" or a reference.
+
+    Valid values for $input:
+
+     undef    -> []
+     hashref  -> [ [ key1 => value1 ] ... ] # non-ref values become undef
+     arrayref -> every value followed by a ref becomes a pair: [ value => ref   ]
+                 every value followed by undef becomes a pair: [ value => undef ]
+                 otherwise, it becomes [ value => undef ] like so:
+                 [ "a", "b", [ 1, 2 ] ] -> [ [ a => undef ], [ b => [ 1, 2 ] ] ]
+
+    $moniker is a name describing the data, which will be used in error
+    messages.
+
+    If $require_unique is true, an error will be thrown if any name is given
+    more than once.
+
+    $must_be is either a scalar or array of scalars; it defines what kind(s)
+    of refs may be values. If an invalid value is found, an exception is
+    thrown. If no value is passed for this argument, any reference is valid.
+    If $must_be specifies that values must be CODE, HASH, ARRAY, or SCALAR,
+    then Params::Util is used to check whether the given value can provide
+    that interface. Otherwise, it checks that the given value is an object
+    of the kind.
+
+    In other words:
+
+      [ qw(SCALAR HASH Object::Known) ]
+
+    Means:
+
+      _SCALAR0($value) or _HASH($value) or _INSTANCE($value, 'Object::Known')
+
+  mkopt_hash
+      my $opt_hash = Data::OptList::mkopt_hash($input, $moniker, $must_be);
+
+    Given valid "mkopt" input, this routine returns a reference to a hash.
+    It will throw an exception if any name has more than one value.
+
+EXPORTS
+    Both "mkopt" and "mkopt_hash" may be exported on request.
+
+AUTHOR
+    Ricardo SIGNES, "<rjbs at cpan.org>"
+
+BUGS
+    Please report any bugs or feature requests at <http://rt.cpan.org>. I
+    will be notified, and then you'll automatically be notified of progress
+    on your bug as I make changes.
+
+COPYRIGHT
+    Copyright 2006-2007, Ricardo SIGNES. This program is free software; you
+    can redistribute it and/or modify it under the same terms as Perl
+    itself.
+

Modified: packages/libdata-optlist-perl/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/debian/changelog?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/debian/changelog (original)
+++ packages/libdata-optlist-perl/trunk/debian/changelog Wed Jul 11 10:18:53 2007
@@ -1,3 +1,9 @@
+libdata-optlist-perl (0.102-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Krzysztof Krzyzaniak (eloy) <eloy at debian.org>  Wed, 11 Jul 2007 12:16:53 +0200
+
 libdata-optlist-perl (0.101-1) unstable; urgency=low
 
   * New upstream release

Modified: packages/libdata-optlist-perl/trunk/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/inc/Module/Install.pm?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/inc/Module/Install.pm (original)
+++ packages/libdata-optlist-perl/trunk/inc/Module/Install.pm Wed Jul 11 10:18:53 2007
@@ -28,7 +28,7 @@
     # This is not enforced yet, but will be some time in the next few
     # releases once we can make sure it won't clash with custom
     # Module::Install extensions.
-    $VERSION = '0.62';
+    $VERSION = '0.67';
 }
 
 # Whether or not inc::Module::Install is actually loaded, the
@@ -47,6 +47,22 @@
 not:
 
     use ${\__PACKAGE__};
+
+END_DIE
+}
+
+# If the script that is loading Module::Install is from the future,
+# then make will detect this and cause it to re-run over and over
+# again. This is bad. Rather than taking action to touch it (which
+# is unreliable on some platforms and requires write permissions)
+# for now we should catch this and refuse to run.
+if ( -f $0 and (stat($0))[9] > time ) {
+	die << "END_DIE";
+Your installer $0 has a modification time in the future.
+
+This is known to create infinite loops in make.
+
+Please correct this, then run $0 again.
 
 END_DIE
 }

Modified: packages/libdata-optlist-perl/trunk/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/inc/Module/Install/Base.pm?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/inc/Module/Install/Base.pm (original)
+++ packages/libdata-optlist-perl/trunk/inc/Module/Install/Base.pm Wed Jul 11 10:18:53 2007
@@ -1,7 +1,7 @@
 #line 1
 package Module::Install::Base;
 
-$VERSION = '0.62';
+$VERSION = '0.67';
 
 # Suspend handler for "redefined" warnings
 BEGIN {

Modified: packages/libdata-optlist-perl/trunk/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/inc/Module/Install/Can.pm?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/inc/Module/Install/Can.pm (original)
+++ packages/libdata-optlist-perl/trunk/inc/Module/Install/Can.pm Wed Jul 11 10:18:53 2007
@@ -11,7 +11,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.62';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: packages/libdata-optlist-perl/trunk/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/inc/Module/Install/Fetch.pm?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/inc/Module/Install/Fetch.pm (original)
+++ packages/libdata-optlist-perl/trunk/inc/Module/Install/Fetch.pm Wed Jul 11 10:18:53 2007
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.62';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: packages/libdata-optlist-perl/trunk/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/inc/Module/Install/Makefile.pm?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/inc/Module/Install/Makefile.pm (original)
+++ packages/libdata-optlist-perl/trunk/inc/Module/Install/Makefile.pm Wed Jul 11 10:18:53 2007
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.62';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
@@ -17,192 +17,221 @@
 my %seen = ();
 
 sub prompt {
-    shift;
-
-    # Infinite loop protection
-    my @c = caller();
-    if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
-        die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
-    }
-
-    # In automated testing, always use defaults
-    if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
-        local $ENV{PERL_MM_USE_DEFAULT} = 1;
-        goto &ExtUtils::MakeMaker::prompt;
-    } else {
-        goto &ExtUtils::MakeMaker::prompt;
-    }
+	shift;
+
+	# Infinite loop protection
+	my @c = caller();
+	if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
+		die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
+	}
+
+	# In automated testing, always use defaults
+	if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
+		local $ENV{PERL_MM_USE_DEFAULT} = 1;
+		goto &ExtUtils::MakeMaker::prompt;
+	} else {
+		goto &ExtUtils::MakeMaker::prompt;
+	}
 }
 
 sub makemaker_args {
-    my $self = shift;
-    my $args = ($self->{makemaker_args} ||= {});
-    %$args = ( %$args, @_ ) if @_;
-    $args;
+	my $self = shift;
+	my $args = ($self->{makemaker_args} ||= {});
+	%$args = ( %$args, @_ ) if @_;
+	$args;
 }
 
 # For mm args that take multiple space-seperated args,
 # append an argument to the current list.
 sub makemaker_append {
-    my $self = shift;
-    my $name = shift;
-    my $args = $self->makemaker_args;
-    $args->{name} = defined $args->{$name}
-    	? join( ' ', $args->{name}, @_ )
-    	: join( ' ', @_ );
+	my $self = sShift;
+	my $name = shift;
+	my $args = $self->makemaker_args;
+	$args->{name} = defined $args->{$name}
+		? join( ' ', $args->{name}, @_ )
+		: join( ' ', @_ );
 }
 
 sub build_subdirs {
-    my $self    = shift;
-    my $subdirs = $self->makemaker_args->{DIR} ||= [];
-    for my $subdir (@_) {
-        push @$subdirs, $subdir;
-    }
+	my $self    = shift;
+	my $subdirs = $self->makemaker_args->{DIR} ||= [];
+	for my $subdir (@_) {
+		push @$subdirs, $subdir;
+	}
 }
 
 sub clean_files {
-    my $self  = shift;
-    my $clean = $self->makemaker_args->{clean} ||= {};
-    %$clean = (
-        %$clean, 
-        FILES => join(' ', grep length, $clean->{FILES}, @_),
-    );
+	my $self  = shift;
+	my $clean = $self->makemaker_args->{clean} ||= {};
+	%$clean = (
+		%$clean, 
+		FILES => join(' ', grep length, $clean->{FILES}, @_),
+	);
 }
 
 sub realclean_files {
-    my $self  = shift;
-    my $realclean = $self->makemaker_args->{realclean} ||= {};
-    %$realclean = (
-        %$realclean, 
-        FILES => join(' ', grep length, $realclean->{FILES}, @_),
-    );
+	my $self  = shift;
+	my $realclean = $self->makemaker_args->{realclean} ||= {};
+	%$realclean = (
+		%$realclean, 
+		FILES => join(' ', grep length, $realclean->{FILES}, @_),
+	);
 }
 
 sub libs {
-    my $self = shift;
-    my $libs = ref $_[0] ? shift : [ shift ];
-    $self->makemaker_args( LIBS => $libs );
+	my $self = shift;
+	my $libs = ref $_[0] ? shift : [ shift ];
+	$self->makemaker_args( LIBS => $libs );
 }
 
 sub inc {
-    my $self = shift;
-    $self->makemaker_args( INC => shift );
+	my $self = shift;
+	$self->makemaker_args( INC => shift );
+}
+
+my %test_dir = ();
+
+sub _wanted_t {
+	/\.t$/ and -f $_ and $test_dir{$File::Find::dir} = 1;
+}
+
+sub tests_recursive {
+	my $self = shift;
+	if ( $self->tests ) {
+		die "tests_recursive will not work if tests are already defined";
+	}
+	my $dir = shift || 't';
+	unless ( -d $dir ) {
+		die "tests_recursive dir '$dir' does not exist";
+	}
+	require File::Find;
+	%test_dir = ();
+	File::Find::find( \&_wanted_t, $dir );
+	$self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir );
 }
 
 sub write {
-    my $self = shift;
-    die "&Makefile->write() takes no arguments\n" if @_;
-
-    my $args = $self->makemaker_args;
-    $args->{DISTNAME} = $self->name;
-    $args->{NAME}     = $self->module_name || $self->name || $self->determine_NAME($args);
-    $args->{VERSION}  = $self->version || $self->determine_VERSION($args);
-    $args->{NAME}     =~ s/-/::/g;
-    if ( $self->tests ) {
-        $args->{test} = { TESTS => $self->tests };
-    }
-    if ($] >= 5.005) {
-        $args->{ABSTRACT} = $self->abstract;
-        $args->{AUTHOR}   = $self->author;
-    }
-    if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
-        $args->{NO_META} = 1;
-    }
-    if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
-        $args->{SIGN} = 1;
-    }
-    unless ( $self->is_admin ) {
-        delete $args->{SIGN};
-    }
-
-    # merge both kinds of requires into prereq_pm
-    my $prereq = ($args->{PREREQ_PM} ||= {});
-    %$prereq = ( %$prereq, map { @$_ } map { @$_ } grep $_,
-                 ($self->build_requires, $self->requires) );
-
-    # merge both kinds of requires into prereq_pm
-    my $subdirs = ($args->{DIR} ||= []);
-    if ($self->bundles) {
-        foreach my $bundle (@{ $self->bundles }) {
-            my ($file, $dir) = @$bundle;
-            push @$subdirs, $dir if -d $dir;
-            delete $prereq->{$file};
-        }
-    }
-
-    if ( my $perl_version = $self->perl_version ) {
-        eval "use $perl_version; 1"
-            or die "ERROR: perl: Version $] is installed, "
-                . "but we need version >= $perl_version";
-    }
-
-    my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
-    if ($self->admin->preop) {
-        $args{dist} = $self->admin->preop;
-    }
-
-    my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
-    $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
+	my $self = shift;
+	die "&Makefile->write() takes no arguments\n" if @_;
+
+	my $args = $self->makemaker_args;
+	$args->{DISTNAME} = $self->name;
+	$args->{NAME}     = $self->module_name || $self->name || $self->determine_NAME($args);
+	$args->{VERSION}  = $self->version || $self->determine_VERSION($args);
+	$args->{NAME}     =~ s/-/::/g;
+	if ( $self->tests ) {
+		$args->{test} = { TESTS => $self->tests };
+	}
+	if ($] >= 5.005) {
+		$args->{ABSTRACT} = $self->abstract;
+		$args->{AUTHOR}   = $self->author;
+	}
+	if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
+		$args->{NO_META} = 1;
+	}
+	if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
+		$args->{SIGN} = 1;
+	}
+	unless ( $self->is_admin ) {
+		delete $args->{SIGN};
+	}
+
+	# merge both kinds of requires into prereq_pm
+	my $prereq = ($args->{PREREQ_PM} ||= {});
+	%$prereq = ( %$prereq,
+		map { @$_ }
+		map { @$_ }
+		grep $_,
+		($self->build_requires, $self->requires)
+	);
+
+	# merge both kinds of requires into prereq_pm
+	my $subdirs = ($args->{DIR} ||= []);
+	if ($self->bundles) {
+		foreach my $bundle (@{ $self->bundles }) {
+			my ($file, $dir) = @$bundle;
+			push @$subdirs, $dir if -d $dir;
+			delete $prereq->{$file};
+		}
+	}
+
+	if ( my $perl_version = $self->perl_version ) {
+		eval "use $perl_version; 1"
+			or die "ERROR: perl: Version $] is installed, "
+			. "but we need version >= $perl_version";
+	}
+
+	$args->{INSTALLDIRS} = $self->installdirs;
+
+	my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
+
+	my $user_preop = delete $args{dist}->{PREOP};
+	if (my $preop = $self->admin->preop($user_preop)) {
+		$args{dist} = $preop;
+	}
+
+	my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
+	$self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
 }
 
 sub fix_up_makefile {
-    my $self          = shift;
-    my $makefile_name = shift;
-    my $top_class     = ref($self->_top) || '';
-    my $top_version   = $self->_top->VERSION || '';
-
-    my $preamble = $self->preamble 
-        ? "# Preamble by $top_class $top_version\n"
-            . $self->preamble
-        : '';
-    my $postamble = "# Postamble by $top_class $top_version\n"
-        . ($self->postamble || '');
-
-    local *MAKEFILE;
-    open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
-    my $makefile = do { local $/; <MAKEFILE> };
-    close MAKEFILE or die $!;
-
-    $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
-    $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
-    $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
-    $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
-    $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
-
-    # Module::Install will never be used to build the Core Perl
-    # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
-    # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
-    $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
-    #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
-
-    # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
-    $makefile =~ s/("?)-I\$\(PERL_LIB\)\1//g;
-
-    # XXX - This is currently unused; not sure if it breaks other MM-users
-    # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
-
-    open  MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
-    print MAKEFILE  "$preamble$makefile$postamble" or die $!;
-    close MAKEFILE  or die $!;
-
-    1;
+	my $self          = shift;
+	my $makefile_name = shift;
+	my $top_class     = ref($self->_top) || '';
+	my $top_version   = $self->_top->VERSION || '';
+
+	my $preamble = $self->preamble 
+		? "# Preamble by $top_class $top_version\n"
+			. $self->preamble
+		: '';
+	my $postamble = "# Postamble by $top_class $top_version\n"
+		. ($self->postamble || '');
+
+	local *MAKEFILE;
+	open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	my $makefile = do { local $/; <MAKEFILE> };
+	close MAKEFILE or die $!;
+
+	$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
+	$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
+	$makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
+	$makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
+	$makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
+
+	# Module::Install will never be used to build the Core Perl
+	# Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
+	# PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
+	$makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
+	#$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
+
+	# Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
+	$makefile =~ s/("?)-I\$\(PERL_LIB\)\1//g;
+
+	# XXX - This is currently unused; not sure if it breaks other MM-users
+	# $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
+
+	open  MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	print MAKEFILE  "$preamble$makefile$postamble" or die $!;
+	close MAKEFILE  or die $!;
+
+	1;
 }
 
 sub preamble {
-    my ($self, $text) = @_;
-    $self->{preamble} = $text . $self->{preamble} if defined $text;
-    $self->{preamble};
+	my ($self, $text) = @_;
+	$self->{preamble} = $text . $self->{preamble} if defined $text;
+	$self->{preamble};
 }
 
 sub postamble {
-    my ($self, $text) = @_;
-    $self->{postamble} ||= $self->admin->postamble;
-    $self->{postamble} .= $text if defined $text;
-    $self->{postamble}
+	my ($self, $text) = @_;
+	$self->{postamble} ||= $self->admin->postamble;
+	$self->{postamble} .= $text if defined $text;
+	$self->{postamble}
 }
 
 1;
 
 __END__
 
-#line 334
+#line 363

Modified: packages/libdata-optlist-perl/trunk/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/inc/Module/Install/Metadata.pm?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/inc/Module/Install/Metadata.pm (original)
+++ packages/libdata-optlist-perl/trunk/inc/Module/Install/Metadata.pm Wed Jul 11 10:18:53 2007
@@ -6,14 +6,14 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.62';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
 
 my @scalar_keys = qw{
     name module_name abstract author version license
-    distribution_type perl_version tests
+    distribution_type perl_version tests installdirs
 };
 
 my @tuple_keys = qw{
@@ -56,9 +56,23 @@
     };
 }
 
+# configure_requires is currently a null-op
+sub configure_requires { 1 }
+
+# Aliases for build_requires that will have alternative
+# meanings in some future version of META.yml.
+sub test_requires      { shift->build_requires(@_)  }
+sub install_requires   { shift->build_requires(@_)  }
+
+# Aliases for installdirs options
+sub install_as_core    { $_[0]->installdirs('perl')   }
+sub install_as_cpan    { $_[0]->installdirs('site')   }
+sub install_as_site    { $_[0]->installdirs('site')   }
+sub install_as_vendor  { $_[0]->installdirs('vendor') }
+
 sub sign {
     my $self = shift;
-    return $self->{'values'}{'sign'} if defined wantarray and !@_;
+    return $self->{'values'}{'sign'} if defined wantarray and ! @_;
     $self->{'values'}{'sign'} = ( @_ ? $_[0] : 1 );
     return $self;
 }
@@ -123,9 +137,9 @@
 
     require Module::Build;
     my $build = Module::Build->new(
-        dist_name    => $self->{name},
-        dist_version => $self->{version},
-        license      => $self->{license},
+        dist_name    => $self->name,
+        dist_version => $self->version,
+        license      => $self->license,
     );
     $self->provides(%{ $build->find_dist_packages || {} });
 }
@@ -279,9 +293,11 @@
 
     if (
         $self->_slurp($file) =~ m/
-        =head \d \s+
-        (?:licen[cs]e|licensing|copyright|legal)\b
-        (.*?)
+        (
+            =head \d \s+
+            (?:licen[cs]e|licensing|copyright|legal)\b
+            .*?
+        )
         (=head\\d.*|=cut.*|)
         \z
     /ixms
@@ -289,19 +305,24 @@
     {
         my $license_text = $1;
         my @phrases      = (
-            'under the same (?:terms|license) as perl itself' => 'perl',
-            'GNU public license'                              => 'gpl',
-            'GNU lesser public license'                       => 'gpl',
-            'BSD license'                                     => 'bsd',
-            'Artistic license'                                => 'artistic',
-            'GPL'                                             => 'gpl',
-            'LGPL'                                            => 'lgpl',
-            'BSD'                                             => 'bsd',
-            'Artistic'                                        => 'artistic',
+            'under the same (?:terms|license) as perl itself' => 'perl',        1,
+            'GNU public license'                              => 'gpl',         1,
+            'GNU lesser public license'                       => 'gpl',         1,
+            'BSD license'                                     => 'bsd',         1,
+            'Artistic license'                                => 'artistic',    1,
+            'GPL'                                             => 'gpl',         1,
+            'LGPL'                                            => 'lgpl',        1,
+            'BSD'                                             => 'bsd',         1,
+            'Artistic'                                        => 'artistic',    1,
+            'MIT'                                             => 'mit',         1,
+            'proprietary'                                     => 'proprietary', 0,
         );
-        while ( my ( $pattern, $license ) = splice( @phrases, 0, 2 ) ) {
+        while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
             $pattern =~ s{\s+}{\\s+}g;
             if ( $license_text =~ /\b$pattern\b/i ) {
+                if ( $osi and $license_text =~ /All rights reserved/i ) {
+                        warn "LEGAL WARNING: 'All rights reserved' may invalidate Open Source licenses. Consider removing it.";
+		}
                 $self->license($license);
                 return 1;
             }

Modified: packages/libdata-optlist-perl/trunk/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/inc/Module/Install/Win32.pm?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/inc/Module/Install/Win32.pm (original)
+++ packages/libdata-optlist-perl/trunk/inc/Module/Install/Win32.pm Wed Jul 11 10:18:53 2007
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.62';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: packages/libdata-optlist-perl/trunk/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/inc/Module/Install/WriteAll.pm?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/inc/Module/Install/WriteAll.pm (original)
+++ packages/libdata-optlist-perl/trunk/inc/Module/Install/WriteAll.pm Wed Jul 11 10:18:53 2007
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.62';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: packages/libdata-optlist-perl/trunk/lib/Data/OptList.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/lib/Data/OptList.pm?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/lib/Data/OptList.pm (original)
+++ packages/libdata-optlist-perl/trunk/lib/Data/OptList.pm Wed Jul 11 10:18:53 2007
@@ -3,19 +3,23 @@
 use strict;
 use warnings;
 
+use List::Util ();
+use Params::Util ();
+use Sub::Install 0.92 ();
+
 =head1 NAME
 
 Data::OptList - parse and validate simple name/value option pairs
 
 =head1 VERSION
 
-version 0.101
-
-  $Id: /my/cs/projects/optlist/trunk/lib/Data/OptList.pm 22474 2006-06-13T12:44:51.413983Z rjbs  $
-
-=cut
-
-our $VERSION = '0.101';
+version 0.102
+
+  $Id: /my/cs/projects/Data-OptList/trunk/lib/Data/OptList.pm 31979 2007-07-05T02:17:36.805594Z rjbs  $
+
+=cut
+
+our $VERSION = '0.102';
 
 =head1 SYNOPSIS
 
@@ -50,38 +54,32 @@
 for a name, you have to use a list of pairs.  Even then, this is really boring
 to write:
 
-  @values = (
+  $values = [
     foo => undef,
     bar => undef,
     baz => undef,
     xyz => { ... },
-  );
+  ];
 
 Just look at all those undefs!  Don't worry, we can get rid of those:
 
-  @values = (
+  $values = [
     map { $_ => undef } qw(foo bar baz),
     xyz => { ... },
-  );
+  ];
 
 Aaaauuugh!  We've saved a little typing, but now it requires thought to read,
 and thinking is even worse than typing.
 
 With Data::OptList, you can do this instead:
 
-  Data::OptList::mkopt([
+  $values = Data::OptList::mkopt([
     qw(foo bar baz),
     xyz => { ... },
   ]);
 
 This works by assuming that any defined scalar is a name and any reference
 following a name is its value.
-
-=cut
-
-use List::Util ();
-use Params::Util ();
-use Sub::Install 0.92 ();
 
 =head1 FUNCTIONS
 
@@ -97,7 +95,7 @@
 This produces an array of arrays; the inner arrays are name/value pairs.
 Values will be either "undef" or a reference.
 
-Valid inputs:
+Valid values for C<$input>:
 
  undef    -> []
  hashref  -> [ [ key1 => value1 ] ... ] # non-ref values become undef
@@ -114,17 +112,28 @@
 
 C<$must_be> is either a scalar or array of scalars; it defines what kind(s) of
 refs may be values.  If an invalid value is found, an exception is thrown.  If
-no value is passed for this argument, any reference is valid.
+no value is passed for this argument, any reference is valid.  If C<$must_be>
+specifies that values must be CODE, HASH, ARRAY, or SCALAR, then Params::Util
+is used to check whether the given value can provide that interface.
+Otherwise, it checks that the given value is an object of the kind.
+
+In other words:
+
+  [ qw(SCALAR HASH Object::Known) ]
+
+Means:
+
+  _SCALAR0($value) or _HASH($value) or _INSTANCE($value, 'Object::Known')
 
 =cut
 
 my %test_for;
 BEGIN {
   %test_for = (
-    CODE   => \&Params::Util::_CODELIKE,
-    HASH   => \&Params::Util::_HASHLIKE,
-    ARRAY  => \&Params::Util::_ARRAYLIKE,
-    SCALAR => \&Params::Util::_SCALAR0,
+    CODE   => \&Params::Util::_CODELIKE,  ## no critic
+    HASH   => \&Params::Util::_HASHLIKE,  ## no critic
+    ARRAY  => \&Params::Util::_ARRAYLIKE, ## no critic
+    SCALAR => \&Params::Util::_SCALAR0,   ## no critic
   );
 }
 
@@ -133,9 +142,11 @@
 
   return List::Util::first { __is_a($got, $_) } @$expected if ref $expected;
 
-  return defined
-    (exists($test_for{$expected}) ? $test_for{$expected}->($got)
-                                 : Params::Util::_INSTANCE($got, $expected));
+  return defined (
+    exists($test_for{$expected})
+    ? $test_for{$expected}->($got)
+    : Params::Util::_INSTANCE($got, $expected) ## no critic
+  );
 }
 
 sub mkopt {
@@ -150,7 +161,7 @@
   my @return;
   my %seen;
 
-  for (my $i = 0; $i < @$opt_list; $i++) {
+  for (my $i = 0; $i < @$opt_list; $i++) { ## no critic
     my $name = $opt_list->[$i];
     my $value;
 
@@ -180,8 +191,8 @@
 
   my $opt_hash = Data::OptList::mkopt_hash($input, $moniker, $must_be);
 
-Given valid C<mkopt> input, this routine returns a hash.  It will throw an
-exception if any name has more than one value.
+Given valid C<L</mkopt>> input, this routine returns a reference to a hash.  It
+will throw an exception if any name has more than one value.
 
 =cut
 
@@ -196,8 +207,7 @@
 
 =head1 EXPORTS
 
-Both C<mkopt> and C<mkopt_hash> may be exported on
-request.
+Both C<mkopt> and C<mkopt_hash> may be exported on request.
 
 =cut
 
@@ -213,14 +223,13 @@
 
 =head1 BUGS
 
-Please report any bugs or feature requests to C<bug-sub-exporter at rt.cpan.org>,
-or through the web interface at L<http://rt.cpan.org>. I will be notified, and
-then you'll automatically be notified of progress on your bug as I make
-changes.
+Please report any bugs or feature requests at L<http://rt.cpan.org>. I will be
+notified, and then you'll automatically be notified of progress on your bug as
+I make changes.
 
 =head1 COPYRIGHT
 
-Copyright 2006 Ricardo SIGNES.  This program is free software;  you can
+Copyright 2006-2007, Ricardo SIGNES.  This program is free software;  you can
 redistribute it and/or modify it under the same terms as Perl itself.
 
 =cut

Modified: packages/libdata-optlist-perl/trunk/t/hash.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/t/hash.t?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/t/hash.t (original)
+++ packages/libdata-optlist-perl/trunk/t/hash.t Wed Jul 11 10:18:53 2007
@@ -1,4 +1,4 @@
-#!perl -T
+#!/usr/bin/perl
 use strict;
 use warnings;
 

Modified: packages/libdata-optlist-perl/trunk/t/mkopt.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/t/mkopt.t?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/t/mkopt.t (original)
+++ packages/libdata-optlist-perl/trunk/t/mkopt.t Wed Jul 11 10:18:53 2007
@@ -22,7 +22,7 @@
 sub OPT {
   # specifying moniker is tedious (also, these tests predate them)
   splice @_, 1, 0, 'test' if @_ > 1;
-  &mkopt;
+  mkopt(@_);
 }
 
 is_deeply(

Modified: packages/libdata-optlist-perl/trunk/t/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libdata-optlist-perl/trunk/t/pod.t?rev=5723&op=diff
==============================================================================
--- packages/libdata-optlist-perl/trunk/t/pod.t (original)
+++ packages/libdata-optlist-perl/trunk/t/pod.t Wed Jul 11 10:18:53 2007
@@ -1,3 +1,4 @@
+#!perl -T
 use Test::More;
 
 eval "use Test::Pod 1.00";




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