r2621 - in people/goneri/SvnBuildStat-WWW: ! dirs' list truncated !

Gonéri Le Bouder goneri-guest at alioth.debian.org
Mon Apr 30 22:26:41 UTC 2007


Author: goneri-guest
Date: 2007-04-30 22:26:40 +0000 (Mon, 30 Apr 2007)
New Revision: 2621

Modified:
   people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/Config.pm
   people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW.pm
   people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW/Controller/Logs.pm
   people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW/Controller/Packages.pm
   people/goneri/SvnBuildStat-WWW/root/lib/site/header
   people/goneri/SvnBuildStat-WWW/root/lib/site/layout
   people/goneri/SvnBuildStat-WWW/root/src/logs/build.tt2
   people/goneri/SvnBuildStat-WWW/root/src/logs/piuparts.tt2
   people/goneri/SvnBuildStat-WWW/root/src/packages/info.tt2
   people/goneri/SvnBuildStat-WWW/root/src/packages/main.tt2
   people/goneri/SvnBuildStat-WWW/root/src/ttsite.css
   people/goneri/SvnBuildStat-WWW/script/svnbuildstat_agent.pl
   people/goneri/SvnBuildStat-WWW/script/svnbuildstat_import-new-report.pl
   people/goneri/SvnBuildStat-WWW/script/svnbuildstat_update-bugs.pl
   people/goneri/SvnBuildStat-WWW/script/svnbuildstat_update-db.pl
Log:
to much things :)


Modified: people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/Config.pm
===================================================================
--- people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/Config.pm	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/Config.pm	2007-04-30 22:26:40 UTC (rev 2621)
@@ -34,8 +34,6 @@
   $self->define( "agent_debmirror" => {ARGCOUNT => ARGCOUNT_ONE, DEFAULT => "" });
 
   $self->file($file) or die "Can't load `$file'";
-#  use Data::Dumper;
-#  print Dumper($self);
   return $self;
 }
 1;

Modified: people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW/Controller/Logs.pm
===================================================================
--- people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW/Controller/Logs.pm	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW/Controller/Logs.pm	2007-04-30 22:26:40 UTC (rev 2621)
@@ -71,4 +71,48 @@
 
 }
 
+sub piuparts : Local {
+  my ( $self, $c, $build_id ) = @_;
+
+
+  if (!($build_id && $build_id =~ /\d+/)) {
+    $c->response->redirect($c->uri_for('/'));
+    return;
+  }
+
+  my $build = $c->model('SvnBuildStat::WWW::Model::DB::Build')->search({id => $build_id})->first;
+  if (!$build) {
+    $c->response->redirect($c->uri_for('/'));
+    return;
+  }
+
+  my $htmllog;
+  my @errindex;
+
+  my $line;
+  foreach (split $/, $build->piuparts_log) {
+    $line++;
+    my $orig = $_;
+    if (s/(error|warning|failed)/<strong id="$line">$1<\/strong>/gi) {
+      push @errindex, {
+	linenum => $line,
+	content => $orig
+      }
+    }
+
+    $htmllog .= $_."<br />";
+  }
+
+  $c->stash->{'log'} = {
+    'errindex' => \@errindex,
+    'package' => $build->package_id->name,
+    'arch' => $build->arch_id->name,
+    'buildisok' => $build->buildisok,
+    'log' => $htmllog 
+  };
+
+  $c->stash->{template} = 'logs/piuparts.tt2';
+
+}
+
 1;

Modified: people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW/Controller/Packages.pm
===================================================================
--- people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW/Controller/Packages.pm	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW/Controller/Packages.pm	2007-04-30 22:26:40 UTC (rev 2621)
@@ -21,6 +21,15 @@
 
 =cut
 
