[Collab-qa-commits] r583 - svnbuildstat/trunk/script
goneri-guest at alioth.debian.org
goneri-guest at alioth.debian.org
Wed Dec 12 21:00:59 UTC 2007
Author: goneri-guest
Date: 2007-12-12 21:00:59 +0000 (Wed, 12 Dec 2007)
New Revision: 583
Added:
svnbuildstat/trunk/script/svnbuildstat_tarball.pl
Log:
initial import
Added: svnbuildstat/trunk/script/svnbuildstat_tarball.pl
===================================================================
--- svnbuildstat/trunk/script/svnbuildstat_tarball.pl (rev 0)
+++ svnbuildstat/trunk/script/svnbuildstat_tarball.pl 2007-12-12 21:00:59 UTC (rev 583)
@@ -0,0 +1,62 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use lib '/home/sites/svnbuildstat.debian.net/svnbuildstat/lib';
+
+use Config::IniFiles;
+use SvnBuildStat::Schema;
+use SvnBuildStat::Common;
+use Logger::Syslog;
+
+my $cfg = Config::IniFiles->new( -file => "../svnbuildstat.ini" ) or die "Can't load config file";
+my $schema = SvnBuildStat::Schema->connect(
+ $cfg->val('db', 'dsn'),
+ $cfg->val('db', 'user'),
+ $cfg->val('db', 'password'),
+ {AutoCommit => 1, debug => 1}
+);
+
+my $begin = time;
+debug ("begin");
+
+my $repositoryentry_rs = $schema->resultset('Repositoryentry')->search();
+while (my $repositoryentry = $repositoryentry_rs->next) {
+ my $dataFromDebianFtp = getDataFromDebianFtp(\$repositoryentry);
+
+ if ($dataFromDebianFtp->{isindebian}) {
+ $repositoryentry->isindebian(1);
+ $repositoryentry->tarballuri($dataFromDebianFtp->{tarballuri});
+ $repositoryentry->istarballpresent(1);
+ $repositoryentry->update();
+ next;
+ } else {
+ $repositoryentry->isindebian(0);
+ }
+
+ if ($repositoryentry->repository_id->tarballlayout) {
+ my $tarballurlfromtarballlayout = createTarballUrlFromTarballlayout(\$repositoryentry);
+ if ($tarballurlfromtarballlayout && testUrl($tarballurlfromtarballlayout)) {
+ $repositoryentry->tarballuri($tarballurlfromtarballlayout);
+ $repositoryentry->istarballpresent(1);
+ $repositoryentry->update();
+ next;
+ }
+ }
+
+ # Probably filled by the watch file, let's check the url
+ if ($repositoryentry->tarballuri && testUrl($repositoryentry->tarballuri)) {
+ $repositoryentry->istarballpresent(1);
+ $repositoryentry->update();
+ }
+
+ # TODO, check for svnbuildpackage OrigUrl here
+ # TODO deal with tarballs that are one the repository
+
+ $repositoryentry->istarballpresent(1);
+ $repositoryentry->update();
+
+}
+
+debug ("end (".(time - $begin)." secondes)");
+
Property changes on: svnbuildstat/trunk/script/svnbuildstat_tarball.pl
___________________________________________________________________
Name: svn:executable
+ *
More information about the Collab-qa-commits
mailing list