[Collab-qa-commits] r589 - svnbuildstat/trunk/script
goneri-guest at alioth.debian.org
goneri-guest at alioth.debian.org
Fri Dec 14 15:11:34 UTC 2007
Author: goneri-guest
Date: 2007-12-14 15:11:34 +0000 (Fri, 14 Dec 2007)
New Revision: 589
Modified:
svnbuildstat/trunk/script/svnbuildstat_tarball.pl
Log:
some corrections
Modified: svnbuildstat/trunk/script/svnbuildstat_tarball.pl
===================================================================
--- svnbuildstat/trunk/script/svnbuildstat_tarball.pl 2007-12-13 23:25:01 UTC (rev 588)
+++ svnbuildstat/trunk/script/svnbuildstat_tarball.pl 2007-12-14 15:11:34 UTC (rev 589)
@@ -11,51 +11,46 @@
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}
-);
+ $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);
+ 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;
+ if ($dataFromDebianFtp->{isindebian} eq 't') {
+ $repositoryentry->isindebian(1);
+ $repositoryentry->tarballuri($dataFromDebianFtp->{tarballuri});
+ } else {
+ $repositoryentry->isindebian(0);
+
+ if ($repositoryentry->repository_id->tarballlayout) {
+ my $tarballurlfromtarballlayout = createTarballUrlFromTarballlayout(\$repositoryentry);
+ if ($tarballurlfromtarballlayout && testUrl($tarballurlfromtarballlayout)) {
+ $repositoryentry->tarballuri($tarballurlfromtarballlayout);
+ }
+ } elsif ($repositoryentry->tarballuri && !testUrl($repositoryentry->tarballuri)) {
+#Probably filled by the watch file, let's check the url
+ $repositoryentry->tarballuri(undef);
+ }
}
- }
- # Probably filled by the watch file, let's check the url
- if ($repositoryentry->tarballuri && testUrl($repositoryentry->tarballuri)) {
- $repositoryentry->istarballpresent(1);
+ # this is useless but I prefere to be sure there is no non null empty string
+ if ($repositoryentry->tarballuri) {
+ $repositoryentry->tarballuri(undef);
+ }
+
$repositoryentry->update();
- }
- # TODO, check for svnbuildpackage OrigUrl here
- # TODO deal with tarballs that are one the repository
+# 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)");
More information about the Collab-qa-commits
mailing list