Updated docs list and rules for renaming of examples.
+maypole (2.13-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ - Obsoletes patches 101, 102, 104, 107, part of 108, 109
+
+ -- Ben Hutchings <ben@decadent.org.uk> Sun, 15 Jun 2008 14:09:24 +0100
+
maypole (2.11+2.111-2) unstable; urgency=low
* Added clone handling to improve compatibility with Apache's
AUTHORS
-ex
+examples
README
+++ /dev/null
---- maypole.orig/lib/Maypole.pm
-+++ maypole/lib/Maypole.pm
-@@ -617,7 +617,7 @@
- sub __get_mime_type {
- my $self = shift;
- my $type = 'text/html';
-- if ($self->path =~ m/.*\.(\w{3,4})$/) {
-+ if ($self->path =~ m/.*\.(\w{2,4})$/) {
- $type = $filetypes{$1};
- } else {
- my $output = $self->output;
+++ /dev/null
---- maypole.orig/t/apache_mvc.t
-+++ maypole/t/apache_mvc.t
-@@ -2,10 +2,13 @@
- use strict;
- use Test::More;
- BEGIN {
-- if (eval { require Apache::Request }) {
-+ if (eval { require Apache2::RequestRec }) {
-+ $ENV{MOD_PERL_API_VERSION} = 2;
-+ plan tests => 3;
-+ } elsif (eval { require Apache::Request }) {
- plan tests => 3;
- } else {
-- Test::More->import(skip_all =>"Apache::Request is not installed: $@");
-+ Test::More->import(skip_all =>"Neither Apache2::RequestRec nor Apache::Request is installed: $@");
- }
- }
-
--- maypole.orig/lib/Maypole.pm
+++ maypole/lib/Maypole.pm
-@@ -495,13 +495,6 @@
+@@ -496,13 +496,6 @@
return $self->NEXT::DISTINCT::get_template_root( $r, @_ );
}
+++ /dev/null
---- maypole.orig/lib/CGI/Maypole.pm
-+++ maypole/lib/CGI/Maypole.pm
-@@ -57,7 +57,17 @@
- sub run
- {
- my $self = shift;
-- return $self->handler;
-+ my $status = $self->handler;
-+ if ($status != OK) {
-+ print <<EOT;
-+Status: 500 Maypole application error
-+Content-Type: text/html
-+
-+<title>Maypole application error</h1>
-+<h1>Maypole application error</h1>
-+EOT
-+ }
-+ return $status;
- }
-
- =head1 Implementation
+++ /dev/null
---- maypole.orig/lib/Maypole/View/TT.pm
-+++ maypole/lib/Maypole/View/TT.pm
-@@ -43,11 +43,11 @@
- } else {
- if ($@) {
- my $error = "fatal error in template '$template_file' : $@\nTT paths : " . join(', ',$self->paths($r)) . "\n";
-- $r->warn($error);
-+ warn $error;
- $r->{error} = $error;
- } else {
- my $error = "TT error for template '$template_file'\n" . $self->{tt}->error . "\nTT paths : " . join(', ',$self->paths($r)) . "\n";
-- $r->warn($error);
-+ warn $error;
- $r->{error} = $error;
- }
- return ERROR;
-@@ -62,12 +62,12 @@
- # Need to be very careful here.
- my $tt = Template->new;
- unless (ref $r->{config}) {
-- $r->warn("no config for this request");
-+ warn "no config for this request";
- $error .= '<br> There was a problem finding configuration for this request';
- $r->{config} ||= {};
- }
-
-- $r->warn("report_error - reporting error to user : $error\n");
-+ warn "report_error - reporting error to user : $error\n";
-
- if ($tt->process(\$error_template,
- { err_type => $type, error => $error,
---- maypole.orig/lib/Maypole/Model/CDBI.pm
-+++ maypole/lib/Maypole/Model/CDBI.pm
-@@ -503,7 +503,7 @@
+--- maypole.orig/lib/Maypole/Model/CDBI/Base.pm
++++ maypole/lib/Maypole/Model/CDBI/Base.pm
+@@ -460,7 +460,7 @@
# Thanks to dave baird -- form builder for these private functions
# sub _column_info {
my $self = shift;
my $dbh = $self->db_Main;
-@@ -615,7 +615,7 @@
+@@ -572,7 +572,7 @@
sub column_type {
my $class = shift;
my $colname = shift or die "Need a column for column_type";
if ($class->_isa_class($colname)) {
return $class->_isa_class($colname)->column_type($colname);
-@@ -646,7 +646,7 @@
+@@ -609,7 +609,7 @@
sub required_columns {
my ($class, $columns) = @_;
-- $class->_column_info() unless ref $class->COLUMN_INFO;
-+ $class->_init_column_info() unless ref $class->COLUMN_INFO;
+- $class->_column_info() unless (ref $class->COLUMN_INFO);
++ $class->_init_column_info() unless (ref $class->COLUMN_INFO);
my $column_info = $class->COLUMN_INFO;
if ($columns) {
-@@ -683,7 +683,7 @@
+@@ -660,7 +660,7 @@
sub column_required {
my ($class, $colname) = @_;
- $colname or $class->_croak( "Need a column for column_nullable" );
+ $colname or $class->_croak( "Need a column for column_required" );
- $class->_column_info() unless ref $class->COLUMN_INFO;
+ $class->_init_column_info() unless ref $class->COLUMN_INFO;
if ($class->_isa_class($colname)) {
return $class->_isa_class($colname)->column_required($colname);
}
-@@ -714,7 +714,7 @@
+@@ -692,7 +692,7 @@
my $class = shift;
my $colname = shift or $class->_croak( "Need a column for column_nullable" );
if ($class->_isa_class($colname)) {
return $class->_isa_class($colname)->column_nullable($colname);
}
-@@ -737,7 +737,7 @@
+@@ -716,7 +716,7 @@
sub column_default {
my $class = shift;
my $colname = shift or $class->_croak( "Need a column for column_default");
if ($class->_isa_class($colname)) {
return $class->_isa_class($colname)->column_default($colname);
}
-@@ -770,7 +770,7 @@
+@@ -750,7 +750,7 @@
$res{moniker} = $class->moniker;
$res{plural} = $class->plural_moniker;
$res{table} = $class->table;
+++ /dev/null
---- trunk.orig/ex/fancy_example/BeerDB.pm
-+++ trunk/ex/fancy_example/BeerDB.pm
-@@ -6,11 +6,23 @@
- # This is the sample application. Change this to the path to your
- # database. (or use mysql or something)
- use constant DBI_DRIVER => 'SQLite';
--use constant DATASOURCE => '/home/peter/Desktop/maypolebeer/beerdb';
-+use constant DATASOURCE => $ENV{BEERDB_DATASOURCE} || 't/beerdb.db';
-
- BeerDB->config->model('BeerDB::Base');
-
--BeerDB->setup("dbi:mysql:beerdb",'root', '');
-+BEGIN {
-+ my $dbi_driver = DBI_DRIVER;
-+ if ($dbi_driver =~ /^SQLite/) {
-+ die sprintf "SQLite datasource '%s' not found, correct the path or "
-+ . "recreate the database by running Makefile.PL", DATASOURCE
-+ unless -e DATASOURCE;
-+ eval "require DBD::SQLite";
-+ if ($@) {
-+ eval "require DBD::SQLite2" and $dbi_driver = 'SQLite2';
-+ }
-+ }
-+ BeerDB->setup(join ':', "dbi", $dbi_driver, DATASOURCE);
-+}
-
- # Give it a name.
- BeerDB->config->application_name('The Beer Database');
-@@ -20,7 +32,7 @@
-
- # Change this to the htdoc root for your maypole application.
-
--my @root= ('/home/peter/Desktop/maypolebeer/templates');
-+my @root= ('t/templates');
- push @root,$ENV{BEERDB_TEMPLATE_ROOT} if ($ENV{BEERDB_TEMPLATE_ROOT});
- BeerDB->config->template_root( [@root] );
- # Specify the rows per page in search results, lists, etc : 10 is a nice round number
-@@ -37,7 +49,7 @@
- BeerDB::Brewery->untaint_columns( printable => [qw/name notes url/] );
- BeerDB::Style->untaint_columns( printable => [qw/name notes/] );
- BeerDB::Beer->untaint_columns(
-- printable => [qw/abv name price notes/],
-+ printable => [qw/abv name price notes url/],
- integer => [qw/style brewery score/],
- date =>[ qw/tasted/],
- );
-@@ -47,7 +59,7 @@
-
-
- # Required Fields
--BeerDB->config->{brewery}{required_cols} = [qw/name url/];
-+BeerDB->config->{brewery}{required_cols} = [qw/name/];
- BeerDB->config->{style}{required_cols} = [qw/name/];
- BeerDB->config->{beer}{required_cols} = [qw/brewery name price/];
- BeerDB->config->{pub}{required_cols} = [qw/name/];
-@@ -67,7 +79,7 @@
-
- # For testing classmetadata
- #sub BeerDB::Beer::classdata :Exported {};
--sub BeerDB::Beer::list_columns { return qw/score name price style brewery/};
-+sub BeerDB::Beer::list_columns { return qw/score name price style brewery url/};
-
- sub BeerDB::Handpump::stringify_self {
- my $self = shift;
---- trunk.orig/ex/fancy_example/beerdb.sql
-+++ trunk/ex/fancy_example/beerdb.sql
-@@ -1,27 +1,28 @@
- CREATE TABLE style (
-- id integer primary key auto_increment,
-+ id integer not null primary key auto_increment,
- name varchar(60),
- notes text
- );
-
- CREATE TABLE pub (
-- id integer primary key auto_increment,
-+ id integer not null primary key auto_increment,
- name varchar(60),
- url varchar(120),
- notes text
- );
-
- CREATE TABLE handpump (
-- id integer primary key auto_increment,
-+ id integer not null primary key auto_increment,
- beer integer,
- pub integer
- );
-
- CREATE TABLE beer (
-- id integer primary key auto_increment,
-+ id integer not null primary key auto_increment,
- brewery integer,
- style integer,
- name varchar(30),
-+ url varchar(120),
- score integer(2),
- price varchar(12),
- abv varchar(10),
-@@ -30,7 +31,7 @@
- );
-
- CREATE TABLE brewery (
-- id integer primary key auto_increment,
-+ id integer not null primary key auto_increment,
- name varchar(30),
- url varchar(50),
- notes text
---- trunk.orig/lib/Maypole/Manual/About.pod
-+++ trunk/lib/Maypole/Manual/About.pod
-@@ -119,7 +119,8 @@
- score integer(2),
- price varchar(12),
- abv varchar(10),
-- notes text
-+ notes text,
-+ tasted date
- );
-
- create table handpump (
---- trunk.orig/ex/beerdb.sql
-+++ trunk/ex/beerdb.sql
-@@ -1,24 +1,24 @@
- CREATE TABLE style (
-- id integer primary key auto_increment,
-+ id integer not null primary key auto_increment,
- name varchar(60),
- notes text
- );
-
- CREATE TABLE pub (
-- id integer primary key auto_increment,
-+ id integer not null primary key auto_increment,
- name varchar(60),
- url varchar(120),
- notes text
- );
-
- CREATE TABLE handpump (
-- id integer primary key auto_increment,
-+ id integer not null primary key auto_increment,
- beer integer,
- pub integer
- );
-
- CREATE TABLE beer (
-- id integer primary key auto_increment,
-+ id integer not null primary key auto_increment,
- brewery integer,
- style integer,
- name varchar(30),
-@@ -31,7 +31,7 @@
- );
-
- CREATE TABLE brewery (
-- id integer primary key auto_increment,
-+ id integer not null primary key auto_increment,
- name varchar(30),
- url varchar(50),
- notes text
---- trunk.orig/lib/Maypole/templates/factory/macros
-+++ trunk/lib/Maypole/templates/factory/macros
-@@ -14,7 +14,7 @@
+--- maypole.orig/lib/Maypole/templates/factory/macros
++++ maypole/lib/Maypole/templates/factory/macros
+@@ -18,7 +18,7 @@
[%
- MACRO link(table, command, additional, label) BLOCK;
+ MACRO link(table, command, additional, label, target) BLOCK;
SET lnk = base _ "/" _ table _ "/" _ command _ "/" _ additional;
- lnk = lnk | uri ;
+ lnk = lnk | html ;
- '<a href="' _ lnk _ '">';
- label | html;
- "</a>";
---- trunk.orig/lib/Maypole/templates/factory/header
-+++ trunk/lib/Maypole/templates/factory/header
-@@ -10,7 +10,7 @@
- </title>
- <meta http-equiv="Content-Type" content="text/html; charset=[% request.document_encoding %]" />
- <base href="[% config.uri_base%]"/>
-- <link title="Maypole" href="[% config.uri_base %]/maypole.css" type="text/css" rel="stylesheet" />
-+ <link title="Maypole" href="[% base %]/maypole.css" type="text/css" rel="stylesheet" />
- </head>
- <body>
- <div class="content">
+ IF target ;
+ '<a href="' _ lnk _ '" target="' _ target _'">';
+ ELSE;
+++ /dev/null
---- trunk.orig/lib/Maypole/Model/Base.pm
-+++ trunk/lib/Maypole/Model/Base.pm
-@@ -12,14 +12,23 @@
- shift; # class name not used
- my ($coderef, @attrs) = @_;
-
-- $remember{$coderef} = \@attrs;
-+ $remember{$coderef} = [$coderef, \@attrs];
-
- # previous version took care to return an empty array, not sure why,
- # but shall cargo cult it until know better
- return;
- }
-
--sub FETCH_CODE_ATTRIBUTES { @{ $remember{$_[1]} || [] } }
-+sub FETCH_CODE_ATTRIBUTES { @{ $remember{$_[1]}->[1] || [] } }
-+
-+sub CLONE {
-+ # re-hash %remember
-+ for my $key (keys %remember) {
-+ my $value = delete $remember{$key};
-+ $key = $value->[0];
-+ $remember{$key} = $value;
-+ }
-+}
-
- sub process {
- my ( $class, $r ) = @_;
-use File::MMagic::XS qw(:compat);
+use File::MMagic;
- our $VERSION = '2.111';
+ our $VERSION = '2.13';
-our $mmagic = File::MMagic::XS->new();
+our $mmagic = File::MMagic->new();
# - no leading underscore - public to custom application code and plugins
--- maypole.orig/Makefile.PL
+++ maypole/Makefile.PL
-@@ -29,7 +29,7 @@
+@@ -26,7 +26,7 @@
Template::Plugin::Class => 0,
Test::MockModule => 0,
Digest::MD5 => 0,
---- trunk.orig/ex/BeerDB.pm
-+++ trunk/ex/BeerDB.pm
+--- maypole.orig/examples/BeerDB.pm
++++ maypole/examples/BeerDB.pm
@@ -13,7 +13,7 @@
my $dbi_driver = DBI_DRIVER;
if ($dbi_driver =~ /^SQLite/) {
BeerDB->config->template_root( [@root] );
# Specify the rows per page in search results, lists, etc : 10 is a nice round number
BeerDB->config->rows_per_page(10);
---- trunk.orig/ex/fancy_example/BeerDB.pm
-+++ trunk/ex/fancy_example/BeerDB.pm
+--- maypole.orig/examples/fancy_example/BeerDB.pm
++++ maypole/examples/fancy_example/BeerDB.pm
@@ -14,7 +14,7 @@
my $dbi_driver = DBI_DRIVER;
if ($dbi_driver =~ /^SQLite/) {
- die sprintf "SQLite datasource '%s' not found, correct the path or "
-- . "recreate the database by running Makefile.PL", DATASOURCE
-+ . "recreate the database using beerdb.sql", DATASOURCE
- unless -e DATASOURCE;
- eval "require DBD::SQLite";
+ unless -e (DATASOURCE) {
+- die sprintf("SQLite datasource '%s' not found, correct the path or recreate the database by running Makefile.PL", DATASOURCE), "\n";
++ die sprintf("SQLite datasource '%s' not found, correct the path or recreate the database using beerdb.sql", DATASOURCE), "\n";
+ }
+ eval "require DBD::SQLite";
if ($@) {
-@@ -32,8 +32,11 @@
+@@ -31,8 +31,11 @@
+ BeerDB->config->uri_base( $ENV{BEERDB_BASE} || "http://localhost/beerdb/" );
# Change this to the htdoc root for your maypole application.
-
--my @root= ('t/templates');
--push @root,$ENV{BEERDB_TEMPLATE_ROOT} if ($ENV{BEERDB_TEMPLATE_ROOT});
+-my @root= ('t/templates');
+my @root;
+push @root, 't/templates' if (-d 't/templates');
-+push @root, $ENV{BEERDB_TEMPLATE_ROOT} if ($ENV{BEERDB_TEMPLATE_ROOT});
-+push @root, '/usr/share/doc/libmaypole-perl/ex/fancy_example/templates'
+ push @root,$ENV{BEERDB_TEMPLATE_ROOT} if ($ENV{BEERDB_TEMPLATE_ROOT});
++push @root, '/usr/share/doc/libmaypole-perl/examples/fancy_example/templates'
+ unless @root;
BeerDB->config->template_root( [@root] );
# Specify the rows per page in search results, lists, etc : 10 is a nice round number
BeerDB->config->rows_per_page(10);
---- trunk.orig/lib/Maypole/Manual/About.pod
-+++ trunk/lib/Maypole/Manual/About.pod
-@@ -142,15 +142,15 @@
+--- maypole.orig/lib/Maypole/Manual/About.pod
++++ maypole/lib/Maypole/Manual/About.pod
+@@ -141,15 +141,15 @@
notes text
);
by hand, don't forget to grant permissions for your Apache server to
access it as well as yourself (typically a user name like C<www-data>
or C<wwwrun>).
-@@ -189,17 +189,29 @@
+@@ -188,17 +188,29 @@
"a pub has beers on handpumps");
1;
--There's a version of this program in the F<ex/> directory in the Maypole
+-There's a version of this program in the F<examples/> directory in the Maypole
-files that you downloaded in the F<~root/.cpan/> build area.
-This defines the C<BeerDB> application.
-To set it up as a mod_perl handler, just tell the Apache configuration
-about it:
+There's a version of this program in the
-+F</usr/share/doc/libmaypole-perl/ex/> directory. This defines the
++F</usr/share/doc/libmaypole-perl/examples/> directory. This defines the
+C<BeerDB> application. To set it up as a mod_perl handler:
+
+=over
To use it as a CGI script, put it in your F<cgi-bin> directory,
together with a small file called F<beer.cgi>:
-@@ -215,10 +227,8 @@
+@@ -214,10 +226,8 @@
And now we need some templates. As we'll see in the chapter on
L<views|Maypole::Manual::View>, there are several types of template.
-the whole lot from the F<templates/> directory of the Maypole source
-package into the F</beerdb> directory under our web root.
-Make the C<template_root> in C<BeerDB> agree with your path.
-+These are found in the F</usr/share/doc/libmaypole-perl/ex/templates/>
++These are found in the F</usr/share/doc/libmaypole-perl/examples/templates/>
+directory.
And that's it. We should now be able to go to C<http://localhost/beerdb/>
-101_fix-extension-mime-type.diff
-102_fix-apache_mvc-test.diff
103_fix-view_object-warning.diff
-104_add-cgi-error-status.diff
-105_dont-use-warn-method.diff
106_fix-_column_info-clash.diff
-107_make-examples-consistent.diff
108_fix-uris.diff
-109_handle-clone.diff
201_no-file-mmagic-xs.diff
202_fix-example-references.diff
dh_installdocs
mv debian/libmaypole-perl/usr/share/perl5/Maypole/templates \
debian/libmaypole-perl/usr/share/doc/libmaypole-perl/templates
- mkdir debian/libmaypole-perl/usr/share/doc/libmaypole-perl/ex/templates
+ mkdir debian/libmaypole-perl/usr/share/doc/libmaypole-perl/examples/templates
mv debian/libmaypole-perl/usr/share/doc/libmaypole-perl/templates/beer \
- debian/libmaypole-perl/usr/share/doc/libmaypole-perl/ex/templates/custom
+ debian/libmaypole-perl/usr/share/doc/libmaypole-perl/examples/templates/custom
ln -s ../../templates/factory \
- debian/libmaypole-perl/usr/share/doc/libmaypole-perl/ex/templates/factory
+ debian/libmaypole-perl/usr/share/doc/libmaypole-perl/examples/templates/factory
ln -s ../../../templates/factory \
- debian/libmaypole-perl/usr/share/doc/libmaypole-perl/ex/fancy_example/templates/factory
- dh_compress -X/ex/ -X/templates/
+ debian/libmaypole-perl/usr/share/doc/libmaypole-perl/examples/fancy_example/templates/factory
+ dh_compress -X/examples/ -X/templates/
dh_fixperms
dh_gencontrol
dh_md5sums