From: Ben Hutchings Date: Tue, 4 Nov 2008 02:12:36 +0000 (+0000) Subject: Updated patches for 2.13. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=dd425b2cb6384f804cc1eea9e45660ed6baeb2f1;p=maypole.git Updated patches for 2.13. Updated docs list and rules for renaming of examples. --- diff --git a/debian/changelog b/debian/changelog index eb71d58..156ddac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +maypole (2.13-1) UNRELEASED; urgency=low + + * New upstream release + - Obsoletes patches 101, 102, 104, 107, part of 108, 109 + + -- Ben Hutchings 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 diff --git a/debian/libmaypole-perl.docs b/debian/libmaypole-perl.docs index 574a5d0..071e009 100644 --- a/debian/libmaypole-perl.docs +++ b/debian/libmaypole-perl.docs @@ -1,3 +1,3 @@ AUTHORS -ex +examples README diff --git a/debian/patches/101_fix-extension-mime-type.diff b/debian/patches/101_fix-extension-mime-type.diff deleted file mode 100644 index e8c1022..0000000 --- a/debian/patches/101_fix-extension-mime-type.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- 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; diff --git a/debian/patches/102_fix-apache_mvc-test.diff b/debian/patches/102_fix-apache_mvc-test.diff deleted file mode 100644 index db9a4fa..0000000 --- a/debian/patches/102_fix-apache_mvc-test.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- 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: $@"); - } - } - diff --git a/debian/patches/103_fix-view_object-warning.diff b/debian/patches/103_fix-view_object-warning.diff index 34d1a1d..1f6d105 100644 --- a/debian/patches/103_fix-view_object-warning.diff +++ b/debian/patches/103_fix-view_object-warning.diff @@ -1,6 +1,6 @@ --- 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, @_ ); } diff --git a/debian/patches/104_add-cgi-error-status.diff b/debian/patches/104_add-cgi-error-status.diff deleted file mode 100644 index 7fdef73..0000000 --- a/debian/patches/104_add-cgi-error-status.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- 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 <Maypole application error -+

Maypole application error

-+EOT -+ } -+ return $status; - } - - =head1 Implementation diff --git a/debian/patches/105_dont-use-warn-method.diff b/debian/patches/105_dont-use-warn-method.diff deleted file mode 100644 index 366c488..0000000 --- a/debian/patches/105_dont-use-warn-method.diff +++ /dev/null @@ -1,31 +0,0 @@ ---- 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 .= '
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, diff --git a/debian/patches/106_fix-_column_info-clash.diff b/debian/patches/106_fix-_column_info-clash.diff index 430f254..0b457f8 100644 --- a/debian/patches/106_fix-_column_info-clash.diff +++ b/debian/patches/106_fix-_column_info-clash.diff @@ -1,6 +1,6 @@ ---- 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 { @@ -9,7 +9,7 @@ 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"; @@ -18,25 +18,25 @@ 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" ); @@ -45,7 +45,7 @@ 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"); @@ -54,7 +54,7 @@ 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; diff --git a/debian/patches/107_make-examples-consistent.diff b/debian/patches/107_make-examples-consistent.diff deleted file mode 100644 index 1761627..0000000 --- a/debian/patches/107_make-examples-consistent.diff +++ /dev/null @@ -1,160 +0,0 @@ ---- 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 diff --git a/debian/patches/108_fix-uris.diff b/debian/patches/108_fix-uris.diff index a3ffc60..e3fa3c6 100644 --- a/debian/patches/108_fix-uris.diff +++ b/debian/patches/108_fix-uris.diff @@ -1,22 +1,11 @@ ---- 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 ; - ''; - label | html; - ""; ---- trunk.orig/lib/Maypole/templates/factory/header -+++ trunk/lib/Maypole/templates/factory/header -@@ -10,7 +10,7 @@ - - - -- -+ - - -
+ IF target ; + ''; + ELSE; diff --git a/debian/patches/109_handle-clone.diff b/debian/patches/109_handle-clone.diff deleted file mode 100644 index 70258d5..0000000 --- a/debian/patches/109_handle-clone.diff +++ /dev/null @@ -1,28 +0,0 @@ ---- 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 ) = @_; diff --git a/debian/patches/201_no-file-mmagic-xs.diff b/debian/patches/201_no-file-mmagic-xs.diff index 5383e73..91f3c0e 100644 --- a/debian/patches/201_no-file-mmagic-xs.diff +++ b/debian/patches/201_no-file-mmagic-xs.diff @@ -7,7 +7,7 @@ -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(); @@ -15,7 +15,7 @@ # - 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, diff --git a/debian/patches/202_fix-example-references.diff b/debian/patches/202_fix-example-references.diff index e35ec87..88bdefb 100644 --- a/debian/patches/202_fix-example-references.diff +++ b/debian/patches/202_fix-example-references.diff @@ -1,5 +1,5 @@ ---- 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/) { @@ -22,34 +22,33 @@ 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 ); @@ -70,17 +69,17 @@ 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 or C). -@@ -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 directory in the Maypole +-There's a version of this program in the F directory in the Maypole -files that you downloaded in the F<~root/.cpan/> build area. -This defines the C 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 directory. This defines the ++F directory. This defines the +C application. To set it up as a mod_perl handler: + +=over @@ -105,7 +104,7 @@ To use it as a CGI script, put it in your F directory, together with a small file called F: -@@ -215,10 +227,8 @@ +@@ -214,10 +226,8 @@ And now we need some templates. As we'll see in the chapter on L, there are several types of template. @@ -113,7 +112,7 @@ -the whole lot from the F directory of the Maypole source -package into the F directory under our web root. -Make the C in C agree with your path. -+These are found in the F ++These are found in the F +directory. And that's it. We should now be able to go to C diff --git a/debian/patches/series b/debian/patches/series index 6419a25..dd06d33 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,11 +1,5 @@ -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 diff --git a/debian/rules b/debian/rules index 8352dba..4f80aaa 100755 --- a/debian/rules +++ b/debian/rules @@ -21,14 +21,14 @@ binary-indep : build-stamp 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