[Collab-qa-commits] r502 - svnbuildstat/trunk/script

goneri-guest at alioth.debian.org goneri-guest at alioth.debian.org
Sat Nov 10 13:27:14 UTC 2007


Author: goneri-guest
Date: 2007-11-10 13:27:14 +0000 (Sat, 10 Nov 2007)
New Revision: 502

Modified:
   svnbuildstat/trunk/script/svnbuildstat_import-new-report.pl
   svnbuildstat/trunk/script/svnbuildstat_update-db.pl
   svnbuildstat/trunk/script/svnbuildstat_update-repository.pl
Log:
transition from package->uri to package->vcsuri ando other minor stuff


Modified: svnbuildstat/trunk/script/svnbuildstat_import-new-report.pl
===================================================================
--- svnbuildstat/trunk/script/svnbuildstat_import-new-report.pl	2007-11-10 01:57:28 UTC (rev 501)
+++ svnbuildstat/trunk/script/svnbuildstat_import-new-report.pl	2007-11-10 13:27:14 UTC (rev 502)
@@ -163,7 +163,7 @@
   }
 
   # Update package rev just in case it'd been updated during the build
-  my $svnbase = $package->uri;
+  my $svnbase = $package->vcsuri;
   foreach (`LC_ALL=C svn info $svnbase`) {
     if (/Last Changed Rev:\ (\d+)/) {
       $package->rev($1); 

Modified: svnbuildstat/trunk/script/svnbuildstat_update-db.pl
===================================================================
--- svnbuildstat/trunk/script/svnbuildstat_update-db.pl	2007-11-10 01:57:28 UTC (rev 501)
+++ svnbuildstat/trunk/script/svnbuildstat_update-db.pl	2007-11-10 13:27:14 UTC (rev 502)
@@ -16,6 +16,7 @@
 use lib '/home/sites/svnbuildstat.debian.net/svnbuildstat/lib';
 use SvnBuildStat::Schema;
 use SvnBuildStat::Config;
+use Logger::Syslog;
 
 my $config;
 my $schema;
@@ -31,6 +32,7 @@
 
   return;
 } 
+
 sub mkTarballFromPackage {
   my $package = shift;
 
@@ -111,9 +113,9 @@
   my $cmd;
 
   return unless $$package->svndebrelease;
-  return unless $$package->uri;
+  return unless $$package->vcsuri;
 
-  $cmd = "svn cat ".$$package->uri."/debian/watch";
+  $cmd = "svn cat ".$$package->vcsuri."/debian/watch";
   my $watch = `$cmd`;
 
   return unless $watch;
@@ -170,7 +172,7 @@
   return unless $last_rev;
   print "LAST REV:". $last_rev."\n";
 
-  my $cmd = "LC_ALL=C svn log -r ".$last_rev.":".$$package->rev." ".$$package->uri;
+  my $cmd = "LC_ALL=C svn log -r ".$last_rev.":".$$package->rev." ".$$package->vcsuri;
   my $begin;
   my $entry;
   foreach (`$cmd`) {
@@ -183,9 +185,9 @@
 	my $rev = $1;
 	my $login = $2;
 	my $date = $3;
-	my $aliothlogin = $schema->resultset('Aliothlogin')->find_or_create({name=>$login});
+	my $userlogin = $schema->resultset('Userlogin')->find_or_create({name=>$login});
 	$entry = $schema->resultset('Vcschangelog')->create({
-	    aliothlogin_id =>$aliothlogin->id,
+	    userlogin_id =>$userlogin->id,
 	    package_id => $$package->id,
 	    date => $date,
 	    rev => $rev,
@@ -319,7 +321,7 @@
   $package->update_from_related('repository_id',$$repository);
   
   $package->svndebrelease ($svndebrelease);
-  $package->uri($uri);
+  $package->vcsuri($uri);
   $package->repository_id($$repository);
   foreach my $maintainer (@maintainer) {
     my $package_maintainer =
@@ -375,7 +377,6 @@
   $package->todo($todo);
   $package->currentchangelogentry($currentchangelogentry);
   $package->currentpendingbug($currentpendingbug);
-  print "->".$package->name."\n";
   $package->lastcheck('now');
   $package->rev($rev); # at the end since it marks in the new status of the package ins the DB
   $package->update();
@@ -396,8 +397,8 @@
 
   my $tarballonrepository;
   print "Repository: ".$$repository->name."\n";
-  my $t = 'svn ls -R '.$$repository->uri;
-  my $rev = getRev($$repository->uri);
+  my $t = 'svn ls -R '.$$repository->vcsuri;
+  my $rev = getRev($$repository->vcsuri);
   if(! $rev) {
     print "Failed to get the current revision of ".$$repository->name."\n";
     return;
@@ -419,12 +420,12 @@
 
   foreach (`$t`) {
     chomp;
-    my $uri = $$repository->uri.'/'.$_;
+    my $uri = $$repository->vcsuri.'/'.$_;
     $tarballonrepository->{basename($_)}=$uri if /\.tar\.gz$/;
     $uri =~ s/\/$//;
     next if /\/(tags|branches|attic)\//; # I want trunk!
     next if /\/(sarge|etch)\//; # Try to avoid sarge and etch backport 
-    next unless /debian\/control$/; # I want trunk!
+    next unless /debian\/control$/;
     $uri =~ s/(|\/)debian\/control$//;
     push @uri, $uri;
   }
@@ -440,7 +441,16 @@
 
   print "end import Repo\n";
 }
+###################################################
+###################################################
+###################################################
+###################################################
+###################################################
+############### MAIN ##############################
+###################################################
+###################################################
 
+info ("starting");
 ########## THREAD POOLS #####
 $poolImportPkg = Thread::Pool::Simple->new(
    min => 5,
@@ -460,8 +470,10 @@
 $poolImportPkg->join;
 
 # Purge the removed packages
-my $interval = "< repository_id.lastcheck - interval '1 day'";
-my $package_rs = $schema->resultset('Package')->search({'me.lastcheck' => \$interval} , {join => => 'repository_id'});
-$package_rs->delete_all;
+# This semems to be fucked?
+#my $interval = "< repository_id.lastcheck - interval '1 day'";
+#my $package_rs = $schema->resultset('Package')->search({'me.lastcheck' => \$interval} , {join => => 'repository_id'});
+#$package_rs->delete_all;
 
+info ("stopping");
 

Modified: svnbuildstat/trunk/script/svnbuildstat_update-repository.pl
===================================================================
--- svnbuildstat/trunk/script/svnbuildstat_update-repository.pl	2007-11-10 01:57:28 UTC (rev 501)
+++ svnbuildstat/trunk/script/svnbuildstat_update-repository.pl	2007-11-10 13:27:14 UTC (rev 502)
@@ -110,7 +110,7 @@
   my ($package) = @_;
   debug("prepareFromSvn: ".$$package->name);
 
-  return unless $$package->uri;
+  return unless $$package->vcsuri;
 
   my $repo_shortname = $$package->repository_id->shortname;
   next unless $repo_shortname;
@@ -131,16 +131,19 @@
 
   my $rev;
   my $packagerootdir = mkRootdirectoryFromPackage($package);
-  my $cmd = "LC_ALL=C svn export ".$$package->uri." $workdir/".$packagerootdir." --force 2>&1";
+  my $cmd = "LC_ALL=C svn export ".$$package->vcsuri." $workdir/".$packagerootdir." --force 2>&1";
   foreach (`$cmd`) {
     $rev = $1 if /Exported revision (\d+)\./;
   }
   if (($? >> 8)!=0 || !$rev) {
-    info("failed to svn export ".$$package->uri);
+    info("failed to svn export ".$$package->vcsuri);
     return;
   }
 
   return unless addSubRevInChangelog($packagerootdir, "svn".$rev);
+  if ($rev ne $$package->rev) {
+    TODO
+  }
 
   print `dpkg-source -b -W $packagerootdir 2>&1`;
   if (($? >> 8)!=0) {
@@ -151,13 +154,17 @@
   $$package->repository_id->team_id->shortname.'/'.
   $$package->name;
   `mkdir -p $destdir` unless -d $destdir;
+
+  my $dscfile;
   foreach my $file (<$workdir/*>) {
     next unless -f $file;
+    $dscfile = $file if /\.dsc/;
     move ($file, $destdir);
   }
+  return unless $dscfile;
 
-
-  $$package->issrcinmypool(1);
+  $$package->dscuri($config->server_repositorydir.'/'.$$package->repository_id->team_id->shortname.'/'.$$package->name.'/'.$dscfile);
+  $$package->issrcinmypool(1);#TODO deprecated
   $$package->update;
   1;
 }
@@ -200,8 +207,12 @@
   next unless $package->name;
   next unless $package->realsvndebrelease;
 
-  my $vcs = $package->repository_id->repositoryfamily_id->vcs_id->name;
+  my $vcs;
+  if ($package->repository_id->repositoryfamily_id->vcs_id) {
+   $vcs = $package->repository_id->repositoryfamily_id->vcs_id->name;
+ }
 
+ # if tthere is no VCS, it's a Debian pool somewhere that I don"t need to purge
   next unless $vcs;
 
 #    my $svndebrelease = $package->realsvndebrelease;




More information about the Collab-qa-commits mailing list