[SCM] Debian packaging of File-Save-Home CPAN distribution branch, master, updated. 9783f4038411f53e8973701000e0baf977b7d806
Xavier
x.guimard at free.fr
Fri Dec 14 21:23:48 UTC 2012
The following commit has been merged in the master branch:
commit 9783f4038411f53e8973701000e0baf977b7d806
Author: Xavier <x.guimard at free.fr>
Date: Fri Dec 14 22:22:45 2012 +0100
Replace String::PerlIdentifier by String::Random
diff --git a/debian/changelog b/debian/changelog
index 55d3a94..69a2c2d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,21 +1,7 @@
-libfile-save-home-perl (0.8-1) UNRELEASED; urgency=low
-
- TODO:
- - patches:
- + forward spelling-error-in-pod.patch
- + do we really need to bundle String::PerlIdentifier instead of using
- String::Random?
- - d/copyright:
- t/PerlIdentifier.pm doesn't have a copyright statement (just a license)
- --> another reason for dropping it. alternatively, our usual "Berne
- convention" comment is needed
- - debian/libfile-save-home-perl.docs
- + do we need the README?
- - d/control:
- + remove 'perl' from Depends
+libfile-save-home-perl (0.8-1) unstable; urgency=low
* Initial Release (Closes: #695558)
- * Include of String::PerlIdentifier in test instead of building a package
- for it
+ * Replace the use of String::PerlIdentifier in test by String::Random
+ (See: #695559)
- -- Xavier Guimard <x.guimard at free.fr> Wed, 12 Dec 2012 05:33:26 +0100
+ -- Xavier Guimard <x.guimard at free.fr> Fri, 14 Dec 2012 22:22:39 +0100
diff --git a/debian/control b/debian/control
index 1e10b6c..a4d4653 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,8 @@ Priority: optional
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Xavier Guimard <x.guimard at free.fr>
Build-Depends: debhelper (>= 8)
-Build-Depends-Indep: perl
+Build-Depends-Indep: libstring-random-perl,
+ perl
Standards-Version: 3.9.4
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libfile-save-home-perl.git
Vcs-Git: git://git.debian.org/pkg-perl/packages/libfile-save-home-perl.git
diff --git a/debian/copyright b/debian/copyright
index f934a40..7b0a6bd 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -7,11 +7,6 @@ Files: *
Copyright: 2005-2006, James E Keenan <jkeenan at cpan.org>
License: Artistic or GPL-1+
-Files: t/PerlIdentifier.pm
-Comment: Added by include-libstring-perlidentifier-perl-in-tests.patch
-Copyright: 2005, James E Keenan <jkeenan at cpan.org>
-License: Artistic or GPL-1+
-
Files: debian/*
Copyright: 2012, Xavier Guimard <x.guimard at free.fr>
License: Artistic or GPL-1+
diff --git a/debian/libfile-save-home-perl.docs b/debian/libfile-save-home-perl.docs
deleted file mode 100644
index e845566..0000000
--- a/debian/libfile-save-home-perl.docs
+++ /dev/null
@@ -1 +0,0 @@
-README
diff --git a/debian/patches/include-libstring-perlidentifier-perl-in-tests.patch b/debian/patches/include-libstring-perlidentifier-perl-in-tests.patch
deleted file mode 100644
index 66891f2..0000000
--- a/debian/patches/include-libstring-perlidentifier-perl-in-tests.patch
+++ /dev/null
@@ -1,324 +0,0 @@
-Description: Include String::PerlIdentifier in test
- Include String::PerlIdentifier in test instead of building a whole package
- (See #695559)
-Author: Xavier Guimard <x.guimard at free.fr>
-Bug-Debian: http://bugs.debian.org/695559
-Forwarded: no
-Last-Update: 2012-12-11
-
---- libfile-save-home-perl-0.8.orig/META.yml
-+++ libfile-save-home-perl-0.8/META.yml
-@@ -9,7 +9,6 @@ requires:
- File::Path: 0
- File::Spec: 0
- File::Temp: 0
-- String::PerlIdentifier: 0
- Test::Simple: 0.44
-
- distribution_type: module
---- libfile-save-home-perl-0.8.orig/Makefile.PL
-+++ libfile-save-home-perl-0.8/Makefile.PL
-@@ -14,6 +14,5 @@ WriteMakefile(
- 'File::Path' => 0,
- 'Carp' => 0,
- 'File::Temp' => 0,
-- 'String::PerlIdentifier' => 0,
- },
- );
---- libfile-save-home-perl-0.8.orig/t/05_pseudohome.t
-+++ libfile-save-home-perl-0.8/t/05_pseudohome.t
-@@ -12,7 +12,8 @@ use_ok('File::Save::Home', qw|
- | );
- use_ok('File::Temp', qw| tempdir |);
- use_ok('Cwd');
--use_ok('String::PerlIdentifier');
-+require_ok "t/PerlIdentifier.pm";
-+*make_varname = \&String::PerlIdentifier::make_varname;
-
- my ($cwd, $pseudohome, $desired_dir_ref );
- $cwd = cwd();
---- libfile-save-home-perl-0.8.orig/t/06_Win32.t
-+++ libfile-save-home-perl-0.8/t/06_Win32.t
-@@ -20,7 +20,8 @@ SKIP: {
- | );
- use_ok('File::Temp', qw| tempdir |);
- use_ok('Cwd');
-- use_ok('String::PerlIdentifier');
-+ require_ok "t/PerlIdentifier.pm";
-+ *make_varname = \&String::PerlIdentifier::make_varname;
-
- my ($cwd, $pseudohome, $desired_dir_ref );
- $cwd = cwd();
---- libfile-save-home-perl-0.8.orig/t/03_placefile.t
-+++ libfile-save-home-perl-0.8/t/03_placefile.t
-@@ -12,7 +12,8 @@ use_ok('File::Save::Home', qw|
- conceal_target_file
- reveal_target_file
- | );
--use_ok('String::PerlIdentifier');
-+require_ok "t/PerlIdentifier.pm";
-+*make_varname = \&String::PerlIdentifier::make_varname;
-
- my ($homedir, @subdirs, $desired_dir_ref, $desired_dir, $target_ref, $target );
- ok($homedir = get_home_directory(), 'home directory is defined');
---- /dev/null
-+++ libfile-save-home-perl-0.8/t/PerlIdentifier.pm
-@@ -0,0 +1,234 @@
-+package String::PerlIdentifier;
-+use 5.006001;
-+use strict;
-+use base qw(Exporter);
-+our @EXPORT = qw{ make_varname };
-+our $VERSION = "0.05";
-+use Carp;
-+
-+our @lower = qw(a b c d e f g h i j k l m n o p q r s t u v w x y z);
-+our @upper = map { uc($_) } @lower;
-+#our @eligibles = (@upper, @lower, q{_});
-+#our @chars = (@eligibles, 0..9);
-+our @alphas = (@upper, @lower);
-+
-+our %forbidden = ();
-+our $MIN = 3;
-+our $MAX = 20;
-+our $DEFAULT = 10;
-+
-+sub make_varname {
-+ my $length;
-+ my (@eligibles, @chars);
-+ my $scoresflag = 1;
-+ if (defined $_[0] and ref($_[0]) eq 'HASH') {
-+ my $argsref = shift;
-+ if ( (defined $argsref->{underscores}) &&
-+ ($argsref->{underscores} == 0) ) {
-+ $scoresflag = 0;
-+ }
-+ if (defined $argsref->{min}) {
-+ croak "Minimum must be all numerals: $!"
-+ unless $argsref->{min} =~ /^\d+$/;
-+ croak "Cannot set minimum length less than 2: $!"
-+ unless $argsref->{min} >= 2;
-+ $MIN = $argsref->{min};
-+ }
-+ if (defined $argsref->{max}) {
-+ croak "Maximum must be all numerals: $!"
-+ unless $argsref->{max} =~ /^\d+$/;
-+ croak "Cannot set maximum length less than 3: $!"
-+ unless $argsref->{max} >= 3;
-+ $MAX = $argsref->{max};
-+ }
-+ if (defined $argsref->{default}) {
-+ croak "Default must be all numerals: $!"
-+ unless $argsref->{default} =~ /^\d+$/;
-+ $DEFAULT = $argsref->{default};
-+ }
-+ if ( (defined $argsref->{min}) &&
-+ (defined $argsref->{max}) ) {
-+ croak "Minimum must be <= Maximum: $!"
-+ if $argsref->{min} >= $argsref->{max};
-+ }
-+ } else {
-+ $length = shift;
-+ }
-+ $length = $DEFAULT if ! defined $length;
-+ $length = $MIN if $length < $MIN;
-+ $length = $MAX if $length > $MAX;
-+ @eligibles = $scoresflag ? (@alphas, q{_}) : (@alphas) ;
-+ @chars = (@eligibles, 0..9);
-+
-+ my $varname;
-+ MKVAR: {
-+ $varname = $eligibles[int(rand(@eligibles))];
-+ $varname .= $chars[int(rand(@chars))] for (1 .. ($length - 1));
-+ next MKVAR if $forbidden{$varname};
-+ }
-+ return $varname;
-+}
-+
-+#################### DOCUMENTATION ###################
-+
-+=head1 NAME
-+
-+String::PerlIdentifier - Generate a random name for a Perl variable
-+
-+=head1 VERSION
-+
-+This document refers to version 0.05, released April 21, 2004.
-+
-+=head1 SYNOPSIS
-+
-+ use String::PerlIdentifier;
-+
-+ $varname = make_varname(); # defaults to 10 characters
-+
-+or
-+
-+ $varname = make_varname(12); # min: 3 max: 20
-+
-+or
-+
-+ $varname = make_varname( { # set your own attributes
-+ min => $minimum,
-+ max => $maximum,
-+ default => $default,
-+ } );
-+
-+or
-+
-+ $varname = make_varname( { # no underscores in strings;
-+ underscores => 0, # alphanumerics only
-+ } );
-+
-+=head1 DESCRIPTION
-+
-+This module automatically exports a single subroutine, C<make_varname()>,
-+which returns a string composed of random characters that qualifies as
-+the name for a Perl variable. The characters are limited to upper- and
-+lower-case letters in the English alphabet, the numerals from 0 through 9
-+and the underscore character. The first character may not be a numeral.
-+
-+By default, C<make_varname()> returns a string of 10 characters, but if a
-+numerical argument between 3 and 20 is passed to it, a string of that length
-+will be returned. Arguments smaller than 3 are rounded up to 3; arguments
-+greater than 20 are rounded down to 20.
-+
-+C<make_varname()> can also take as an argument a reference to a hash
-+containing one or more of the following keys:
-+
-+ min
-+ max
-+ default
-+ underscores
-+
-+So if you wanted your string to contain a minimum of 15 characters and a
-+maximum of 30, you would call:
-+
-+ $varname = make_varname( { min => 15, max => 30 } );
-+
-+If you try to set C<min> greater than C<max>, you will get an error message
-+and C<croak>. But if you set C<default> less than C<min> or greater than
-+C<max>, the default value will be raised to the minimum or lowered to the
-+maximum as is appropriate.
-+
-+=head2 No underscores option
-+
-+The only meaningful value for key C<underscores> is C<0>.
-+String::PerlIdentifier, like Perl itself, assumes that underscores are valid
-+parts of identifiers, so underscores are ''on'' by default. So the only time
-+you need to worry about the C<underscores> element in the hash passed by
-+reference to C<make_varname()> is when you want to I<prevent> underscores from
-+being part of the string being generated -- in which case you set:
-+
-+ underscores => 0
-+
-+=head2 Non-Perl-identifier usages
-+
-+Although the strings returned by C<make_varname()> qualify as Perl
-+identifiers, they also are a subset of the set of valid directory and file
-+names on operating systems such as Unix and Windows. This is how, for
-+instance, this module's author uses C<make_varname()>.
-+
-+B<Note:> String::PerlIdentifier originally appeared on CPAN as
-+String::MkVarName. When I went to register it on F<modules at perl.org>,
-+C<brian d foy> persuaded me to change the name.
-+
-+=head1 TO DO
-+
-+Ideally, you should be able to pass the function a list of strings
-+forbidden to be returned by C<make_varname>, I<e.g.,> a list of all
-+Perl variables currently in scope. String::PerlIdentifier doesn't do that yet.
-+
-+=head1 SEE ALSO
-+
-+=over 4
-+
-+=item String::MkPasswd
-+
-+This CPAN module by Chris Grau was the inspiration for String::PerlIdentifier.
-+String::PerlIdentifier evolved as a simplification of String::MkPasswd for
-+use in the test suite for my other CPAN module File::Save::Home.
-+
-+=item String::Random
-+
-+This CPAN module by Steven Pritchard is a more general solution to the problem
-+of generating strings composed of random characters. To generate a
-+10-character string that would qualify as a Perl identifier using
-+String::Random, you would proceed as follows:
-+
-+ use String::Random;
-+ $rr = String::Random->new();
-+ $rr->{'E'} = [ 'A'..'Z', 'a'..'z', '_' ];
-+ $rr->{'F'} = [ 'A'..'Z', 'a'..'z', '_', 0..9 ];
-+
-+then
-+
-+ $rr->randpattern("EFFFFFFFFF");
-+
-+String::Random's greater generality comes at the cost of more typing.
-+
-+=item File::Save::Home
-+
-+CPAN module by the same author as String::PerlIdentifier which uses
-+C<make_varname()> in its test suite as of its version 0.05.
-+File::Save::Home is used internally within recent versions of
-+ExtUtils::ModuleMaker and its test suite.
-+
-+=back
-+
-+=head1 AUTHOR
-+
-+ James E Keenan
-+ CPAN ID: JKEENAN
-+ jkeenan at cpan.org
-+ http://search.cpan.org/~jkeenan
-+
-+=head1 SUPPORT
-+
-+Send email to jkeenan [at] cpan [dot] org. Please include any of the
-+following in the subject line:
-+
-+ String::PerlIdentifier
-+ String-PerlIdentifier
-+ make_varname
-+
-+in the subject line. Please report any bugs or feature requests to
-+C<bug-String-PerlIdentifier at rt.cpan.org>, or through the web interface at
-+L<http://rt.cpan.org>.
-+
-+=head1 COPYRIGHT
-+
-+This program is free software; you can redistribute
-+it and/or modify it under the same terms as Perl itself.
-+
-+The full text of the license can be found in the
-+LICENSE file included with this module.
-+
-+=cut
-+
-+1;
-+
-+
---- libfile-save-home-perl-0.8.orig/t/02_multilevel.t
-+++ libfile-save-home-perl-0.8/t/02_multilevel.t
-@@ -12,7 +12,8 @@ use_ok('File::Save::Home', qw|
- conceal_target_file
- reveal_target_file
- | );
--use_ok('String::PerlIdentifier');
-+require_ok "t/PerlIdentifier.pm";
-+*make_varname = \&String::PerlIdentifier::make_varname;
-
- my ($homedir, @subdirs, $desired_dir_ref, $desired_dir, $target_ref );
- ok($homedir = get_home_directory(), 'home directory is defined');
---- libfile-save-home-perl-0.8.orig/t/01_test.t
-+++ libfile-save-home-perl-0.8/t/01_test.t
-@@ -10,7 +10,8 @@ use_ok('File::Save::Home', qw|
- make_subhome_directory
- restore_subhome_directory_status
- | );
--use_ok('String::PerlIdentifier');
-+require_ok "t/PerlIdentifier.pm";
-+*make_varname = \&String::PerlIdentifier::make_varname;
- use_ok('Cwd');
-
- my ($cwd, $homedir, @subdirs, $desired_dir_ref, $desired_dir );
diff --git a/debian/patches/replace-perlidentifier-by-string-random.patch b/debian/patches/replace-perlidentifier-by-string-random.patch
new file mode 100644
index 0000000..248bdbb
--- /dev/null
+++ b/debian/patches/replace-perlidentifier-by-string-random.patch
@@ -0,0 +1,87 @@
+Description: Replace String::PerlIdentifier by String::Random
+ Include String::PerlIdentifier in test instead of building a whole package
+ (See #695559)
+Author: Xavier Guimard <x.guimard at free.fr>
+Bug-Debian: http://bugs.debian.org/695559
+Forwarded: no
+Last-Update: 2012-12-11
+
+--- a/META.yml
++++ b/META.yml
+@@ -9,7 +9,6 @@ requires:
+ File::Path: 0
+ File::Spec: 0
+ File::Temp: 0
+- String::PerlIdentifier: 0
+ Test::Simple: 0.44
+
+ distribution_type: module
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -14,6 +14,5 @@ WriteMakefile(
+ 'File::Path' => 0,
+ 'Carp' => 0,
+ 'File::Temp' => 0,
+- 'String::PerlIdentifier' => 0,
+ },
+ );
+--- a/t/05_pseudohome.t
++++ b/t/05_pseudohome.t
+@@ -12,7 +12,8 @@ use_ok('File::Save::Home', qw|
+ | );
+ use_ok('File::Temp', qw| tempdir |);
+ use_ok('Cwd');
+-use_ok('String::PerlIdentifier');
++use_ok ( 'String::Random', qw(random_regex) );
++*make_varname = sub { return random_regex(q([a-z]{10})) };
+
+ my ($cwd, $pseudohome, $desired_dir_ref );
+ $cwd = cwd();
+--- a/t/06_Win32.t
++++ b/t/06_Win32.t
+@@ -20,7 +20,8 @@ SKIP: {
+ | );
+ use_ok('File::Temp', qw| tempdir |);
+ use_ok('Cwd');
+- use_ok('String::PerlIdentifier');
++ use_ok ( 'String::Random', qw(random_regex) );
++ *make_varname = sub { return random_regex(q([a-z]{10})) };
+
+ my ($cwd, $pseudohome, $desired_dir_ref );
+ $cwd = cwd();
+--- a/t/03_placefile.t
++++ b/t/03_placefile.t
+@@ -12,7 +12,8 @@ use_ok('File::Save::Home', qw|
+ conceal_target_file
+ reveal_target_file
+ | );
+-use_ok('String::PerlIdentifier');
++use_ok ( 'String::Random', qw(random_regex) );
++*make_varname = sub { return random_regex(q([a-z]{10})) };
+
+ my ($homedir, @subdirs, $desired_dir_ref, $desired_dir, $target_ref, $target );
+ ok($homedir = get_home_directory(), 'home directory is defined');
+--- a/t/02_multilevel.t
++++ b/t/02_multilevel.t
+@@ -12,7 +12,8 @@ use_ok('File::Save::Home', qw|
+ conceal_target_file
+ reveal_target_file
+ | );
+-use_ok('String::PerlIdentifier');
++use_ok ( 'String::Random', qw(random_regex) );
++*make_varname = sub { return random_regex(q([a-z]{10})) };
+
+ my ($homedir, @subdirs, $desired_dir_ref, $desired_dir, $target_ref );
+ ok($homedir = get_home_directory(), 'home directory is defined');
+--- a/t/01_test.t
++++ b/t/01_test.t
+@@ -10,7 +10,8 @@ use_ok('File::Save::Home', qw|
+ make_subhome_directory
+ restore_subhome_directory_status
+ | );
+-use_ok('String::PerlIdentifier');
++use_ok ( 'String::Random', qw(random_regex) );
++*make_varname = sub { return random_regex(q([a-z]{10})) };
+ use_ok('Cwd');
+
+ my ($cwd, $homedir, @subdirs, $desired_dir_ref, $desired_dir );
diff --git a/debian/patches/series b/debian/patches/series
index c9229a6..2cd21a9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,2 @@
-include-libstring-perlidentifier-perl-in-tests.patch
+replace-perlidentifier-by-string-random.patch
spelling-error-in-pod.patch
--
Debian packaging of File-Save-Home CPAN distribution
More information about the Pkg-perl-cvs-commits
mailing list