Permalink
Browse files

first official packaged release

  • Loading branch information...
0 parents commit 9c37ffa395f9a530597f321ce0af345b4a3f1128 barbie committed Feb 13, 2009
15 CHANGES
@@ -0,0 +1,15 @@
+Revision history for Perl module CPAN::Testers::Data::Uploads.
+
+0.04 current
+ - changed to more formal package release.
+
+0.03 29/12/2008
+ - renamed Article reference.
+
+0.02 18/11/2008
+ - added multiple backup mechanism.
+ - added documentation.
+ - abstracted sources into configuration file.
+
+0.01 10/11/2008
+ - initial release
@@ -0,0 +1,22 @@
+CHANGES
+examples/uploads.ini
+examples/uploads.pl
+examples/uploads.sh
+examples/uploads.sql
+lib/CPAN/Testers/Data/Uploads.pm
+Makefile.PL
+MANIFEST
+META.yml
+t/01base.t
+t/05setup_db-uploads.t
+t/09setup-expected.t
+t/20attributes.t
+t/50logging.ini
+t/50logging.t
+t/52lastid.t
+t/59cleanup.t
+t/90podtest.t
+t/91podcover.t
+t/94metatest.t
+t/CTDU_Testing.pm
+t/Expected.zip
@@ -0,0 +1,51 @@
+--- #YAML:1.0
+name: CPAN-Testers-Data-Uploads
+version: 0.04
+abstract: CPAN Testers Uploads Database Generator
+author:
+ - Barbie <barbie@cpan.org>
+
+license: perl
+distribution_type: module
+installdirs: site
+
+requires:
+ Class::Accessor::Fast: 0
+ CPAN::DistnameInfo: 0
+ CPAN::Testers::Common::Article: 0
+ CPAN::Testers::Common::DBUtils: 0
+ Config::IniFiles: 0
+ File::Basename: 0
+ File::Find::Rule: 0
+ File::Path: 0
+ File::Slurp: 0
+ Getopt::Long: 0
+ IO::File: 0
+ Net::NNTP: 0
+recommends:
+ Test::More: 0.70
+ Test::Pod: 1.00
+ Test::Pod::Coverage: 0.08
+ Test::CPAN::Meta: 0.12
+build_requires:
+ Test::More: 0.01
+ Archive::Extract: 0
+
+provides:
+ CPAN::Testers::Data::Uploads:
+ file: lib/CPAN/Testers/Data/Uploads.pm
+ version: 0.04
+
+no_index:
+ directory:
+ - t
+ - examples
+
+resources:
+ license: http://dev.perl.org/licenses/
+ bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=CPAN-Testers-Data-Generator
+
+meta-spec:
+ version: 1.4
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+generated_by: Hand 1.0
@@ -0,0 +1,31 @@
+use ExtUtils::MakeMaker;
+WriteMakefile(
+ 'NAME' => 'CPAN::Testers::Data::Uploads',
+ 'VERSION_FROM' => 'lib/CPAN/Testers/Data/Uploads.pm',
+ 'PREREQ_PM' => {
+
+ 'Class::Accessor::Fast' => 0,
+ 'CPAN::DistnameInfo' => 0,
+ 'CPAN::Testers::Common::Article' => 0,
+ 'CPAN::Testers::Common::DBUtils' => 0,
+ 'Config::IniFiles' => 0,
+ 'File::Basename' => 0,
+ 'File::Find::Rule' => 0,
+ 'File::Path' => 0,
+ 'File::Slurp' => 0,
+ 'Getopt::Long' => 0,
+ 'IO::File' => 0,
+ 'Net::NNTP' => 0,
+
+ 'Test::More' => 0, # only for testing
+ 'Archive::Extract' => 0, # only for testing
+ },
+
+ 'PL_FILES' => {},
+ 'INSTALLDIRS' => 'site',
+ NO_META => 1,
+
+ ($] >= 5.005 ? ## Add these new keywords supported since 5.005
+ (ABSTRACT => 'CPAN Testers Uploads Database Generator',
+ AUTHOR => 'Barbie <barbie@cpan.org>') : ()),
+);
@@ -0,0 +1,25 @@
+[MASTER]
+BACKPAN=/opt/projects/BACKPAN/authors/id
+CPAN=/opt/projects/CPAN/authors/id
+logfile=logs/uploads.log
+
+[UPLOADS]
+driver=mysql
+database=uploads
+dbhost=localhost
+dbuser=dandan
+dbpass=d4nd4n
+
+[BACKUPS]
+drivers=<<EOT
+SQLite
+CSV
+EOT
+
+[SQLite]
+driver=SQLite
+database=data/uploads.db
+
+[CSV]
+driver=CSV
+dbfile=data/uploads.csv
@@ -0,0 +1,106 @@
+#!/usr/bin/perl -w
+use strict;
+
+use vars qw($VERSION);
+
+$VERSION = '0.02';
+
+$|++;
+
+#----------------------------------------------------------------------------
+# Library Modules
+
+use lib qw(./lib ../lib);
+
+use CPAN::Testers::Data::Uploads;
+
+#----------------------------------------------------------------------------
+# The Application Programming Interface
+
+my $obj = CPAN::Testers::Data::Uploads->new();
+$obj->process();
+
+__END__
+
+#----------------------------------------------------------------------------
+
+=head1 NAME
+
+uploads.pl - creates, updates and/or backs up the uploads database.
+
+=head1 SYNOPSIS
+
+ perl uploads.pl --config=<file> (-generate | -update | -backup | -h | -v)
+
+=head1 DESCRIPTION
+
+This program allows the user to create, update and backup the uploads database,
+either as separate commands, or a combination of all three. The process order
+will always be CREATE->UPDATE->BACKUP, regardless of the order the options
+appear on the command line.
+
+The Uploads database contains basic information about the history of CPAN. It
+records the release dates of everything that is uploaded to CPAN, both within
+a BACKPAN repository, a current CPAN repository and the latest uploads posted
+by PAUSE, which may not have yet reached the CPAN mirrors.
+
+A simple schema for the MySQL database is below:
+
+ CREATE TABLE `uploads` (
+ `type` varchar(10) NOT NULL,
+ `author` varchar(32) NOT NULL,
+ `dist` varchar(100) NOT NULL,
+ `version` varchar(100) NOT NULL,
+ `filename` varchar(255) NOT NULL,
+ `released` int(16) NOT NULL,
+ PRIMARY KEY (`author`,`dist`,`version`)
+ ) ENGINE=MyISAM;
+
+The 'type' field can be one of three values, 'backpan', 'cpan' or 'upload',
+which incates whether the release has been archived to BACKPAN, currently on
+CPAN or has recently been uploaded and may not have reached the CPAN mirrors
+yet.
+
+The 'author', 'dist', 'version' and 'filename' fields contain the breakdown of
+the distribution component parts used to locate the distribution. Although in
+most cases the filename could be considered a primary key, it is possible that
+two or more authors could upload a distribution with the same name.
+
+The 'released' field holds the date of the distribution release as the number
+of seconds since the epoch. This is extremely useful for sorting distributions
+based on their release date rather than the version string. Due to many authors
+having different version schemes, this is perhaps the only reliable method with
+which to sort distribution releases.
+
+=head1 BUGS, PATCHES & FIXES
+
+There are no known bugs at the time of this release. However, if you spot a
+bug or are experiencing difficulties, that is not explained within the POD
+documentation, please send an email to barbie@cpan.org. However, it would help
+greatly if you are able to pinpoint problems or even supply a patch.
+
+Fixes are dependant upon their severity and my availablity. Should a fix not
+be forthcoming, please feel free to (politely) remind me.
+
+=head1 SEE ALSO
+
+L<CPAN::WWW::Testers>,
+L<CPAN::Testers::WWW::Statistics>
+
+F<http://www.cpantesters.org/>,
+F<http://stats.cpantesters.org/>,
+F<http://wiki.cpantesters.org/>
+
+=head1 AUTHOR
+
+ Barbie, <barbie@cpan.org>
+ for Miss Barbell Productions <http://www.missbarbell.co.uk>.
+
+=head1 COPYRIGHT AND LICENSE
+
+ Copyright (C) 2008-2009 Barbie for Miss Barbell Productions.
+
+ This module is free software; you can redistribute it and/or
+ modify it under the same terms as Perl itself.
+
+=cut
@@ -0,0 +1,26 @@
+#!/usr/bin/bash
+
+BASE=/opt/projects/cpantesters
+
+cd $BASE/uploads
+mkdir -p logs
+mkdir -p data
+
+date_format="%Y/%m/%d %H:%M:%S"
+echo `date +"$date_format"` "START" >>logs/uploads.log
+
+perl uploads.pl --config=uploads.ini -u -b
+
+echo `date +"$date_format"` "Compressing Uploads data..." >>logs/uploads.log
+
+cd $BASE/dbx
+rm -f uploads.*
+cp $BASE/uploads/data/uploads.db . ; gzip uploads.db
+cp $BASE/uploads/data/uploads.db . ; bzip2 uploads.db
+cp $BASE/uploads/data/uploads.csv . ; gzip uploads.csv
+cp $BASE/uploads/data/uploads.csv . ; bzip2 uploads.csv
+
+mkdir -p /var/www/devel/uploads
+mv uploads.* /var/www/devel/uploads
+
+echo `date +"$date_format"` "STOP" >>logs/uploads.log
@@ -0,0 +1,25 @@
+## MySQL
+
+DROP TABLE IF EXISTS `uploads`;
+CREATE TABLE `uploads` (
+ `type` varchar(10) NOT NULL,
+ `author` varchar(32) NOT NULL,
+ `dist` varchar(100) NOT NULL,
+ `version` varchar(100) NOT NULL,
+ `filename` varchar(255) NOT NULL,
+ `released` int(16) NOT NULL,
+ PRIMARY KEY (`author`,`dist`,`version`)
+) ENGINE=MyISAM;
+
+
+## SQLite
+
+CREATE TABLE `uploads` (
+ `type` text NOT NULL,
+ `author` text NOT NULL,
+ `dist` text NOT NULL,
+ `version` text NOT NULL,
+ `filename` text NOT NULL,
+ `released` int NOT NULL,
+ PRIMARY KEY (`author`,`dist`,`version`)
+);
Oops, something went wrong.

0 comments on commit 9c37ffa

Please sign in to comment.