r44850 - in /trunk/liborlite-perl: Changes MANIFEST META.yml Makefile.PL README debian/changelog debian/control debian/copyright debian/rules lib/ORLite.pm t/08_prune.pl t/08_prune.t t/lib/Test.pm

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Sep 26 15:15:50 UTC 2009


Author: jawnsy-guest
Date: Sat Sep 26 15:15:33 2009
New Revision: 44850

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=44850
Log:
* New upstream release
  + Adds the prune option, so ORLite will track every file and directory
    it creates and remove them during the END phase
* Standards-Version 3.8.3 (no changes)
* Add myself to Uploaders and Copyright
* Use overrides and AUTOMATED_TESTING instead of RELEASE_TESTING

Added:
    trunk/liborlite-perl/t/08_prune.pl
      - copied unchanged from r44829, branches/upstream/liborlite-perl/current/t/08_prune.pl
    trunk/liborlite-perl/t/08_prune.t
      - copied unchanged from r44829, branches/upstream/liborlite-perl/current/t/08_prune.t
Modified:
    trunk/liborlite-perl/Changes
    trunk/liborlite-perl/MANIFEST
    trunk/liborlite-perl/META.yml
    trunk/liborlite-perl/Makefile.PL
    trunk/liborlite-perl/README
    trunk/liborlite-perl/debian/changelog
    trunk/liborlite-perl/debian/control
    trunk/liborlite-perl/debian/copyright
    trunk/liborlite-perl/debian/rules
    trunk/liborlite-perl/lib/ORLite.pm
    trunk/liborlite-perl/t/lib/Test.pm

Modified: trunk/liborlite-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/Changes?rev=44850&op=diff
==============================================================================
--- trunk/liborlite-perl/Changes (original)
+++ trunk/liborlite-perl/Changes Sat Sep 26 15:15:33 2009
@@ -1,4 +1,18 @@
 Changes for Perl extension ORLite
+
+1.28 Fri 25 Sep 2009
+	- Adding ->prune method that so that pruning can also be done
+	  in subclasses.
+	- Apply rel2abs to pruned directories so they still get deleted
+	  even when our current directory moves.
+
+1.27 Fri 25 Sep 2009
+	- Adding test script for the prune feature
+
+1.26_01 Fri 25 Sep 2009
+	- Adding the prune option to have ORLite to track every file and
+	  directory it creates and remove them during END phase.
+	  (This should be especially handy in test scripts)
 
 1.25 Sat 15 Aug 2009
 	- Adding base and table metadata methods to each class to support

Modified: trunk/liborlite-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/MANIFEST?rev=44850&op=diff
==============================================================================
--- trunk/liborlite-perl/MANIFEST (original)
+++ trunk/liborlite-perl/MANIFEST Sat Sep 26 15:15:33 2009
@@ -25,6 +25,8 @@
 t/06_create.t
 t/07_pk.sql
 t/07_pk.t
+t/08_prune.pl
+t/08_prune.t
 t/97_meta.t
 t/98_pod.t
 t/99_pmv.t

Modified: trunk/liborlite-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/META.yml?rev=44850&op=diff
==============================================================================
--- trunk/liborlite-perl/META.yml (original)
+++ trunk/liborlite-perl/META.yml Sat Sep 26 15:15:33 2009
@@ -5,6 +5,7 @@
 build_requires:
   ExtUtils::MakeMaker: 6.42
   Test::More: 0.47
+  Test::Script: 1.06
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
@@ -24,6 +25,7 @@
   DBI: 1.607
   File::Basename: 0
   File::Path: 2.04
+  File::Remove: 1.40
   File::Spec: 0.80
   File::Temp: 0.20
   Params::Util: 0.33
@@ -32,4 +34,4 @@
   ChangeLog: http://fisheye2.atlassian.com/changelog/cpan/trunk/ORLite
   license: http://dev.perl.org/licenses/
   repository: http://svn.ali.as/cpan/trunk/ORLite
-version: 1.25
+version: 1.28

Modified: trunk/liborlite-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/Makefile.PL?rev=44850&op=diff
==============================================================================
--- trunk/liborlite-perl/Makefile.PL (original)
+++ trunk/liborlite-perl/Makefile.PL Sat Sep 26 15:15:33 2009
@@ -2,5 +2,7 @@
 
 all_from      lib/ORLite.pm
 requires_from lib/ORLite.pm