+sub mkTarballFromPackage {
+  my $package = shift;
+
+  my $majorrelease = $$package->svndebrelease;
+  $majorrelease =~ s/-[0-9A-Za-z\.~]*$//;
+
+  $$package->name.'_'.$majorrelease.".orig.tar.gz";
+}
+
 sub index : Private {
   my ( $self, $c ) = @_;
 
@@ -85,6 +94,8 @@
     push @{$c->stash->{packages}}, {
 
     name => $package->name,
+    istarballpresent => $package->istarballpresent,
+    isindebian => $package->isindebian,
     needbuild => $needbuild,
     lintianerrcount => $lintianerrcount,
     lindaerrcount => $lindaerrcount,
@@ -110,6 +121,10 @@
     return;
   }
   $c->stash->{package} = $package->name;
+  $c->stash->{istarballpresent} = $package->istarballpresent;
+  $c->stash->{isindebian} = $package->isindebian,
+  $c->stash->{tarballuri} = $package->tarballuri,
+  $c->stash->{uri} = $package->uri,
   ############ Maintainers list
   my $packagemaintainer_rs = $c->model('SvnBuildStat::WWW::Model::DB::PackageMaintainer')->search({package_id => $package->id});
   $c->stash->{maintainers} = [ $packagemaintainer_rs->search_related("maintainer_id")->all ];
@@ -128,18 +143,18 @@
 
 ##########
 my $build = $c->model('SvnBuildStat::WWW::Model::DB::Build')->search({package_id => $package->id, isbuildinprogress => 'false'},{order_by => "id DESC"})->first;
-my $lintian_htmllog;
-my $linda_htmllog;
 if ($build) {
   foreach (split $/, $build->lintian_log) {
-    $lintian_htmllog .= $_."<br />";
+    my $warning;
+    $warning = 1 if /^E/;    
+    push @{$c->stash->{lintians}}, { text => $_, warning => $warning };
   }
-  $c->stash->{lintian} = $lintian_htmllog;
 
   foreach (split $/, $build->linda_log) {
-    $linda_htmllog .= $_."<br />";
+    my $warning;
+    $warning = 1 if /^E/;    
+    push @{$c->stash->{lindas}}, { text => $_, warning => $warning } ;
   }
-  $c->stash->{linda} = $linda_htmllog;
 
   $c->stash->{piupartsisok}  = $build->piupartsisok;
 }
@@ -190,7 +205,7 @@
   }
 
   my $archobj = $c->model('SvnBuildStat::WWW::Model::DB::Arch')->find_or_create ({name => $arch});
-  my $package_rs = $c->model('SvnBuildStat::WWW::Model::DB::Package');
+  my $package_rs = $c->model('SvnBuildStat::WWW::Model::DB::Package')->search ({istarballpresent => 'true'});
   return unless $package_rs->count;
 
   while (my $package = $package_rs->next) {
@@ -210,9 +225,10 @@
     $tarballuri =~ s/\@TARBALL@/$package->svndebrelease/;
 
     my $rev = $package->rev;
-    my $repositoryuri = $package->repository_id->uri."/".$package->name;
+    my $uri = $package->uri;
+    my $tarball = mkTarballFromPackage(\$package);
 
-    $c->response->body("$name;$rev;$tarballuri;$repositoryuri");
+    $c->response->body("$name;$rev;$tarballuri;$tarball;$uri");
   }
 }
 =head1 AUTHOR

Modified: people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW.pm
===================================================================
--- people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW.pm	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW.pm	2007-04-30 22:26:40 UTC (rev 2621)
@@ -13,7 +13,8 @@
 # Static::Simple: will serve static files from the application's root 
 #                 directory
 
-use Catalyst qw/-Debug ConfigLoader Static::Simple/;
+#use Catalyst qw/-Debug ConfigLoader Static::Simple/;
+use Catalyst qw/ConfigLoader Static::Simple/;
 
 our $VERSION = '0.01';
 

Modified: people/goneri/SvnBuildStat-WWW/root/lib/site/header
===================================================================
--- people/goneri/SvnBuildStat-WWW/root/lib/site/header	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/root/lib/site/header	2007-04-30 22:26:40 UTC (rev 2621)
@@ -1,6 +1,6 @@
 <!-- BEGIN site/header -->
 <div id="debianlogo">
-<img src="/static/images/debian.png" alt="Debian logo" />
+<img src="/svnbuildstat/static/images/debian.png" alt="Debian logo" />
 </div>
 <div id="headertitle">nana.rulezlan.org/svnbuildstat</div>
 <div id="headersubtitle">  

