[Collab-qa-commits] r1174 - in buildstat/trunk/buildstat-server/script: . attic
goneri at alioth.debian.org
goneri at alioth.debian.org
Thu Aug 28 15:57:30 UTC 2008
Author: goneri
Date: 2008-08-28 15:57:29 +0000 (Thu, 28 Aug 2008)
New Revision: 1174
Added:
buildstat/trunk/buildstat-server/script/attic/svnbuildstat_tarball.pl
Removed:
buildstat/trunk/buildstat-server/script/svnbuildstat_tarball.pl
Log:
move svnbuildstat_tarball.pl, svnbuildstat_update-repository.pl will do the job itself
Copied: buildstat/trunk/buildstat-server/script/attic/svnbuildstat_tarball.pl (from rev 1172, buildstat/trunk/buildstat-server/script/svnbuildstat_tarball.pl)
===================================================================
--- buildstat/trunk/buildstat-server/script/attic/svnbuildstat_tarball.pl (rev 0)
+++ buildstat/trunk/buildstat-server/script/attic/svnbuildstat_tarball.pl 2008-08-28 15:57:29 UTC (rev 1174)
@@ -0,0 +1,83 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use lib '/usr/share/buildstat-server/lib';
+
+use Config::IniFiles;
+use SvnBuildStat::Schema;
+use SvnBuildStat::Common;
+use Logger::Syslog;
+use LWP::Simple;
+use File::Copy;
+
+my $cfg = Config::IniFiles->new( -file => "/etc/buildstat-server/buildstat.ini" ) or die "Can't load config file";
+my $schema = SvnBuildStat::Schema->connect(
+ $cfg->val('db', 'dsn'),
+ $cfg->val('db', 'user'),
+ undef,
+ {AutoCommit => 1, debug => 1}
+ );
+
+my $tarballdir = $cfg->val('path', 'tarballdir');
+
+if (! -d $tarballdir) {
+ print "the tarball directory (`$tarballdir') doesn't exit\n";
+ error ("the tarball directory (`$tarballdir') doesn't exit");
+ exit 1;
+}
+
+my $begin = time;
+debug ("begin");
+
+my $changelogentry_rs = $schema->resultset('Changelogentry')->search({ tarball_id => undef , version => { '!=', undef}, isnative => 'false' });
+while (my $changelogentry = $changelogentry_rs->next) {
+ my $tarball;
+ my $filename = mkTarballFromChangelogentry(\$changelogentry);
+# if (-f $tarballdir.'/'.$filename) {
+# $tarball = $schema->resultset('Tarball')->find_or_create({ name => $filename });
+# $changelogentry->tarball_id($tarball->id);
+# $changelogentry->update();
+# next;
+# }
+
+ my $repositoryentry = $changelogentry->repositoryentry_id;
+ my $dataFromDebianFtp = getDataFromDebianFtp(\$changelogentry);
+
+ my $tarballuri;
+ if ($dataFromDebianFtp->{isindebian} eq 't') {
+ $changelogentry->isindebian(1);
+ $tarballuri = $dataFromDebianFtp->{tarballuri};
+ } else {
+ $changelogentry->isindebian(0);
+ }
+
+ if (!$tarballuri) {
+ if ($changelogentry->repositoryentry_id->repository_id->tarballlayout) {
+ my $tarballurlfromtarballlayout = createTarballUrlFromTarballlayout(\$changelogentry->repositoryentry_id);
+ if ($tarballurlfromtarballlayout && testUrl($tarballurlfromtarballlayout)) {
+ $tarballuri = $tarballurlfromtarballlayout;
+ }
+ }
+ }
+
+ if (!$tarballuri) {
+ $tarballuri = getTarballURLWithWatchfile(\$changelogentry);
+ }
+
+ next unless $tarballuri;
+ if (getstore ($tarballuri, $tarballdir.'/'.$filename.'.part') && move($tarballdir.'/'.$filename.'.part', $tarballdir.'/'.$filename)) {
+ $tarball = $schema->resultset('Tarball')->find_or_create({ name => $filename });
+ $changelogentry->tarball_id($tarball->id);
+ } else {
+ unlink $tarballdir.'/'.$filename.'.part';
+ }
+ $changelogentry->update;
+
+# TODO, check for svnbuildpackage OrigUrl here
+# TODO deal with tarballs that are one the repository
+
+}
+
+debug ("end (".(time - $begin)." secondes)");
+
Deleted: buildstat/trunk/buildstat-server/script/svnbuildstat_tarball.pl
===================================================================
--- buildstat/trunk/buildstat-server/script/svnbuildstat_tarball.pl 2008-08-28 14:45:07 UTC (rev 1173)
+++ buildstat/trunk/buildstat-server/script/svnbuildstat_tarball.pl 2008-08-28 15:57:29 UTC (rev 1174)
@@ -1,83 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-
-use lib '/usr/share/buildstat-server/lib';
-
-use Config::IniFiles;
-use SvnBuildStat::Schema;
-use SvnBuildStat::Common;
-use Logger::Syslog;
-use LWP::Simple;
-use File::Copy;
-
-my $cfg = Config::IniFiles->new( -file => "/etc/buildstat-server/buildstat.ini" ) or die "Can't load config file";
-my $schema = SvnBuildStat::Schema->connect(
- $cfg->val('db', 'dsn'),
- $cfg->val('db', 'user'),
- undef,
- {AutoCommit => 1, debug => 1}
- );
-
-my $tarballdir = $cfg->val('path', 'tarballdir');
-
-if (! -d $tarballdir) {
- print "the tarball directory (`$tarballdir') doesn't exit\n";
- error ("the tarball directory (`$tarballdir') doesn't exit");
- exit 1;
-}
-
-my $begin = time;
-debug ("begin");
-
-my $changelogentry_rs = $schema->resultset('Changelogentry')->search({ tarball_id => undef , version => { '!=', undef}, isnative => 'false' });
-while (my $changelogentry = $changelogentry_rs->next) {
- my $tarball;
- my $filename = mkTarballFromChangelogentry(\$changelogentry);
-# if (-f $tarballdir.'/'.$filename) {
-# $tarball = $schema->resultset('Tarball')->find_or_create({ name => $filename });
-# $changelogentry->tarball_id($tarball->id);
-# $changelogentry->update();
-# next;
-# }
-
- my $repositoryentry = $changelogentry->repositoryentry_id;
- my $dataFromDebianFtp = getDataFromDebianFtp(\$changelogentry);
-
- my $tarballuri;
- if ($dataFromDebianFtp->{isindebian} eq 't') {
- $changelogentry->isindebian(1);
- $tarballuri = $dataFromDebianFtp->{tarballuri};
- } else {
- $changelogentry->isindebian(0);
- }
-
- if (!$tarballuri) {
- if ($changelogentry->repositoryentry_id->repository_id->tarballlayout) {
- my $tarballurlfromtarballlayout = createTarballUrlFromTarballlayout(\$changelogentry->repositoryentry_id);
- if ($tarballurlfromtarballlayout && testUrl($tarballurlfromtarballlayout)) {
- $tarballuri = $tarballurlfromtarballlayout;
- }
- }
- }
-
- if (!$tarballuri) {
- $tarballuri = getTarballURLWithWatchfile(\$changelogentry);
- }
-
- next unless $tarballuri;
- if (getstore ($tarballuri, $tarballdir.'/'.$filename.'.part') && move($tarballdir.'/'.$filename.'.part', $tarballdir.'/'.$filename)) {
- $tarball = $schema->resultset('Tarball')->find_or_create({ name => $filename });
- $changelogentry->tarball_id($tarball->id);
- } else {
- unlink $tarballdir.'/'.$filename.'.part';
- }
- $changelogentry->update;
-
-# TODO, check for svnbuildpackage OrigUrl here
-# TODO deal with tarballs that are one the repository
-
-}
-
-debug ("end (".(time - $begin)." secondes)");
-
More information about the Collab-qa-commits
mailing list