[Cpan-forum-commit] rev 154 - in branches/db_changes: . lib/CPAN lib/CPAN/Forum t
svn at pti.co.il
svn at pti.co.il
Sun Aug 20 08:16:24 IDT 2006
Author: gabor
Date: 2006-08-20 08:16:24 +0300 (Sun, 20 Aug 2006)
New Revision: 154
Modified:
branches/db_changes/Build.PL
branches/db_changes/MANIFEST
branches/db_changes/lib/CPAN/Forum.pm
branches/db_changes/lib/CPAN/Forum/Build.pm
branches/db_changes/t/00.load.t
Log:
Removed the use of CPAN::Forum::Build
Start replacing tabs by spaces
slight test cleanup
Modified: branches/db_changes/Build.PL
===================================================================
--- branches/db_changes/Build.PL 2006-03-22 08:05:11 UTC (rev 153)
+++ branches/db_changes/Build.PL 2006-08-20 05:16:24 UTC (rev 154)
@@ -4,45 +4,47 @@
use lib "lib";
use FindBin qw($Bin);
-use CPAN::Forum::Build;
+#use CPAN::Forum::Build;
+use Module::Build;
-my $builder = CPAN::Forum::Build->new(
- module_name => 'CPAN::Forum',
- license => 'perl',
- dist_version_from => 'lib/CPAN/Forum.pm',
- create_readme => 1,
- create_makefile_pl => 'traditional',
- requires => {
- 'HTML::Template' => 2.6,
- 'CGI' => 0,
- 'CGI::Application' => 3.31,
- 'CGI::Application::Plugin::Session' => 0,
- 'CGI::Application::Plugin::LogDispatch' => 0,
-
- 'Test::More' => 0.47,
-# 'Test::Warn' => 0,
-# 'HTML::Lint' => 1.26,
-# 'Test::HTML::Lint' => 1.26,
- 'WWW::Mechanize' => 0,
-# 'Storable' => 0,
- 'DBI' => 0,
- 'DBD::SQLite' => 0.31,
- 'Class::DBI' => 0.96,
-# 'Crypt::SSLeay' => 0, # needed for http access to PAUSE
- 'Parse::CPAN::Packages' => 0, # for populating and maybe also later ?
- 'LWP::Simple' => 0, # for populate
- 'XML::RSS::SimpleGen' => 0, # for, well RSS generation
- 'Mail::Sendmail' => 0,
- 'CGI::Session::SQLite' => 0,
- 'Parse::RecDescent' => 0,
- 'Class::DBI::Plugin::AbstractCount' => 0,
- 'Class::DBI::Plugin::Pager' => 0,
- 'Text::CSV_XS' => 0,
- },
- build_requires => {
- 'Test::WWW::Mechanize' => 0.02,
- },
- dist_author => 'Gabor Szabo <gabor at pti.co.il>',
+#my $builder = CPAN::Forum::Build->new(
+my $builder = Module::Build->new(
+ module_name => 'CPAN::Forum',
+ license => 'perl',
+ dist_version_from => 'lib/CPAN/Forum.pm',
+ create_readme => 1,
+ create_makefile_pl => 'traditional',
+ requires => {
+ 'HTML::Template' => 2.6,
+ 'CGI' => 0,
+ 'CGI::Application' => 3.31,
+ 'CGI::Application::Plugin::Session' => 0,
+ 'CGI::Application::Plugin::LogDispatch' => 0,
+
+# 'Test::Warn' => 0,
+# 'HTML::Lint' => 1.26,
+# 'Test::HTML::Lint' => 1.26,
+ 'WWW::Mechanize' => 0,
+# 'Storable' => 0,
+ 'DBI' => 0,
+ 'DBD::SQLite' => 0.31,
+ 'Class::DBI' => 0, # It was complaining: ERROR: Version v3.0.14 of Class::DBI is installed, but we need version >= 0.96
+# 'Crypt::SSLeay' => 0, # needed for http access to PAUSE
+ 'Parse::CPAN::Packages' => 0, # for populating and maybe also later ?
+ 'LWP::Simple' => 0, # for populate
+ 'XML::RSS::SimpleGen' => 0, # for, well RSS generation
+ 'Mail::Sendmail' => 0,
+ 'CGI::Session::SQLite' => 0,
+ 'Parse::RecDescent' => 0,
+ 'Class::DBI::Plugin::AbstractCount' => 0,
+ 'Class::DBI::Plugin::Pager' => 0,
+ 'Text::CSV_XS' => 0,
+ },
+ build_requires => {
+ 'Test::More' => 0.47,
+ 'Test::WWW::Mechanize' => 0.02,
+ },
+ dist_author => 'Gabor Szabo <gabor at pti.co.il>',
);
$builder->create_build_script();
Modified: branches/db_changes/MANIFEST
===================================================================
--- branches/db_changes/MANIFEST 2006-03-22 08:05:11 UTC (rev 153)
+++ branches/db_changes/MANIFEST 2006-08-20 05:16:24 UTC (rev 154)
@@ -1,6 +1,6 @@
Build.PL
Makefile.PL
-MANIFEST This list of files
+MANIFEST
META.yml
README
@@ -30,7 +30,6 @@
t/pod-coverage.t
t/pod.t
t/02packages.details.txt
-t/lib/CGI/Application/Test.pm
t/lib/CPAN/Forum/Test.pm
templates/change_password.tmpl
Modified: branches/db_changes/lib/CPAN/Forum/Build.pm
===================================================================
--- branches/db_changes/lib/CPAN/Forum/Build.pm 2006-03-22 08:05:11 UTC (rev 153)
+++ branches/db_changes/lib/CPAN/Forum/Build.pm 2006-08-20 05:16:24 UTC (rev 154)
@@ -10,79 +10,53 @@
#my $root;
use base "Module::Build";
#sub create_build_script {
-# my $self = shift;
-# $root = shift;
+# my $self = shift;
+# $root = shift;
#
-# $self->SUPER::create_build_script(@_);
+# $self->SUPER::create_build_script(@_);
#}
sub ACTION_build {
- my $self = shift;
-# $self->SUPER::ACTION_build(@_);
-
- system "rm -rf blib";
- copy_tree(from => ".", dir => "blib");
- replace_sh_bang("$Bin/blib", <blib/bin/* blib/www/cgi/*>);
+ my $self = shift;
+# $self->SUPER::ACTION_build(@_);
+
+ system "rm -rf blib";
+ copy_tree(from => ".", dir => "blib");
+ replace_sh_bang("$Bin/blib", <blib/bin/* blib/www/cgi/*>);
}
sub ACTION_install {
- my $self = shift;
- my $dir = $self->{args}->{dir};
-
- if (not defined $dir) {
- die "Usage: $0 install dir=/path/to/install\n";
- }
-
- copy_tree(from => "blib", dir => $dir);
- replace_sh_bang("$dir", <$dir/bin/* $dir/www/cgi/*>);
-}
-
-sub ACTION_test {
- my $self = shift;
- my $p = $self->{properties};
-
- local @INC = (
- File::Spec->catdir($p->{base_dir}, "blib", 'modules'),
- @INC);
- $self->SUPER::ACTION_test(@_);
-}
-
-sub ACTION_cover {
my $self = shift;
- $self->depends_on('build');
- system qw( cover -delete );
+ my $dir = $self->{args}->{dir};
+
+ if (not defined $dir) {
+ die "Usage: $0 install dir=/path/to/install\n";
+ }
- # sometimes we get failing tests, which makes Test::Harness
- # die. catch that
- eval {
- #local $ENV{PERL5OPT} = "-MDevel::Cover=-summary,0";
- local $ENV{PERL5OPT} = "-MDevel::Cover";
- $self->ACTION_test(@_);
- };
- system qw( cover -report html );
+ copy_tree(from => "blib", dir => $dir);
+ replace_sh_bang("$dir", <$dir/bin/* $dir/www/cgi/*>);
}
-
# Replace the sh_bang line on each one of the scripts in the build directory
# keeping the parameters
sub replace_sh_bang {
- my ($dir, @files) = @_;
+ my ($dir, @files) = @_;
- foreach my $file (@files) {
- open my $fh, "<", $file or die "Could not open '$file' for reading $!\n";
- my @data = <$fh>;
- close $fh;
- #$data[0] =~ s{#![\w/]*}{#!$^X};
+ foreach my $file (@files) {
+ open my $fh, "<", $file or die "Could not open '$file' for reading $!\n";
+ my @data = <$fh>;
+ close $fh;
+ #$data[0] =~ s{#![\w/]*}{#!$^X};
- foreach my $line (@data) {
- if ($line =~ /use constant ROOT =>/) {
- $line = "use constant ROOT => '$dir';\n"
- }
- }
- open my $wh, ">", $file or die "Could not open '$file' for writing $!\n";
- print $wh @data;
- close $wh
- }
+ foreach my $line (@data) {
+ if ($line =~ /use constant ROOT =>/) {
+ $line = "use constant ROOT => '$dir';\n"
+ }
+ }
+ open my $wh, ">", $file or die "Could not open '$file' for writing $!\n";
+ print $wh @data;
+ close $wh
+ }
}
@@ -91,50 +65,50 @@
# dir => DIR,
# verbose => 1
sub copy_tree {
- my %args = @_;
- return if not defined $args{dir};
- return if not defined $args{from};
+ my %args = @_;
+ return if not defined $args{dir};
+ return if not defined $args{from};
- my $dir = $args{dir};
- my $from = $args{from};
+ my $dir = $args{dir};
+ my $from = $args{from};
- if (not -e $dir) {
- mkpath $dir or die "Cannot create directory '$dir' $!\n";
- }
+ if (not -e $dir) {
+ mkpath $dir or die "Cannot create directory '$dir' $!\n";
+ }
- open my $m, "MANIFEST" or die "Could not find the MANIFEST file $!\n";
- while (my $line = <$m>) {
- next if $line !~ /\S/;
+ open my $m, "MANIFEST" or die "Could not find the MANIFEST file $!\n";
+ while (my $line = <$m>) {
+ next if $line !~ /\S/;
- #my ($file, $skip) = split /\s+/, $line;
- my $file = $line;
- chomp $file;
- # hard coded skip list
- my $skip = 0;
- $skip = 1 if $file =~ m{^t/} or $file !~ m{/} or $file eq "bin/install.pl";
+ #my ($file, $skip) = split /\s+/, $line;
+ my $file = $line;
+ chomp $file;
+ # hard coded skip list
+ my $skip = 0;
+ $skip = 1 if $file =~ m{^t/} or $file !~ m{/} or $file eq "bin/install.pl";
- if ($skip) {
- print "Skiping '$file'\n" if $args{verbose};
- next;
- }
+ if ($skip) {
+ print "Skiping '$file'\n" if $args{verbose};
+ next;
+ }
- my $subdir = $file;
- $subdir =~ s@[^/]+$@@;
- if ($subdir and not -e "$dir/$subdir") {
- print "Making $dir/$subdir\n" if $args{verbose};
- mkpath "$dir/$subdir" or die "Cannot create '$dir/$subdir' $!\n";
- }
- print "Copying '$file' to '$dir/$file'\n" if $args{verbose};
- copy("$from/$file", "$dir/$file") or die "Could not copy '$from/$file' $!\n";
- #if ($file =~ /pl$/) {
- chmod 0755, "$dir/$file" or warn "Cannot chmod '$dir/$file' $!\n";
- #}
- }
+ my $subdir = $file;
+ $subdir =~ s@[^/]+$@@;
+ if ($subdir and not -e "$dir/$subdir") {
+ print "Making $dir/$subdir\n" if $args{verbose};
+ mkpath "$dir/$subdir" or die "Cannot create '$dir/$subdir' $!\n";
+ }
+ print "Copying '$file' to '$dir/$file'\n" if $args{verbose};
+ copy("$from/$file", "$dir/$file") or die "Could not copy '$from/$file' $!\n";
+ #if ($file =~ /pl$/) {
+ chmod 0755, "$dir/$file" or warn "Cannot chmod '$dir/$file' $!\n";
+ #}
+ }
- if (not -e "$dir/db") {
- mkpath "$dir/db";
- chmod 0777, "$dir/db";
- }
+ if (not -e "$dir/db") {
+ mkpath "$dir/db";
+ chmod 0777, "$dir/db";
+ }
}
Modified: branches/db_changes/lib/CPAN/Forum.pm
===================================================================
--- branches/db_changes/lib/CPAN/Forum.pm 2006-03-22 08:05:11 UTC (rev 153)
+++ branches/db_changes/lib/CPAN/Forum.pm 2006-08-20 05:16:24 UTC (rev 154)
@@ -243,6 +243,9 @@
=head2 TODO
+Removed the use of CPAN::Forum::Build - need to see what was it doing and
+replace its functionality with something better
+
Subject field:
- <= 80 chars
- Can contain any characters, we'll escape them when showing on the web site
Modified: branches/db_changes/t/00.load.t
===================================================================
--- branches/db_changes/t/00.load.t 2006-03-22 08:05:11 UTC (rev 153)
+++ branches/db_changes/t/00.load.t 2006-08-20 05:16:24 UTC (rev 154)
@@ -1,8 +1,8 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
+use warnings;
use strict;
use Test::More tests => 1;
-use lib "blib";
BEGIN {
use_ok( 'CPAN::Forum' );
More information about the Cpan-forum-commit
mailing list