Modified: people/goneri/SvnBuildStat-WWW/root/lib/site/layout
===================================================================
--- people/goneri/SvnBuildStat-WWW/root/lib/site/layout	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/root/lib/site/layout	2007-04-30 22:26:40 UTC (rev 2621)
@@ -7,8 +7,8 @@
 <div id="floatmenu">
 <div class="menuitem">Welcome</div>
 <div class="menusubitem">
-<a href="/repositorys/list">Teams</a></div>
-<div class="menusubitem"><a href="/maintainers/list">Maintainers</a></div>
+<a href="/svnbuildstat/repositorys/list">Teams</a></div>
+<div class="menusubitem"><a href="/svnbuildstat/maintainers/list">Maintainers</a></div>
 
 
 </div>

Modified: people/goneri/SvnBuildStat-WWW/root/src/logs/build.tt2
===================================================================
--- people/goneri/SvnBuildStat-WWW/root/src/logs/build.tt2	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/root/src/logs/build.tt2	2007-04-30 22:26:40 UTC (rev 2621)
@@ -15,7 +15,7 @@
 [% END %]
 
 [% IF log.errindex %]
-<h2>autodetected error message in log</h2>
+<h2>autodetected possible error in log</h2>
   <ul>
   [% FOREACH err IN log.errindex -%]
     <li><a href="#[% err.linenum %]">[% err.content %]</a></li>

Modified: people/goneri/SvnBuildStat-WWW/root/src/logs/piuparts.tt2
===================================================================
--- people/goneri/SvnBuildStat-WWW/root/src/logs/piuparts.tt2	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/root/src/logs/piuparts.tt2	2007-04-30 22:26:40 UTC (rev 2621)
@@ -10,7 +10,7 @@
 [% END %]
 
 [% IF log.errindex %]
-<h2>autodetected error message in log</h2>
+<h2>autodetected possible error in log</h2>
   <ul>
   [% FOREACH err IN log.errindex -%]
     <li><a href="#[% err.linenum %]">[% err.content %]</a></li>

Modified: people/goneri/SvnBuildStat-WWW/root/src/packages/info.tt2
===================================================================
--- people/goneri/SvnBuildStat-WWW/root/src/packages/info.tt2	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/root/src/packages/info.tt2	2007-04-30 22:26:40 UTC (rev 2621)
@@ -14,14 +14,35 @@
   [% END -%]
 </table>
 