-requires      File::Spec 3.2701 if winlike
-test_requires Test::More 0.47
+requires      File::Spec   3.2701 if winlike
+requires      File::Remove 1.40
+test_requires Test::More   0.47
+test_requires Test::Script 1.06

Modified: trunk/liborlite-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/README?rev=44850&op=diff
==============================================================================
--- trunk/liborlite-perl/README (original)
+++ trunk/liborlite-perl/README Sat Sep 26 15:15:33 2009
@@ -3,13 +3,33 @@
 
 SYNOPSIS
       package Foo;
-
-      use strict;
+      
+  # Simplest possible usage
+      
+  use strict;
       use ORLite 'data/sqlite.db';
-
-      my @awesome = Foo::Person->select(
+      
+  my @awesome = Foo::Person->select(
          'where first_name = ?',
          'Adam',
+      );
+      
+  package Bar;
+      
+  # All available options enabled
+      # Some options shown are mutually exclusive, this would not actually run
+      
+  use ORLite {
+          package      => 'My::ORM',
+          file         => 'data/sqlite.db',
+          user_version => 12,
+          tables       => [ 'table1', 'table2' ],
+          readonly     => 1,
+          prune        => 1,
+          create       => sub {
+              my $dbh = shift;
+              $dbh->do('CREATE TABLE foo ( bar TEXT NOT NULL )');
+          },
       );
 
 DESCRIPTION

Modified: trunk/liborlite-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/debian/changelog?rev=44850&op=diff
==============================================================================
--- trunk/liborlite-perl/debian/changelog (original)
+++ trunk/liborlite-perl/debian/changelog Sat Sep 26 15:15:33 2009
@@ -1,3 +1,14 @@
+liborlite-perl (1.28-1) UNRELEASED; urgency=low
+
+  * New upstream release
+    + Adds the prune option, so ORLite will track every file and directory
+      it creates and remove them during the END phase
+  * Standards-Version 3.8.3 (no changes)
+  * Add myself to Uploaders and Copyright
+  * Use overrides and AUTOMATED_TESTING instead of RELEASE_TESTING
+
+ -- Jonathan Yu <jawnsy at cpan.org>  Fri, 25 Sep 2009 12:14:25 -0400
+
 liborlite-perl (1.25-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/liborlite-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/debian/control?rev=44850&op=diff
==============================================================================
--- trunk/liborlite-perl/debian/control (original)
+++ trunk/liborlite-perl/debian/control Sat Sep 26 15:15:33 2009
@@ -1,16 +1,17 @@
 Source: liborlite-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 7)
+Build-Depends: debhelper (>= 7.0.50)
 Build-Depends-Indep: libdbd-sqlite3-perl (>= 1.25), libdbi-perl (>= 1.607),
- libfile-temp-perl (>= 0.20), libparams-util-perl (>= 0.33),
+ libfile-temp-perl, libparams-util-perl (>= 0.33),
  libpod-simple-perl (>= 3.07), libtest-cpan-meta-perl,
  libtest-minimumversion-perl, libtest-pod-perl, perl (>= 5.10.0)
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Damyan Ivanov <dmn at debian.org>, Gunnar Wolf <gwolf at debian.org>,
  Brian Cassidy <brian.cassidy at gmail.com>, Rene Mayorga <rmayorga at debian.org>,
- Jaldhar H. Vyas <jaldhar at debian.org>, Nathan Handler <nhandler at ubuntu.com>
-Standards-Version: 3.8.2
+ Jaldhar H. Vyas <jaldhar at debian.org>, Nathan Handler <nhandler at ubuntu.com>,
+ Jonathan Yu <jawnsy at cpan.org>
+Standards-Version: 3.8.3
 Homepage: http://search.cpan.org/dist/ORLite/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/liborlite-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/liborlite-perl/
@@ -18,12 +19,12 @@
 Package: liborlite-perl
 Architecture: all
 Depends: ${misc:Depends}, ${perl:Depends}, libdbd-sqlite3-perl (>= 1.25),
- libdbi-perl (>= 1.607), libfile-temp-perl (>= 0.20),
+ libdbi-perl (>= 1.607), libfile-temp-perl,
  libparams-util-perl (>= 0.33), perl (>= 5.10.0)
 Description: lightweight SQLite-specific ORM
- ORLite is an object-relation system specifically for SQLite that
- follows many of the same principles as the ::Tiny series of modules and
- has a design that aligns directly to the capabilities of SQLite.
+ ORLite is an object-relation system specifically for SQLite that follows many
+ of the same principles as the ::Tiny series of modules and has a design that
+ aligns directly to the capabilities of SQLite.
  .
- ORLite discovers the schema of a SQLite database, and then uses code
- generation to build a set of packages for talking to that database.
+ ORLite discovers the schema of a SQLite database, and then deploys a set of
+ packages for talking to that database.

Modified: trunk/liborlite-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/debian/copyright?rev=44850&op=diff
==============================================================================
--- trunk/liborlite-perl/debian/copyright (original)
+++ trunk/liborlite-perl/debian/copyright Sat Sep 26 15:15:33 2009
@@ -5,21 +5,25 @@
 Upstream-Name: ORLite
 
 Files: *
-Copyright: 2008-2009 Adam Kennedy <adamk at cpan.org>
+Copyright: 2008-2009, Adam Kennedy <adamk at cpan.org>
 License-Alias: Perl
 License: Artistic | GPL-1+
 
-Files: inc/*
-Copyright: © 2002-2009, Brian Ingerson, Audrey Tang and Adam Kennedy.
-License: GPL-1+ | Artistic
-
 Files: debian/*
-Copyright: 2008, 2009, Brian Cassidy <brian.cassidy at gmail.com>
- 2008, Damyan Ivanov <dmn at debian.org>
- 2008, Gunnar Wolf <gwolf at debian.org>
+Copyright: 2009, Jonathan Yu <jawnsy at cpan.org>
  2009, Jaldhar H. Vyas <jaldhar at debian.org>
  2009, Nathan Handler <nhandler at ubuntu.com>
  2009, Rene Mayorga <rmayorga at debian.org>
+ 2008-2009, Brian Cassidy <brian.cassidy at gmail.com>
+ 2008, Damyan Ivanov <dmn at debian.org>
+ 2008, Gunnar Wolf <gwolf at debian.org>
+License: Artistic | GPL-1+
+
+Files: inc/Module/*
+Copyright: 2002-2009, Adam Kennedy <adamk at cpan.org>
+ 2002-2009, Audrey Tang <autrijus at autrijus.org>
+ 2002-2009, Brian Ingerson <ingy at cpan.org>
+License-Alias: Perl
 License: Artistic | GPL-1+
 
 License: Artistic

Modified: trunk/liborlite-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/debian/rules?rev=44850&op=diff
==============================================================================
--- trunk/liborlite-perl/debian/rules (original)
+++ trunk/liborlite-perl/debian/rules Sat Sep 26 15:15:33 2009
@@ -1,4 +1,7 @@
 #!/usr/bin/make -f
 
 %:
-	RELEASE_TESTING=1 dh $@
+	dh $@
+
+override_dh_auto_test:
+	AUTOMATED_TESTING=1 dh_auto_test

Modified: trunk/liborlite-perl/lib/ORLite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/lib/ORLite.pm?rev=44850&op=diff
==============================================================================
--- trunk/liborlite-perl/lib/ORLite.pm (original)
+++ trunk/liborlite-perl/lib/ORLite.pm Sat Sep 26 15:15:33 2009
@@ -9,13 +9,23 @@
 use File::Temp   0.20 ();
 use File::Path   2.04 ();
 use File::Basename  0 ();
-use Params::Util 0.33 qw{ _STRING _CLASS _HASHLIKE _CODELIKE };
+use Params::Util 0.33 ();
 use DBI         1.607 ();
 use DBD::SQLite  1.25 ();
 
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.25';
+	$VERSION = '1.28';
+}
+
+# Support for the 'prune' option
+my @PRUNE = ();
+END {
+	foreach ( @PRUNE ) {
+		next unless -e $_;
+		require File::Remove;
+		File::Remove::remove($_);
+	}
 }
 
 
@@ -30,14 +40,14 @@
 
 	# Check for debug mode
 	my $DEBUG = 0;
-	if ( defined _STRING($_[-1]) and $_[-1] eq '-DEBUG' ) {
+	if ( defined Params::Util::_STRING($_[-1]) and $_[-1] eq '-DEBUG' ) {
 		$DEBUG = 1;
 		pop @_;
 	}
 
 	# Check params and apply defaults
 	my %params;
-	if ( defined _STRING($_[1]) ) {
+	if ( defined Params::Util::_STRING($_[1]) ) {
 		# Support the short form "use ORLite 'db.sqlite'"
 		%params = (
 			file     => $_[1],
@@ -45,7 +55,7 @@
 			package  => undef, # Automatic
 			tables   => 1,
 		);
-	} elsif ( _HASHLIKE($_[1]) ) {
+	} elsif ( Params::Util::_HASHLIKE($_[1]) ) {
 		%params = %{ $_[1] };
 	} else {
 		Carp::croak("Missing, empty or invalid params HASH");
@@ -54,7 +64,7 @@
 		$params{create} = 0;
 	}
 	unless (
-		defined _STRING($params{file})
+		defined Params::Util::_STRING($params{file})
 		and (
 			$params{create}
 			or
@@ -72,7 +82,7 @@
 	unless ( defined $params{package} ) {
 		$params{package} = scalar caller;
 	}
-	unless ( _CLASS($params{package}) ) {
+	unless ( Params::Util::_CLASS($params{package}) ) {
 		Carp::croak("Missing or invalid package class");
 	}
 
@@ -83,8 +93,10 @@
 		# Create the parent directory
 		my $dir = File::Basename::dirname($file);
 		unless ( -d $dir ) {
-			File::Path::mkpath( $dir, { verbose => 0 } );
+			my @dirs = File::Path::mkpath( $dir, { verbose => 0 } );
+			$class->prune(@dirs) if $params{prune};
 		}
+		$class->prune($file) if $params{prune};
 	}
 	my $pkg      = $params{package};
 	my $readonly = $params{readonly};
@@ -92,7 +104,7 @@
 	my $dbh      = DBI->connect($dsn);
 
 	# Schema creation support
-	if ( $created and _CODELIKE($params{create}) ) {
+	if ( $created and Params::Util::_CODELIKE($params{create}) ) {
 		$params{create}->( $dbh );
 	}
 
@@ -435,11 +447,16 @@
 	} grep {
 		/^(?:package|sub)\b/
 	} split /\n/, $_[0];
-	print STDERR @trace, "\nCode saved as $filename\n\n";
+	# print STDERR @trace, "\nCode saved as $filename\n\n";
 
 	return 1;
 }
 
+sub prune {
+	my $class = shift;
+	push @PRUNE, map { File::Spec->rel2abs($_) } @_;
+}
+
 1;
 
 __END__
@@ -453,14 +470,34 @@
 =head1 SYNOPSIS
 
   package Foo;
-
+  
+  # Simplest possible usage
+  
   use strict;
   use ORLite 'data/sqlite.db';
-
+  
   my @awesome = Foo::Person->select(
      'where first_name = ?',
      'Adam',
   );
+  
+  package Bar;
+  
+  # All available options enabled
+  # Some options shown are mutually exclusive, this would not actually run
+  
+  use ORLite {
+      package      => 'My::ORM',
+      file         => 'data/sqlite.db',
+      user_version => 12,
+      tables       => [ 'table1', 'table2' ],
+      readonly     => 1,
+      prune        => 1,
+      create       => sub {
+          my $dbh = shift;
+          $dbh->do('CREATE TABLE foo ( bar TEXT NOT NULL )');
+      },
+  );
 
 =head1 DESCRIPTION
 

Modified: trunk/liborlite-perl/t/lib/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/t/lib/Test.pm?rev=44850&op=diff
==============================================================================
--- trunk/liborlite-perl/t/lib/Test.pm (original)
+++ trunk/liborlite-perl/t/lib/Test.pm Sat Sep 26 15:15:33 2009
@@ -8,7 +8,7 @@
 
 use vars qw{$VERSION @ISA @EXPORT};
 BEGIN {
-	$VERSION = '1.25';
+	$VERSION = '1.28';
 	@ISA     = 'Exporter';
 	@EXPORT  = qw{ test_db connect_ok create_ok };
 }




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