r23300 - in /trunk/libcgi-session-perl: Build.PL Changes MANIFEST META.yml Makefile.PL debian/changelog lib/CGI/Session.pm t/load.t t/symlink_db_file.t t/symlink_file.t
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Wed Jul 16 17:58:18 UTC 2008
Author: gregoa
Date: Wed Jul 16 17:58:16 2008
New Revision: 23300
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=23300
Log:
New upstream release again, tests fixed, packages builds again
Modified:
trunk/libcgi-session-perl/Build.PL
trunk/libcgi-session-perl/Changes
trunk/libcgi-session-perl/MANIFEST
trunk/libcgi-session-perl/META.yml
trunk/libcgi-session-perl/Makefile.PL
trunk/libcgi-session-perl/debian/changelog
trunk/libcgi-session-perl/lib/CGI/Session.pm
trunk/libcgi-session-perl/t/load.t
trunk/libcgi-session-perl/t/symlink_db_file.t
trunk/libcgi-session-perl/t/symlink_file.t
Modified: trunk/libcgi-session-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-session-perl/Build.PL?rev=23300&op=diff
==============================================================================
--- trunk/libcgi-session-perl/Build.PL (original)
+++ trunk/libcgi-session-perl/Build.PL Wed Jul 16 17:58:16 2008
@@ -5,6 +5,80 @@
use File::Spec;
use Module::Build;
use Text::Wrap;
+
+# ------------------------------------------------
+
+sub create_changelog_ini
+{
+ my($error);
+
+ eval "require Module::Metadata::Changes";
+
+ if ($@)
+ {
+ $error = $@;
+ }
+ else
+ {
+ # Ensure Changelog.ini is writable.
+
+ if (-e 'Changelog.ini' && ! -w 'Changelog.ini')
+ {
+ $error = (chmod 0200, 'Changelog.ini' == 0) ? 'Could not make Changelog.ini writable' : '';
+ }
+
+ if (! $error)
+ {
+ eval
+ {
+ print "Regenerating Changelog.ini...\n";
+
+ `ini.report.pl -c -i Changes`;
+
+ if (! -e 'Changelog.ini')
+ {
+ # Warning: Can't use $@ to carry msg out of block(s).
+
+ $error = 'Failed to generate Changelog.ini';
+ }
+ else
+ {
+ my(@stat) = stat 'Changelog.ini';
+
+ # Was the file modified in the last 2 seconds?
+
+ if ( (time() - $stat[9]) < 2)
+ {
+ # Yes. Do nothing.
+ }
+ else
+ {
+ $error = 'Failed to update Changelog.ini';
+ }
+ }
+ };
+
+ if ($@)
+ {
+ $error = $@;
+ }
+ }
+ }
+
+ # We ignore the precise value of $@ here.
+
+ if ($error)
+ {
+ print "Warning: Module::Metadata::Changes's ini.report.pl failed to generate or update Changelog.ini. \n";
+ }
+ else
+ {
+ print "Changelog.ini generated or updated. \n";
+ }
+
+} # End of create_changelog_ini.
+
+# ------------------------------------------------
# Some of the scripts need ./t/sessiondata to be present.
@@ -45,6 +119,9 @@
print "\n";
print "-" x 40, "\n";
+create_changelog_ini();
+print "-" x 40, "\n";
+
Module::Build -> new
(
module_name => 'CGI::Session',
Modified: trunk/libcgi-session-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-session-perl/Changes?rev=23300&op=diff
==============================================================================
--- trunk/libcgi-session-perl/Changes (original)
+++ trunk/libcgi-session-perl/Changes Wed Jul 16 17:58:16 2008
@@ -1,5 +1,12 @@
CGI::Session Change Log
=====================================================================
+
+4.35 - Tuesday, July 15, 2008
+ * FIX: Fix the bug fix for error propagation from 4.34, RT#37628
+ * FIX: Reset errors when creating a new object. Previously, errors from
+ a previous object could show up in the current object.
+ * INTERNAL - Patch Build.PL and Makefile.PL to run Module::Metadata::Changes's ini.report.pl,
+ if available, to regenerate Changelog.ini from this file (Changes), when creating a makefile.
4.34 - Sunday, July 13, 2008
* SECURITY: Patch CGI::Session::Driver::file to stop \ and / characters being used in
@@ -365,4 +372,4 @@
* Bug in POD documentation is fixed (thanks to Graham Barr)
-$Id: Changes 421 2008-07-13 00:48:43Z ron $
+$Id: Changes 429 2008-07-15 00:27:52Z markstos $
Modified: trunk/libcgi-session-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-session-perl/MANIFEST?rev=23300&op=diff
==============================================================================
--- trunk/libcgi-session-perl/MANIFEST (original)
+++ trunk/libcgi-session-perl/MANIFEST Wed Jul 16 17:58:16 2008
@@ -70,4 +70,4 @@
t/str2seconds.t
t/symlink_db_file.t
t/symlink_file.t
-META.yml Module meta-data (added by MakeMaker)
+META.yml
Modified: trunk/libcgi-session-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-session-perl/META.yml?rev=23300&op=diff
==============================================================================
--- trunk/libcgi-session-perl/META.yml (original)
+++ trunk/libcgi-session-perl/META.yml Wed Jul 16 17:58:16 2008
@@ -1,14 +1,76 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: CGI-Session
-version: 4.34
-version_from: lib/CGI/Session.pm
-installdirs: site
+---
+name: CGI-Session
+version: 4.35
+author:
+ - 'Sherzod Ruzmetov <sherzodr at cpan.org>'
+abstract: Persistent session data in CGI applications
+license: artistic
+resources:
+ license: http://opensource.org/licenses/artistic-license.php
requires:
- Data::Dumper:
- Digest::MD5:
- Scalar::Util:
- Test::More:
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30_01
+ Data::Dumper: 0
+ Digest::MD5: 0
+ Scalar::Util: 0
+build_requires:
+ Test::More: 0
+ Test::Pod: 0
+provides:
+ CGI::Session:
+ file: lib/CGI/Session.pm
+ version: 4.35
+ CGI::Session::Driver:
+ file: lib/CGI/Session/Driver.pm
+ version: 4.33
+ CGI::Session::Driver::DBI:
+ file: lib/CGI/Session/Driver/DBI.pm
+ version: 4.33
+ CGI::Session::Driver::db_file:
+ file: lib/CGI/Session/Driver/db_file.pm
+ version: 4.33
+ CGI::Session::Driver::file:
+ file: lib/CGI/Session/Driver/file.pm
+ version: 4.34
+ CGI::Session::Driver::mysql:
+ file: lib/CGI/Session/Driver/mysql.pm
+ version: 4.33
+ CGI::Session::Driver::postgresql:
+ file: lib/CGI/Session/Driver/postgresql.pm
+ version: 4.33
+ CGI::Session::Driver::sqlite:
+ file: lib/CGI/Session/Driver/sqlite.pm
+ version: 4.33
+ CGI::Session::ErrorHandler:
+ file: lib/CGI/Session/ErrorHandler.pm
+ version: 4.33
+ CGI::Session::ID::incr:
+ file: lib/CGI/Session/ID/incr.pm
+ version: 4.33
+ CGI::Session::ID::md5:
+ file: lib/CGI/Session/ID/md5.pm
+ version: 4.33
+ CGI::Session::ID::static:
+ file: lib/CGI/Session/ID/static.pm
+ version: 4.33
+ CGI::Session::Serialize::default:
+ file: lib/CGI/Session/Serialize/default.pm
+ version: 4.33
+ CGI::Session::Serialize::freezethaw:
+ file: lib/CGI/Session/Serialize/freezethaw.pm
+ version: 4.2
+ CGI::Session::Serialize::storable:
+ file: lib/CGI/Session/Serialize/storable.pm
+ version: 4.33
+ CGI::Session::Test::Default:
+ file: lib/CGI/Session/Test/Default.pm
+ version: 4.33
+ CGI::Session::Tutorial:
+ file: lib/CGI/Session/Tutorial.pm
+ version: 4.33
+ OverloadedObjectClass:
+ file: lib/CGI/Session/Test/Default.pm
+ SimpleObjectClass:
+ file: lib/CGI/Session/Test/Default.pm
+generated_by: Module::Build version 0.2806
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.2.html
+ version: 1.2
Modified: trunk/libcgi-session-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-session-perl/Makefile.PL?rev=23300&op=diff
==============================================================================
--- trunk/libcgi-session-perl/Makefile.PL (original)
+++ trunk/libcgi-session-perl/Makefile.PL Wed Jul 16 17:58:16 2008
@@ -1,10 +1,84 @@
-# $Id: Makefile.PL 399 2008-03-26 02:23:24Z ron $
+# $Id: Makefile.PL 427 2008-07-14 04:25:54Z ron $
use strict;
use Text::Wrap;
use File::Spec;
use lib './t/lib';
use ExtUtils::MakeMaker;
+
+# ------------------------------------------------
+
+sub create_changelog_ini
+{
+ my($error);
+
+ eval "require Module::Metadata::Changes";
+
+ if ($@)
+ {
+ $error = $@;
+ }
+ else
+ {
+ # Ensure Changelog.ini is writable.
+
+ if (-e 'Changelog.ini' && ! -w 'Changelog.ini')
+ {
+ $error = (chmod 0200, 'Changelog.ini' == 0) ? 'Could not make Changelog.ini writable' : '';
+ }
+
+ if (! $error)
+ {
+ eval
+ {
+ print "Regenerating Changelog.ini...\n";
+
+ `ini.report.pl -c -i Changes`;
+
+ if (! -e 'Changelog.ini')
+ {
+ # Warning: Can't use $@ to carry msg out of block(s).
+
+ $error = 'Failed to generate Changelog.ini';
+ }
+ else
+ {
+ my(@stat) = stat 'Changelog.ini';
+
+ # Was the file modified in the last 2 seconds?
+
+ if ( (time() - $stat[9]) < 2)
+ {
+ # Yes. Do nothing.
+ }
+ else
+ {
+ $error = 'Failed to update Changelog.ini';
+ }
+ }
+ };
+
+ if ($@)
+ {
+ $error = $@;
+ }
+ }
+ }
+
+ # We ignore the precise value of $@ here.
+
+ if ($error)
+ {
+ print "Warning: Module::Metadata::Changes's ini.report.pl failed to generate or update Changelog.ini. \n";
+ }
+ else
+ {
+ print "Changelog.ini generated or updated. \n";
+ }
+
+} # End of create_changelog_ini.
+
+# ------------------------------------------------
print "-" x 40, "\n";
print fill("", "", <<'MESSAGE');
@@ -39,6 +113,9 @@
";
print "\n";
+print "-" x 40, "\n";
+
+create_changelog_ini();
print "-" x 40, "\n";
WriteMakefile(
Modified: trunk/libcgi-session-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-session-perl/debian/changelog?rev=23300&op=diff
==============================================================================
--- trunk/libcgi-session-perl/debian/changelog (original)
+++ trunk/libcgi-session-perl/debian/changelog Wed Jul 16 17:58:16 2008
@@ -1,9 +1,6 @@
-libcgi-session-perl (4.34-1) UNRELEASED; urgency=low
+libcgi-session-perl (4.35-1) UNRELEASED; urgency=low
[ gregor herrmann ]
- PROBLEM: t/load.t fails
- http://rt.cpan.org/Public/Bug/Display.html?id=37659
-
* New upstream release, includes a fix for the "hidden error with
_load_pluggables" problem (closes: #490198).
* Add /me to Uploaders.
Modified: trunk/libcgi-session-perl/lib/CGI/Session.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-session-perl/lib/CGI/Session.pm?rev=23300&op=diff
==============================================================================
--- trunk/libcgi-session-perl/lib/CGI/Session.pm (original)
+++ trunk/libcgi-session-perl/lib/CGI/Session.pm Wed Jul 16 17:58:16 2008
@@ -1,13 +1,13 @@
package CGI::Session;
-# $Id: Session.pm 425 2008-07-13 02:38:51Z markstos $
+# $Id: Session.pm 430 2008-07-16 00:36:15Z markstos $
use strict;
use Carp;
use CGI::Session::ErrorHandler;
@CGI::Session::ISA = qw( CGI::Session::ErrorHandler );
-$CGI::Session::VERSION = '4.34';
+$CGI::Session::VERSION = '4.35';
$CGI::Session::NAME = 'CGISESSID';
$CGI::Session::IP_MATCH = 0;
@@ -56,11 +56,16 @@
#
# Called as a class method as in CGI::Session->new()
#
+
+ # Start fresh with error reporting. Errors in past objects shouldn't affect this one.
+ $class->set_error('');
+
$self = $class->load( @args );
if (not defined $self) {
return $class->set_error( "new(): failed: " . $class->errstr );
}
}
+
my $dataref = $self->{_DATA};
unless ($dataref->{_SESSION_ID}) {
#
@@ -447,7 +452,7 @@
return 1;
}
-# $Id: Session.pm 425 2008-07-13 02:38:51Z markstos $
+# $Id: Session.pm 430 2008-07-16 00:36:15Z markstos $
=pod
@@ -709,7 +714,7 @@
sub load {
my $class = shift;
return $class->set_error( "called as instance method") if ref $class;
- return $class->set_error( "Too many arguments") if @_ > 5;
+ return $class->set_error( "Too many arguments provided to load()") if @_ > 5;
my $self = bless {
_DATA => {
@@ -758,7 +763,7 @@
# Since $update_atime is not part of the public API
# we ignore any value but the one we use internally: 0.
if (defined $update_atime and $update_atime ne '0') {
- return $class->set_error( "Too many arguments");
+ return $class->set_error( "Too many arguments to load(). First extra argument was: $update_atime");
}
if ( defined $dsn ) { # <-- to avoid 'Uninitialized value...' warnings
@@ -774,11 +779,8 @@
$self->_load_pluggables();
- # Did load_pluggable fail? If so, tell our caller.
- if ($class->errstr)
- {
- return $class->errstr;
- }
+ # Did load_pluggable fail? If so, return undef, just like $class->set_error() would
+ return undef if $class->errstr;
if (not defined $self->{_CLAIMED_ID}) {
my $query = $self->query();
Modified: trunk/libcgi-session-perl/t/load.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-session-perl/t/load.t?rev=23300&op=diff
==============================================================================
--- trunk/libcgi-session-perl/t/load.t (original)
+++ trunk/libcgi-session-perl/t/load.t Wed Jul 16 17:58:16 2008
@@ -3,7 +3,7 @@
use strict;
use diagnostics;
-use Test::More qw/no_plan/;
+use Test::More 'no_plan';
# Some driver independent tests for load();
@@ -17,6 +17,7 @@
}
{
my $s = CGI::Session->new();
+ is(CGI::Session->errstr, '', "reality check: no error when calling new()");
$s->load();
like($s->errstr, qr/instance method/, "expected error when load() called as instance method.");
$s->delete();
Modified: trunk/libcgi-session-perl/t/symlink_db_file.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-session-perl/t/symlink_db_file.t?rev=23300&op=diff
==============================================================================
--- trunk/libcgi-session-perl/t/symlink_db_file.t (original)
+++ trunk/libcgi-session-perl/t/symlink_db_file.t Wed Jul 16 17:58:16 2008
@@ -2,7 +2,7 @@
# $Id: $
use strict;
-use diagnostics;
+use Carp;
use Test::More;
use CGI::Session;
@@ -11,8 +11,9 @@
no strict 'refs';
no warnings 'redefine';
*CGI::Session::ErrorHandler::set_error = sub {
- shift;
- die @_;
+ my $class = shift;
+ my $error = shift;
+ croak $error if $error;
};
}
@@ -51,4 +52,4 @@
# tidy it up
undef($_) for $s,$ns;
-unlink($path,$new_path,map "$_.lck",$path,$new_path);
+unlink($path,$new_path,map "$_.lck",$path,$new_path);
Modified: trunk/libcgi-session-perl/t/symlink_file.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-session-perl/t/symlink_file.t?rev=23300&op=diff
==============================================================================
--- trunk/libcgi-session-perl/t/symlink_file.t (original)
+++ trunk/libcgi-session-perl/t/symlink_file.t Wed Jul 16 17:58:16 2008
@@ -2,17 +2,18 @@
# $Id: $
use strict;
-use diagnostics;
use Test::More;
use CGI::Session;
+use Carp;
{
no strict 'refs';
no warnings 'redefine';
*CGI::Session::ErrorHandler::set_error = sub {
- shift;
- die @_;
+ my $class = shift;
+ my $error = shift;
+ croak $error if $error;
};
}
@@ -55,4 +56,4 @@
# tidy up
undef($_) for $s,$ns;
-unlink('t/cgisess_symlink_session','t/cgisess_symlink_session_link');
+unlink('t/cgisess_symlink_session','t/cgisess_symlink_session_link');
More information about the Pkg-perl-cvs-commits
mailing list