+<h2>URI</h2>
+<table>
+<tr>
+  <td><a href="[% uri %]">Repository</a></td>
+</tr>
+<tr [% IF ! istarballpresent %]class="warning"[% END %]>
+  [% IF istarballpresent %]
+  <a href="[% tarballuri %]">Tarball</a>
+  [% ELSE %]
+  Can't find the tarball
+  [% END %]
+</tr>
+</table>
+
+[% IF isindebian %]
+  <div>This release is in Debian</div>
+[% ELSE %]
+  <div>This release is not in Debian</div>
+[% END %]
+
+
 [% IF bugs %]
 <h2>Bugs</h2>
 <table>
   [% # Display each book in a table row %]
   [% FOREACH bug IN bugs -%]
-  <tr [% IF bug.warning %] class="bad"[% END %]>
+  <tr [% IF bug.warning %] class="warning"[% END %]>
     <td>
-      <a href="http://bugs.debian.org/[% bug.id %]">[% bug.name %]</a>
+      <a href="http://bugs.debian.org/[% bug.id %]">[% bug.id %]: [% bug.name %]</a>
     </td>
     <td>
       [% bug.severity %]
@@ -40,7 +61,7 @@
   [% # Display each book in a table row %]
   [% FOREACH build IN builds -%]
   <tr>
-    <td [% IF ! build.buildisok %] class="bad"[% END %]>
+    <td [% IF ! build.buildisok %] class="warning"[% END %]>
       [% IF build.buildisok %]
       <a href="[% Catalyst.uri_for('/logs/build/') _ build.id %]">Success</a>
       [% ELSE %]
@@ -69,26 +90,32 @@
 <a href="[% Catalyst.uri_for('/logs/piuparts/')  _ build.id %]">piuparts checks failed</a>
 [% END %]
 
-
+[% IF lintians %]
 <h2>lintian</h2>
-[% IF lintian %]
-<blockquote>
-  [% lintian %]
-</blockquote>
-[% ELSE %]
-lintian log is empty
+<table>
+  [% FOREACH lintian IN lintians %]
+  <tr>
+    <td [% IF lintian.warning %]class="warning"[% END %]>
+  [% lintian.text %]
+    </td>
+  </tr>
+  [% END -%]
+</table>
 [% END %]
 
+[% IF lindas %]
 <h2>linda</h2>
-[% IF linda %]
-<blockquote>
-  [% linda %]
-</blockquote>
-[% ELSE %]
-linda log is empty
+<table>
+  [% FOREACH linda IN lindas %]
+  <tr>
+    <td [% IF linda.warning %]class="warning"[% END %]>
+  [% linda.text %]
+    </td>
+  </tr>
+  [% END -%]
+</table>
 [% END %]
 
 [% ELSE %]
 Never built yet.
 [% END -%]
-

Modified: people/goneri/SvnBuildStat-WWW/root/src/packages/main.tt2
===================================================================
--- people/goneri/SvnBuildStat-WWW/root/src/packages/main.tt2	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/root/src/packages/main.tt2	2007-04-30 22:26:40 UTC (rev 2621)
@@ -15,15 +15,18 @@
 </h1>
 
 <table>
-<tr><th>Packages</th><th>Status</th><th>Linda</th><th>Lintian</th><th>Bugs</th></tr>
+<tr><th>Packages</th><th>Status</th><th>Linda</th><th>Lintian</th><th>Bugs</th><th>Release In Debian?</th></tr>
 [% # Display each book in a table row %]
 [% FOREACH package IN packages -%]
   <tr>
     <td>
     <a href="[% Catalyst.uri_for('info/') _ package.name %]"><strong>[% package.name %]</strong></a>
     </td>
-    <td [% IF !package.needbuild && !package.buildisok %]class="bad"[% END %]>
+    <td [% IF !package.istarballpresent || (!package.needbuild && !package.buildisok) %]class="warning"[% END %] [% IF package.buildisok %]class="ok"[% END %]>
     <a href="[% Catalyst.uri_for('info/') _ package.name %]">
+    [% IF ! package.istarballpresent %]
+        [% 'No tarball' %]
+    [% ELSE %]
       [% IF package.needbuild %]
         [% 'Need build' %]
       [% ELSE %]
@@ -33,23 +36,32 @@
 	  failed
         [% END %]
       [% END %]
+    [% END %]
       </a>
     </td>
-    <td [% IF package.lintianerrcount %] class="bad"[% END %]>
+    <td [% IF package.lintianerrcount %] class="warning"[% END %]>
     <a href="[% Catalyst.uri_for('info/') _ package.name %]">
         [% package.lintianerrcount %]
       </a>
     </td>
-    <td [% IF package.lindaerrcount %]class="bad" [% END %]>
+    <td [% IF package.lindaerrcount %]class="warning" [% END %]>
     <a href="[% Catalyst.uri_for('info/') _ package.name %]">
         [% package.lindaerrcount %]
       </a>
     </td>
-    <td [% IF package.bugwarning %]class="bad" [% END %]>
+    <td [% IF package.bugwarning %]class="warning" [% ELSE %] [% IF ! package.bugcount %] class="ok" [% END %][% END %]>
     <a href="[% Catalyst.uri_for('info/') _ package.name %]">
         [% package.bugcount %]
       </a>
     </td>
+    <td>
+    [% IF package.isindebian %]
+    Yes
+    [% ELSE %]
+    No
+    [% END %]
+      </a>
+    </td>
   </tr>
 [% END -%]
 </table>

Modified: people/goneri/SvnBuildStat-WWW/root/src/ttsite.css
===================================================================
--- people/goneri/SvnBuildStat-WWW/root/src/ttsite.css	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/root/src/ttsite.css	2007-04-30 22:26:40 UTC (rev 2621)
@@ -265,13 +265,13 @@
 
 .warning
 {
-    color: red;
+    background-color: #e49797;
     font-weight: bolder;
 }
 
 .ok
 {
-    color: green;
+    background-color: #54cb5d;
     font-weight: bolder;
 }
 

Modified: people/goneri/SvnBuildStat-WWW/script/svnbuildstat_agent.pl
===================================================================
--- people/goneri/SvnBuildStat-WWW/script/svnbuildstat_agent.pl	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/script/svnbuildstat_agent.pl	2007-04-30 22:26:40 UTC (rev 2621)
@@ -2,8 +2,6 @@
 use strict;
 
 use lib ".";
-use lib
-'/home/goneri/svn/pkg-games/people/goneri/svnbuildstat/www/SvnBuildStat-WWW/lib';
 
 use Data::Dumper;
 use Net::FTP;
@@ -72,20 +70,22 @@
 }
 my @tobuild = split /;/, $tobuild;
 my $package = $tobuild[0];
+$report{'source'} = $package;
 my $rev = $tobuild[1];
 my $tarballuri = $tobuild[2];
-my $svnbase = $tobuild[3];
+my $tarball = $tobuild[3];
+my $svnbase = $tobuild[4];
 
 if (!$package||!$svnbase||!$tarballuri) {
   print "Failed to parse the package information from ".
   $config->agent_source."/".$report{'arch'};
   exit 1
 }
-$tarballuri =~ s/\@DEBMIRROR\@/$config->debmirror/;
-my $pdebuildparam = "--buildplace $pbuilderplace --distribution $distro --basetgz $pbuilderplace/$distro.tar.gz";
-`pbuilder update $pdebuildparam >$reportarea/pbuilder-update.log 2>&1`;
+$tarballuri =~ s/\@DEBMIRROR\@/$config->agent_debmirror/;
+my $pdebuildparam = "--mirror ".$config->agent_debmirror." --buildplace $pbuilderplace --distribution $distro --basetgz $pbuilderplace/$distro.tar.gz";
+`/usr/sbin/pbuilder update $pdebuildparam >$reportarea/pbuilder-update.log 2>&1`;
 if (($? >> 8)!=0){
-  `pbuilder create $pdebuildparam >$reportarea/pbuilder-create.log 2>&1`;
+  `/usr/sbin/pbuilder create $pdebuildparam >$reportarea/pbuilder-create.log 2>&1`;
   if (($? >> 8)!=0) {
     print "Failed to create pbuilder image\n";
     exit 1
@@ -122,7 +122,7 @@
     }
   }
 
-  `cd $tarballsplace ; wget -c $tarballuri >$reportarea/wget.log 2>&1`;
+  `cd $tarballsplace ; wget -O $tarball -c \"$tarballuri\" >$reportarea/wget.log 2>&1`;
   if (($? >> 8)!=0) {
     $report{'download'} = "nok";
   } else {
@@ -136,7 +136,7 @@
       $report{build} = "ok"; 
       `cd $buildarea ; lintian --allow-root *.deb *.dsc > $reportarea/lintian.log`;
       `cd $buildarea ; linda --show-tag *.deb *.dsc 2>/dev/null > $reportarea/linda.log`;
-      `cd $buildarea ; piuparts -d etch -d lenny -d sid *.deb | grep -v DEBUG > $reportarea/piuparts.log`;
+      `cd $buildarea ; /usr/sbin/piuparts -d etch -d lenny -d sid *.deb | grep -v DEBUG > $reportarea/piuparts.log`;
     } else {
       $report{build} = "nok";
     }
@@ -155,9 +155,8 @@
 $ftp = Net::FTP->new($config->agent_ftphost, Debug => 0) or die "Cannot connect
 to ".$config->agent_ftphost.": $@";
 
-my $tarball = "$report{'source'}_$report{'svn_rev'}_$report{'arch'}_$hostname.tar.bz2";
+my $reporttarball = "$report{'source'}_$report{'svn_rev'}_$report{'arch'}_$hostname.tar.bz2";
 $ftp->login($config->agent_ftplogin,$config->agent_ftppassword) or die "Cannot login ", $ftp->message;
-print "cd $tmpdir ; cp -r $reportarea . ; tar cfj  $tarball report 2>&1\n";
-`cd $tmpdir ; cp -r $reportarea . ; tar cfj  $tarball report 2>&1`;
-$ftp->put($tmpdir."/".$tarball) or warn "Failed to send the report\n";
+`cd $tmpdir ; cp -r $reportarea . ; tar cfj  $reporttarball report 2>&1`;
+$ftp->put($tmpdir."/".$reporttarball) or warn "Failed to send the report\n";
 $ftp->close or warn "Failed to close the ftp connection to the server\n";

Modified: people/goneri/SvnBuildStat-WWW/script/svnbuildstat_import-new-report.pl
===================================================================
--- people/goneri/SvnBuildStat-WWW/script/svnbuildstat_import-new-report.pl	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/script/svnbuildstat_import-new-report.pl	2007-04-30 22:26:40 UTC (rev 2621)
@@ -2,13 +2,9 @@
 
 use strict;
 
-use lib ".";
-use lib
-'/home/goneri/svn/pkg-games/people/goneri/svnbuildstat/www/SvnBuildStat-WWW/lib';
+use lib '/usr/local/www/sites/nana.rulezlan.org/svnbuildstat/lib';
 use File::Glob ':globally';
 
-use DateTime;
-use DateTime::TimeZone;
 use File::stat;
 
 use SvnBuildStat::Config;
@@ -32,7 +28,7 @@
     " $_ doesn't exist.\n";
     next;
   }
-  push @reporttarball, <$_/*.tar.bz2>;
+  push @reporttarball, <$_/*.tar>;
   push @lockfile, <$_/*.lock>;
 }
 my $workdir = $config->report_workdir();
@@ -72,7 +68,7 @@
 # Load the new report
 foreach my $reporttarball (@reporttarball) {
   print localtime().": new report".$reporttarball."\n";
-  `cd $workdir && tar xfjv $reporttarball`;
+  `cd $workdir && tar xf $reporttarball`;
 
   my %report;
   if (!open INFO, "<$workdir/report/info") {

Modified: people/goneri/SvnBuildStat-WWW/script/svnbuildstat_update-bugs.pl
===================================================================
--- people/goneri/SvnBuildStat-WWW/script/svnbuildstat_update-bugs.pl	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/script/svnbuildstat_update-bugs.pl	2007-04-30 22:26:40 UTC (rev 2621)
@@ -5,10 +5,7 @@
 use Net::LDAP;
 use Data::Dumper;
 
-use lib '.';
-use lib
-'/home/goneri/svn/pkg-games/people/goneri/svnbuildstat/www/SvnBuildStat-WWW/lib';
-
+use lib '/usr/local/www/sites/nana.rulezlan.org/svnbuildstat/lib';
 use SvnBuildStat::Schema;
 use SvnBuildStat::Config;
 

Modified: people/goneri/SvnBuildStat-WWW/script/svnbuildstat_update-db.pl
===================================================================
--- people/goneri/SvnBuildStat-WWW/script/svnbuildstat_update-db.pl	2007-04-30 15:40:03 UTC (rev 2620)
+++ people/goneri/SvnBuildStat-WWW/script/svnbuildstat_update-db.pl	2007-04-30 22:26:40 UTC (rev 2621)
@@ -7,9 +7,7 @@
 use Data::Dumper;
 use File::Basename;
 
-use lib '.';
-use lib
-'/home/goneri/svn/pkg-games/people/goneri/svnbuildstat/www/SvnBuildStat-WWW/lib';
+use lib '/usr/local/www/sites/nana.rulezlan.org/svnbuildstat/lib';
 use SvnBuildStat::Schema;
 use SvnBuildStat::Config;
 
@@ -49,7 +47,6 @@
 
 sub importPkg {
   my( $repository, $uri, $rev, $tarballinrepository) = @_;
-print "O>$uri\n";
 
   my @maintainer;
   my $packagesrc;
@@ -85,13 +82,10 @@
   if (@changelog && $changelog[0] =~ /^.*\ \((.*)\)/) {
     $package->svndebrelease($1);
     my $tarball = mkTarballFromPackage(\$package);
-print "tarball ".$tarball."\n";
-print Dumper($tarballinrepository);
     if (exists $tarballinrepository->{$tarball}) {
       $tarballuri = $tarballinrepository->{$tarball};
       # I convert the svn:// uri to a http one
       $tarballuri =~ s!svn://svn.debian.org/svn/(.*)!http://svn.debian.org/wsvn/$1?op=file&rev=0&sc=0!;
-print " >$tarballuri\n";
     } elsif ($$repository->tarballlayout) { # Else I try find the tarball with the tarballlayout
       $tarballuri = $$repository->tarballlayout;
       $tarballuri =~ s/\@TARBALL@/$tarball/;
@@ -101,8 +95,8 @@
     }
   }
 
+  $package->uri($uri);
   $package->tarballuri($tarballuri);
-  $package->svndebrelease($svndebrelease);
 
   $package->rev($rev);
   $package->repository_id($$repository);
@@ -122,32 +116,32 @@
   my $istarballpresent = 0;
   my $isindebian = 0;
 
-  my $name = $$package->name;
-  my $svndebrelease = $$package->svndebrelease;
+  return unless $$package->name;
 
   my $ua = LWP::UserAgent->new;
   $ua->agent("SvnBuildStat/0.1 ");
 
   # This code should provably me moved somewhere else
-  if ($name && $svndebrelease) {
-    my $debmirror = 'http://ftp.debian.org/debian';
-    my $debdiff .= "$name"."_".$svndebrelease.".diff.gz";
-    my $tarball = mkTarballFromPackage($package);
-    foreach my $section (qw/main contrib non-free/) {
-      my $tmp = "/$1/$name" if $$package->name =~ /^(.)/;
-      my $debdiffuri = $debmirror.'/pool/'.$section.$tmp.'/'.$debdiff;
-      my $tarballuri = $debmirror.'/pool/'.$section.$tmp.'/'.$tarball;
-      my $req = HTTP::Request->new(HEAD => $debdiffuri);
-      my $res = $ua->request($req);
-      $$package->isindebian(1) if $res->is_success;
+  my $debmirror = 'http://ftp.debian.org/debian';
+  my $debdiff .= $$package->name."_".$$package->svndebrelease.".diff.gz";
+  my $tarball = mkTarballFromPackage($package);
+  foreach my $section (qw/main contrib non-free/) {
+    my $tmp = "/$1/".$$package->name if $$package->name =~ /^(.)/;
+    my $debdiffuri = $debmirror.'/pool/'.$section.$tmp.'/'.$debdiff;
+    my $tarballuri = $debmirror.'/pool/'.$section.$tmp.'/'.$tarball;
+#    print "Looking for debdiff :".$debdiffuri."\n";
+    my $req = HTTP::Request->new(HEAD => $debdiffuri);
+    my $res = $ua->request($req);
+    $$package->isindebian(1) if $res->is_success;
 
-      $req = HTTP::Request->new(HEAD => $tarballuri);
-      $res = $ua->request($req);
-      if ($res->is_success) {
-	$$package->istarballpresent(1);
-	$$package->tarballuri('@DEBMIRROR@/'.$section.$tmp);
-	print "OK in Debian\n";
-      }
+#    print "Looking for tarball :".$tarballuri."\n";
+    $req = HTTP::Request->new(HEAD => $tarballuri);
+    $res = $ua->request($req);
+    if ($res->is_success) {
+      $istarballpresent = 1;
+      $$package->tarballuri('@DEBMIRROR@/pool/'.$section.$tmp.'/'.$tarball);
+      print "OK in Debian\n";
+      last;
     }
   }
 
@@ -185,15 +179,16 @@
   print "Repository: ".$repository->name."\n";
   my $t = $ctx->ls($repository->uri,'HEAD',1);
   foreach  (keys %$t) {
-    my $uri = $repository->uri.'/'.$_;
+   my $uri = $repository->uri.'/'.$_;
     $uri =~ s/\/$//;
-    $tarballinrepository->{basename($_)}=$uri if /\.tar\.gz/;
+    $tarballinrepository->{basename($_)}=$uri if /\.tar\.gz$/;
 
     # look for packages
     next if /branche/; # I want trunk !
+    next unless /debian\/control$/; # I want trunk !
     my $rev = $t->{$_}->created_rev;
-    next unless $uri =~ s/debian\/control$//;
-    print $uri."\n";
+    $uri =~ s/(|\/)debian\/control$//;
+    print "->".$uri."\n";
     importPkg(\$repository,$uri,$rev, $tarballinrepository);
   }
 }




More information about the Pkg-games-commits mailing list