[Collab-qa-commits] r352 - in svnbuildstat: . script

goneri-guest at alioth.debian.org goneri-guest at alioth.debian.org
Wed Jul 25 17:38:59 UTC 2007


Author: goneri-guest
Date: 2007-07-25 17:38:59 +0000 (Wed, 25 Jul 2007)
New Revision: 352

Added:
   svnbuildstat/script/
   svnbuildstat/script/clean.pl
   svnbuildstat/script/svn:external
   svnbuildstat/script/svnbuildstat_agent.pl
   svnbuildstat/script/svnbuildstat_import-new-report.pl
   svnbuildstat/script/svnbuildstat_purge-buildinprogress.pl
   svnbuildstat/script/svnbuildstat_update-bugs.pl
   svnbuildstat/script/svnbuildstat_update-db.pl
   svnbuildstat/script/svnbuildstat_www_cgi.pl
   svnbuildstat/script/svnbuildstat_www_create.pl
   svnbuildstat/script/svnbuildstat_www_fastcgi.pl
   svnbuildstat/script/svnbuildstat_www_server.pl
   svnbuildstat/script/svnbuildstat_www_test.pl
Log:
add the script directory


Added: svnbuildstat/script/clean.pl
===================================================================
--- svnbuildstat/script/clean.pl	                        (rev 0)
+++ svnbuildstat/script/clean.pl	2007-07-25 17:38:59 UTC (rev 352)
@@ -0,0 +1,39 @@
+#!/usr/bin/perl -w
+use strict;
+
+use lib '/home/sites/svnbuildstat.debian.net/svnbuildstat/lib';
+use SvnBuildStat::Schema;
+use SvnBuildStat::Config;
+
+
+my $pkgname = shift;
+
+
+
+my $config = new SvnBuildStat::Config();
+my $schema = SvnBuildStat::Schema->connect(
+  $config->db_dsn,
+  $config->db_user,
+  $config->db_password,
+  {AutoCommit => 1, debug => 1}
+);
+
+
+
+my $package = $schema->resultset('Package')->search({name => $pkgname})->first;
+die unless $package;
+
+my $build_rs = $schema->resultset('Build')->search({package_id => $package->id, rev => $package->rev});
+
+$build_rs->delete_all;
+while (my $build = $build_rs->next) {
+print "->".$build->id."\n";
+}
+
+## Import packages
+#my $repository_rs = $schema->resultset('Repository')->search({enabled => 'true'});
+#while (my $repository = $repository_rs->next) {
+#  # importRepository(\$repository);
+#  $poolImportRepository->add(\$repository) or die "Fucked\n";
+#}#
+#print "threads launched\n";


Property changes on: svnbuildstat/script/clean.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: svnbuildstat/script/svn:external
===================================================================
--- svnbuildstat/script/svn:external	                        (rev 0)
+++ svnbuildstat/script/svn:external	2007-07-25 17:38:59 UTC (rev 352)
@@ -0,0 +1 @@
+svn propget -R svn:externals  svn://svn.debian.org/svn/pkg-kde/trunk/packages

Added: svnbuildstat/script/svnbuildstat_agent.pl
===================================================================
--- svnbuildstat/script/svnbuildstat_agent.pl	                        (rev 0)
+++ svnbuildstat/script/svnbuildstat_agent.pl	2007-07-25 17:38:59 UTC (rev 352)
@@ -0,0 +1,222 @@
+#!/usr/bin/perl -w
+use strict;
+
+use lib ".";
+
+use Data::Dumper;
+use Net::FTP;
+use File::Glob ':globally';
+use Sys::Hostname;
+use SvnBuildStat::Config;
+use LWP::Simple;
+
+###########################################################################
+###########################################################################
+###########################################################################
+my $config = new SvnBuildStat::Config();
+
+my $RELEASE = "0.0.1";
+my $hostname = hostname();
+my $distro = "sid";
+my $isnative;
+
+if ($config->agent_vardir !~ /\/.+/) {
+  die "vardir not correclty set in the [agent] section";
+}
+my $workplace = $config->agent_vardir."/workplace";
+my $pbuilderplace = $config->agent_vardir."/pbuilder";
+my $tarballsplace = $config->agent_vardir."/tarballs";
+my $buildarea = $config->agent_vardir."/build-area";
+my $reportarea = $config->agent_vardir."/report";
+my $tmpdir = $config->agent_vardir."/tmp";
+my $ccachedir = $config->agent_vardir."/ccache";
+my $aptcachedir = $config->agent_vardir."/aptcache";
+$ENV{LC_ALL} = 'C';
+$ENV{LANG} = 'C';
+
+die "please create: `".$config->agent_vardir unless -d
+$config->agent_vardir;
+# Purge 
+if (-d $workplace) {`rm -r $workplace`;}
+if (-d $buildarea) {`rm -r $buildarea`;}
+if (-d $reportarea) {`rm -r $reportarea`;}
+if (-d $tmpdir) {`rm -r $tmpdir`;}
+# Create the directorys
+die if (!-d $workplace && !mkdir $workplace);
+die if (!-d $buildarea && !mkdir $buildarea);
+die if (!-d $reportarea && !mkdir $reportarea);
+die if (!-d $pbuilderplace && !mkdir $pbuilderplace);
+die if (!-d $tarballsplace && !mkdir $tarballsplace);
+die if (!-d $tmpdir && !mkdir $tmpdir);
+die if (!-d $ccachedir && !mkdir $ccachedir);
+die if (!-d $ccachedir."/cache" && !mkdir $ccachedir."/cache");
+die if (!-d $aptcachedir && !mkdir $aptcachedir);
+unlink foreach (<$tmpdir/report*.tar>);
+
+open CCACHECFG, ">$ccachedir/ccache.cfg" or die;
+print CCACHECFG "export CCACHE_DIR=\"$ccachedir/cache\"\n";
+print CCACHECFG "export PATH=\"/usr/lib/ccache:\${PATH}\"\n";
+print CCACHECFG "export CCACHE_NOCOMPRESS=\"1\"\n";
+print CCACHECFG "EXTRAPACKAGES=ccache\n";
+print CCACHECFG "BINDMOUNTS=\"\${CCACHE_DIR}\"\n";
+# --buildresult foo doesn't work?
+print CCACHECFG "BUILDRESULT=\"$tmpdir\"\n"; 
+close CCACHECFG;
+
+my %report;
+chomp ($report{'arch'} = `dpkg-architecture -qDEB_HOST_ARCH`);
+$report{'buildadminaddr'} = $config->agent_buildadminaddr;
+$report{hostname} = $hostname;
+$report{distro} = $distro;
+
+$report{'agent_release'} = $RELEASE;
+$report{'svnbp_release'} = `dpkg-query -W -f='\${Version}' svn-buildpackage`;
+$report{'linda_release'} = `dpkg-query -W -f='\${Version}' linda`;
+$report{'lintian_release'} = `dpkg-query -W -f='\${Version}' lintian`;
+$report{'pbuilder_release'} = `dpkg-query -W -f='\${Version}' pbuilder`;
+$report{'subversion_release'} = `dpkg-query -W -f='\${Version}' subversion`;
+$report{'piuparts_release'} = `dpkg-query -W -f='\${Version}' piuparts`;
+###########################################################################
+###########################################################################
+###########################################################################
+
+my $tobuild = LWP::Simple::get($config->agent_source."/".$report{'arch'});
+if (!$tobuild) {
+  print "Failed to contact the serveur to get a package to build\n";
+  exit 1;
+}
+my @tobuild = split /;/, $tobuild;
+my $package = $tobuild[0];
+$report{'source'} = $package;
+my $tarballuri = $tobuild[1];
+my $tarball = $tobuild[2];
+my $svnbase = $tobuild[3];
+$isnative = 1 unless ($tarballuri || $tarball);
+if (!$package||!$svnbase) {
+  print "Failed to parse the package information from ".
+  $config->agent_source."/".$report{'arch'}."\n";
+  exit 1
+}
+my $t = $config->agent_debmirror;
+my $pdebuildparam = "--mirror ".$config->agent_debmirror." --buildplace $pbuilderplace --othermirror 'deb ".$config->agent_debmirror." $distro main contrib non-free' --distribution $distro --basetgz $pbuilderplace/$distro.tar.gz";
+`/usr/sbin/pbuilder update $pdebuildparam >$reportarea/pbuilder-update.log 2>&1`;
+if (($? >> 8)!=0){
+  print "`/usr/sbin/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
+  }
+}
+foreach (`LC_ALL=C svn info $svnbase`) {
+	$report{'svn_rev'} = $1 if /Last Changed Rev:\ (\d+)/;
+}
+`svn co $svnbase $workplace >$reportarea/svn.log 2>&1`;
+my @tmp = `cd $workplace ; svn log -q --limit 1`;
+foreach (`LC_ALL=C svn info $svnbase`) {
+	if (/Last Changed Rev:\ (\d+)/) {
+		if( $report{'svn_rev'} ne $1 ) {
+			print "HACK: svn info> rev changed during checkout\n";
+			exit;
+		}
+	}
+}
+
+
+my $ftp = Net::FTP->new($config->agent_ftphost, Debug => 0) or die "Cannot connect
+to ".$config->agent_ftphost.": $@";
+
+$ftp->login($config->agent_ftplogin,$config->agent_ftppassword) or die "Cannot login ", $ftp->message;
+
+print "package: $package\n";
+if (!$ftp->appe($package."_".$report{'svn_rev'}."_".$report{'arch'}."_".$distro.".lock")) {
+  print "package: $package already locked by a buildbot\n";
+  exit 1;
+}
+$ftp->close;
+
+if (!open CTRL, "<$workplace/debian/control") {
+  $report{checkout} = 'nok';
+} else {
+  $report{checkout} = 'ok';
+  close CTRL;
+
+  foreach (`cd $workplace ; dpkg-parsechangelog 2>&1`) {
+    if (/Source: (.+)/) {
+      $report{'source'} = $1;
+    } elsif (/Version: (.+?)(-.+|$)/) {
+      $report{'release'} = $1;
+    }
+  }
+
+
+  if ($isnative) {
+    $report{'download'} = "native";
+  } else {
+  $tarballuri =~ s/\@DEBMIRROR\@/$t/;
+  `cd $tarballsplace ; wget -O $tarball -c \"$tarballuri\" >$reportarea/wget.log 2>&1`;
+  `tar tf $tarballsplace/$tarball`;
+  if (($? >> 8)!=0) {
+    print "download nok\n";
+    $report{'download'} = "nok";
+    unlink $tarballsplace."/".$tarball;
+  } else {
+  print "download ok\n";
+    $report{'download'} = "ok";
+    }
+  }
+
+
+  if ($report{'download'} ne "nok") {
+    $report{'stamp_build-start'} = time;
+
+# If the there is just a debian directory I assum it's a mergeWithUpstream layout and I add the property
+    if (!grep (!/^debian$/, `/bin/ls $workplace`)) {
+      `cd $workplace; svn propset mergeWithUpstream 1 debian`;
+    }
+
+    `cd $workplace ; svn-buildpackage --svn-ignore-new --svn-builder "pdebuild --use-pdebuild-internal --configfile $ccachedir/ccache.cfg -- --buildplace $pbuilderplace --aptcache $aptcachedir --distribution $distro --basetgz $pbuilderplace/$distro.tar.gz" --svn-override=origDir=$tarballsplace --svn-override=buildArea=$buildarea --svn-noninteractive >$reportarea/build.log.tmp 2>&1`;
+    $report{'stamp_build-end'} = time;
+
+# To avoid breakage with tar on the service side, I do some clean up in the logs
+    open BUILDLOGTMP, "<$reportarea/build.log.tmp" or die;
+    open BUILDLOG, ">$reportarea/build.log" or die;
+    foreach (<BUILDLOGTMP>) {
+	    s/[[:cntrl:]]//g;
+	    print BUILDLOG $_."\n";
+    }
+
+    close BUILDLOGTMP;
+    close BUILDLOG;
+    unlink "$reportarea/build.log.tmp";
+
+
+    if (<$buildarea/*.deb>) {
+      $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 ; /usr/sbin/piuparts *.deb | grep -v DEBUG > $reportarea/piuparts.log`;
+      $report{piuparts} = (($? >> 8)==0)?'ok':'nok';
+    } else {
+      $report{build} = "nok";
+    }
+  }
+}
+
+# Prepare and send the report
+open BUILDREPORT,">".$reportarea."/info";
+foreach (sort keys %report) {
+  chomp $report{$_};
+
+  print BUILDREPORT $_."=".$report{$_}."\n";
+}
+close BUILDREPORT;
+
+$ftp = Net::FTP->new($config->agent_ftphost, Debug => 0) or die "Cannot connect
+to ".$config->agent_ftphost.": $@";
+
+my $reporttarball = "$report{'source'}_$report{'svn_rev'}_$report{'arch'}_$hostname.tar";
+$ftp->login($config->agent_ftplogin,$config->agent_ftppassword) or die "Cannot login ", $ftp->message;
+`cd $tmpdir ; cp -r $reportarea . ; tar cf  $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";


Property changes on: svnbuildstat/script/svnbuildstat_agent.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: svnbuildstat/script/svnbuildstat_import-new-report.pl
===================================================================
--- svnbuildstat/script/svnbuildstat_import-new-report.pl	                        (rev 0)
+++ svnbuildstat/script/svnbuildstat_import-new-report.pl	2007-07-25 17:38:59 UTC (rev 352)
@@ -0,0 +1,255 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use lib '/home/sites/svnbuildstat.debian.net/svnbuildstat/lib';
+use File::Glob ':globally';
+
+use Encode;
+use File::stat;
+use File::Copy;
+
+
+use SvnBuildStat::Config;
+use SvnBuildStat::Schema;
+
+use Data::Dumper;
+my $config = new SvnBuildStat::Config();
+my $schema = SvnBuildStat::Schema->connect(
+  $config->db_dsn,
+  $config->db_user,
+  $config->db_password,
+  {AutoCommit => 1, debug => 1}
+);
+
+my @sourcedir;
+my @reporttarball;
+my @lockfile;
+foreach (split / /,$config->report_sourcedir()) {
+  if (!-d) {
+    print STDERR "Error in the sourcedir section of the config file.".
+    " $_ doesn't exist.\n";
+    next;
+  }
+  push @reporttarball, <$_/*.tar>;
+  push @lockfile, <$_/*.lock>;
+}
+my $workdir = $config->report_workdir();
+my $rejecteddir = $config->report_rejecteddir();
+
+die "Please create `$workdir' directory." unless -d $workdir;
+die "Please create `$rejecteddir' directory." unless -d $rejecteddir;
+
+my $build_rs = $schema->resultset('Build');
+# Park the locked package as being
+foreach my $lockfile (@lockfile) {
+  if ($lockfile =~ /.*\/(.+)_(\d+)_(.+)_(.+)\.lock$/) {
+    my $packagesrc = $1;
+    my $rev = $2;
+    my $archname = $3;
+    my $distro = $4;
+
+    print "store the distro: ($distro)\n";
+    
+    my $package = $schema->resultset('Package')->search({name => $packagesrc})->first;
+    my $arch = $schema->resultset('Arch')->find_or_create({name => $archname});
+
+    if ($package) {
+      my $build = $schema->resultset('Build')->find_or_create({
+	  package_id => $package->id,
+	  arch_id => $arch->id,
+	  rev => $rev,
+	});
+
+      if ($build->host_id) { # a completed build exist already
+	unlink ($lockfile) or warn "Failed to unlink $lockfile\n";
+      } else {
+	$build->time('now');
+	$build->isbuildinprogress ('true');
+	$build->update;
+      }
+    }
+  }
+}
+# Load the new report
+foreach my $reporttarball (@reporttarball) {
+
+  my $st = stat($reporttarball);
+  if ((!$reporttarball =~ /.*\/(.+)_(\d+)_(.+)_(.+)\.tar$/) ||
+  !$st || ($st->mtime < time - 3600)) {
+  move($reporttarball, $rejecteddir);
+
+    next;
+  }
+  print localtime().": new report ".$reporttarball."\n";
+  `cd $workdir && tar xf $reporttarball`;
+
+  my %report;
+  if (!open INFO, "<$workdir/report/info") {
+    move($reporttarball, $rejecteddir);
+    `rm -r $workdir/report`;
+    next;
+  }
+  foreach (<INFO>) {
+    $report{$1} = $2 if (/(.*)=(.*)/);
+  }
+  close INFO;
+
+  foreach my $logfile (qw/build.log lintian.log linda.log piuparts.log/) {
+    if (open TMP, "<$workdir/report/$logfile") {
+      $report{$logfile} = '';
+      foreach (<TMP>) {
+	$report{$logfile} .= encode("UTF-8", $_);
+      }
+      close TMP;
+    } else {
+      $report{$logfile} = undef; 
+    }
+  }
+
+  my $package = $schema->resultset('Package')->search({name =>
+      $report{source}})->first;
+  die unless $package;
+
+  my $host = $schema->resultset('Host')->find_or_create(name => $report{hostname},
+    arch => $report{arch});
+  my $arch = $schema->resultset('Arch')->find_or_create(name => $report{arch});
+
+
+  my $build = $schema->resultset('Build')->find_or_create({
+      package_id => $package->id,
+      arch_id => $arch->id,
+      rev => $report{svn_rev},
+    });
+  $build->time('now');
+  $build->update;
+  $build->isbuildinprogress('false');
+  $build->update;
+  $build->set_from_related('host_id', $host);
+  $build->update;
+  $build->svndebrelease ($report{release});
+  $build->update;
+  $build->buildisok ($report{build} eq "ok"?"true":"false");
+  $build->update;
+  $build->checkoutisok ($report{checkout} eq "ok"?"true":"false");
+  $build->update;
+  $build->downloadisok ($report{download} eq "ok"?"true":"false");
+  $build->update;
+  $build->duration
+  ($report{'stamp_build-end'}-$report{'stamp_build-start'});
+  $build->update;
+  $build->build_log ($report{'build.log'});
+  $build->update;
+  $build->lintian_log ($report{'lintian.log'});
+  $build->update;
+#  $report{'linda.log'} =~ s/(.+The character ').+(' is forbidden.+)/$1 $2/g;
+  $build->update;
+  $build->linda_log ($report{'linda.log'});
+  $build->update;
+  $build->piuparts_log ($report{'piuparts.log'});
+  $build->update;
+  $build->lintian_release ($report{lintian_release});
+  $build->update;
+  $build->linda_release ($report{linda_release});
+  $build->piuparts_release ($report{piuparts_release});
+  $build->update;
+  $build->svnbp_release ($report{'svnbp_release'});
+  $build->pbuilder_release ($report{pbuilder_release});
+  $build->update;
+  $build->agent_release ($report{agent_release});
+  $build->update;
+
+
+  # lintian
+  my %lintian;
+  if ($report{'lintian.log'}) {
+    foreach (split $/, $report{'lintian.log'}) {
+      $lintian{$2} = $1 if (/^(.): \S*: (\S*)/);
+    }
+  }
+
+  my @lintian;
+  foreach (keys %lintian) {
+    my $iserror = ($lintian{$_} eq "E")?1:0;
+
+    my $lintian= $schema->resultset('Lintian')->find_or_create(name => $_);
+    $lintian->iserror($iserror);
+    my $build_lintian =
+    $build->find_or_create_related('build_lintians', {
+	lintian_id => $lintian->id});
+    $lintian->update();
+  }
+
+  # linda
+  my %linda;
+  if ($report{'linda.log'}) {
+    foreach (split $/, $report{'linda.log'}) {
+      $linda{$2} = $1 if (/^(.):.*\((\S*)\)$/);
+    }
+  }
+
+  # Update package rev just in case it'd been updated during the build
+  my $svnbase = $package->uri;
+  foreach (`LC_ALL=C svn info $svnbase`) {
+    if (/Last Changed Rev:\ (\d+)/) {
+      $package->rev($1); 
+      last;
+    }
+  }
+
+  $package->update;
+  $package->update;
+
+  my @linda;
+  foreach (keys %linda) {
+    my $iserror = ($linda{$_} eq "E")?1:0;
+
+    my $linda= $schema->resultset('Linda')->find_or_create(name => $_);
+    $linda->iserror($iserror);
+    my $build_linda =
+    $build->find_or_create_related('build_lindas', {
+	linda_id => $linda->id});
+    $linda->update();
+  }
+
+  # piuparts 
+  if ($report{'piuparts.log'}) {
+    foreach (split $/, $report{'piuparts.log'}) {
+      $build->piupartsisok(1) if (/INFO: PASS: All tests./);
+    }
+  }
+
+
+  $build->update;
+
+  my $lockfile = $package->name."_".$report{svn_rev}."_".$report{source}.".lock";
+  foreach (@lockfile) {
+    if (/$lockfile/) {
+      unlink ($_) or warn "Can't unlink $_\n";
+    }
+  }
+  unlink $reporttarball or warn "Can't unlink $reporttarball\n";
+
+  `rm -r $workdir/report`;
+  unlink $reporttarball;
+}
+
+### PURGE
+foreach (@lockfile) {
+
+  my $sb = stat($_);
+  next unless $sb;
+  unlink $_ if (time - $sb->mtime > 3600*4);
+
+}
+
+$build_rs = $schema->resultset('Build')->search({
+    isbuildinprogress => 'true'
+  });
+
+#TODO
+#while (my $build = $build_rs->next) {
+#  $build->delete if (time - $build->time > 3600*4);
+#}
+
+


Property changes on: svnbuildstat/script/svnbuildstat_import-new-report.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: svnbuildstat/script/svnbuildstat_purge-buildinprogress.pl
===================================================================
--- svnbuildstat/script/svnbuildstat_purge-buildinprogress.pl	                        (rev 0)
+++ svnbuildstat/script/svnbuildstat_purge-buildinprogress.pl	2007-07-25 17:38:59 UTC (rev 352)
@@ -0,0 +1,63 @@
+#!/usr/bin/perl -w
+use strict;
+
+use Time::Local;
+
+use lib '/home/sites/svnbuildstat.debian.net/svnbuildstat/lib';
+use SvnBuildStat::Schema;
+use SvnBuildStat::Config;
+
+my $config = new SvnBuildStat::Config();
+my $schema = SvnBuildStat::Schema->connect(
+  $config->db_dsn,
+  $config->db_user,
+  $config->db_password,
+  {AutoCommit => 1, debug => 1}
+);
+sub postgresTimeToUnix {
+  my $time = shift;
+  if ( $time ) {
+    my ($year, $mon, $day, $hour, $min, $sec) = ($time =~ /(\d{4})-(\d{2})-(\d{2})\ (\d{1,2}):(\d{2}):(\d{2})/);
+    return timelocal($sec, $min, $hour, $day, $mon, $year);
+  }
+  0
+}
+
+sub purgePkg {
+  my $package = shift;
+  print "purge".$$package->name."\n";
+
+  $schema->resultset('Build')->search({package_id => $$package->id})->delete_all;
+  $schema->resultset('PackageMaintainer')->search({package_id => $$package->id})->delete_all;
+  $schema->resultset('Package')->search({id => $$package->id})->delete_all;
+}
+
+
+$schema->resultset('Build')->search({isbuildinprogress => 1})->delete_all;
+
+#my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time)
+# 2007-06-21 18:05:31.516643
+#my $time = "$year-$mon-$mday $hour-$min-$sec";
+
+my $repository_rs = $schema->resultset('Repository');
+while (my $repository = $repository_rs->next) {
+  print $repository->name."\n";
+
+  my $package_rs = $schema->resultset('Package')->search({repository_id => $repository->id});
+
+  while (my $package = $package_rs->next) {
+    if (postgresTimeToUnix($package->lastcheck) < postgresTimeToUnix($repository->lastcheck) - 3600 * 48) {
+      purgePkg(\$package);
+    }
+  }
+}
+#
+#while (my $package = $package_rs->next) {
+#  my $lastcheck = 0;
+#  if ( $package->lastcheck ) {
+#    my ($year, $mon, $day, $hour, $min, $sec) = ($package->lastcheck =~ /(\d{4})-(\d{2})-(\d{2})\ (\d{1,2}):(\d{2}):(\d{2})/);
+#    $lastcheck = timelocal($sec, $min, $hour, $day, $mon, $year);
+#  }
+#  print "removing ".$package->name."\n";
+#  $package->delete ({'cascade_delete' => 1});
+#}


Property changes on: svnbuildstat/script/svnbuildstat_purge-buildinprogress.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: svnbuildstat/script/svnbuildstat_update-bugs.pl
===================================================================
--- svnbuildstat/script/svnbuildstat_update-bugs.pl	                        (rev 0)
+++ svnbuildstat/script/svnbuildstat_update-bugs.pl	2007-07-25 17:38:59 UTC (rev 352)
@@ -0,0 +1,68 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use LWP::Simple;
+use Data::Dumper;
+use File::Temp qw/ tempfile /;
+
+use lib '/home/sites/svnbuildstat.debian.net/svnbuildstat/lib';
+
+#"http://qa.debian.org/data/bts2ldap/fullindex";
+use SvnBuildStat::Schema;
+use SvnBuildStat::Config;
+
+
+my $config = new SvnBuildStat::Config();
+my $schema = SvnBuildStat::Schema->connect(
+  $config->db_dsn,
+  $config->db_user,
+  $config->db_password,
+  {AutoCommit => 1, debug => 1}
+);
+
+my %currentPackage;
+my $package_rs = $schema->resultset('Package');
+while( my $package = $package_rs->next) {
+  $currentPackage{$package->name} = 1;
+}
+my $tmpfile = "/tmp/fullindex".$$;
+
+unlink $tmpfile;
+die if (!is_success( getstore("http://qa.debian.org/data/bts2ldap/fullindex", $tmpfile)));
+print "download ok\n";
+my %registredPackage;
+
+open BTS2LDAP, "<$tmpfile" or die;
+print "updating\n";
+my %h;
+LINE: while (my $line = readline BTS2LDAP) {
+  if ($line =~ /^$/) {
+    if ($h{debbugsSourcePackage} && exists ($currentPackage{$h{debbugsSourcePackage}})) {
+      if (!($h{debbugsTag} && $h{debbugsTag} =~ /(pending|wontfix|unreproducible|moreinfo)/)&& $h{debbugsState} =~ /open/) {
+
+	my $package = $schema->resultset('Package')->search({name => $h{debbugsSourcePackage}})->first;
+	my $severity = $schema->resultset('Severity')->find_or_create({name=>$h{debbugsSeverity}});
+	my $bug = $schema->resultset('Bug')->find_or_create({bug_id => $h{debbugsID}});
+
+	$bug->severity_id ($severity->id);
+	$bug->package_id ($package->id);
+	$bug->name ($h{debbugsTitle});
+	$bug->update;
+
+	$registredPackage{$h{debbugsID}} = 1;
+      }
+    }
+    %h = ();
+  }
+
+  next unless $line =~ /^(debbugsID|debbugsSourcePackage|debbugsState|debbugsTitle|debbugsTag|debbugsSeverity):/;
+  chomp($line);
+  $h{$1} = $2 if ($line =~ /(\w+): (.+)$/);
+}
+close BTS2LDAP;
+unlink $tmpfile;
+my $bug_rs = $schema->resultset('Bug');
+while( my $bug = $bug_rs->next) {
+  $bug->delete unless exists ($registredPackage{$bug->id});
+}


Property changes on: svnbuildstat/script/svnbuildstat_update-bugs.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: svnbuildstat/script/svnbuildstat_update-db.pl
===================================================================
--- svnbuildstat/script/svnbuildstat_update-db.pl	                        (rev 0)
+++ svnbuildstat/script/svnbuildstat_update-db.pl	2007-07-25 17:38:59 UTC (rev 352)
@@ -0,0 +1,333 @@
+#!/usr/bin/perl -w
+use File::Temp qw/ tempfile /;
+
+use strict;
+
+use LWP::UserAgent;
+use Data::Dumper;
+use File::Basename;
+use Time::Local;
+
+use threads;
+use threads::shared;
+use Thread::Pool::Simple;
+
+use Thread::Pool::Simple;
+use lib '/home/sites/svnbuildstat.debian.net/svnbuildstat/lib';
+use SvnBuildStat::Schema;
+use SvnBuildStat::Config;
+
+my $config;
+my $schema;
+
+my $poolImportPkg;
+
+sub getRev {
+  my $uri = shift;
+
+  foreach (`LC_ALL=C svn info $uri`) {
+    return $1 if /Last Changed Rev:\ (\d+)/;
+  }
+
+  return;
+} 
+sub mkTarballFromPackage {
+  my $package = shift;
+
+  my $majorrelease = $$package->svndebrelease;
+  $majorrelease =~ s/^\d+://;
+  $majorrelease =~ s/-[+0-9A-Za-z\.~]*$//;
+
+  $$package->name.'_'.$majorrelease.".orig.tar.gz";
+}
+
+sub testUrl {
+  my $url = shift;
+  return unless $url;
+
+  my $req = HTTP::Request->new(HEAD => $url);
+  my $ua = LWP::UserAgent->new;
+  $ua->agent("SvnBuildStat/0.1 ");
+  my $res = $ua->request($req);
+  $res->is_success;
+
+}
+
+sub createTarballUrlFromTarballlayout {
+  my ($repository, $package) = @_;
+
+  return unless $$repository->tarballlayout;
+  my $packagename =  $$package->name;
+  my $tarball = mkTarballFromPackage($package);
+  my $tarballuri = $$repository->tarballlayout;
+  $tarballuri =~ s/\@TARBALL@/$tarball/;
+  $tarballuri =~ s/\@PACKAGE@/$packagename/;
+#  print  "\n--->".$tarballuri."\n";
+
+  return $tarballuri;
+}
+
+sub getOnDebianData {
+  my $package = shift;
+  return unless $$package->name;
+  return unless $$package->svndebrelease;
+
+  my $isindebian = 'f';
+  my $tarballuri;
+  my $isnative = 'f';
+
+  my $ua = LWP::UserAgent->new;
+  $ua->agent("SvnBuildStat/0.1 ");
+
+  if ($$package->svndebrelease !~ /-[\d+\.]+$/) {
+#    print $$package->name."\n";
+    $isnative = 't';
+  } else {
+    my $debmirror = 'http://ftp.debian.org/debian';
+    my $debdiff .= $$package->name."_".$$package->svndebrelease.".diff.gz";
+    my $tarball = mkTarballFromPackage($package);
+
+    if ($tarball) {
+      foreach my $section (qw/main contrib non-free/) {
+	my $tmp = "$1/".$$package->name if $$package->name =~ /^(lib.|.)/;
+	my $debdiffuri = $debmirror.'/pool/'.$section.'/'.$tmp.'/'.$debdiff;
+	my $tmp_tarballuri = $debmirror.'/pool/'.$section.'/'.$tmp.'/'.$tarball;
+	if (testUrl($debdiffuri)) {
+	  $isindebian = 't';
+	}
+	if (testUrl($tmp_tarballuri)) {
+	  $tarballuri = $tmp_tarballuri;
+	  $tarballuri =~ s/^$debmirror/\@DEBMIRROR@/;
+	}
+      }
+    }
+  }
+  return { tarballuri => $tarballuri, isindebian => $isindebian, isnative => $isnative };
+}
+
+sub getUscanData {
+  my $package = shift;
+  my $cmd;
+
+  $cmd = "svn cat ".$$package->uri."/debian/watch";
+  my $watch = `$cmd`;
+
+  return unless $watch;
+
+  my ($fh, $watchfile) = tempfile(SUFFIX => '.uscan');
+  print $fh $watch;
+  close ($fh);
+
+  my $majorrelease = $$package->svndebrelease;
+  $majorrelease =~ s/^\d+://;
+  $majorrelease =~ s/-[0-9A-Za-z\.~]*$//;
+  $majorrelease =~ s/dfsg.*//;
+  $majorrelease =~ s/\d+://;
+  $cmd = "uscan --package ".$$package->name." --dehs --upstream-version ".$majorrelease." --watchfile ".$watchfile;
+#  print $cmd."\n";
+  my @uscan = `$cmd`;
+  unlink $watchfile or warn;
+  return unless @uscan > 2; # empty output
+
+  my $tarballuri;
+  my $isuptodate = 'f';
+  my $iswatchfilebroken = 'f';
+  my $upstreamrelease;
+  foreach (@uscan) {
+#    print;
+    $tarballuri = $1 if (/^<upstream-url>(.+tar\.gz)<\/upstream-url>$/i);
+    $isuptodate = 't' if (/^<status>up to date<\/status>$/);
+    $upstreamrelease = $1 if (/^<upstream-version>(.+)<\/upstream-version>$/);
+    $iswatchfilebroken = 't' if (/^<errors>/);
+  }
+  $iswatchfilebroken = 't' unless $upstreamrelease;
+  $tarballuri = '' unless $isuptodate eq 't';
+
+  return {tarballuri => $tarballuri, isuptodate => $isuptodate, upstreamrelease => $upstreamrelease, iswatchfilebroken => $iswatchfilebroken};
+}
+
+
+sub importPkg {
+  print "ImportPkg\n";
+  my( $repository, $uri, $tarballonrepository) = @_;
+
+  my @maintainer;
+  my $packagesrc;
+  my $svndebrelease;
+  my $tarballuri;
+  my $rev = getRev($uri);
+
+  return unless $rev;
+
+  my @control = `svn cat $uri/debian/control`;
+  return unless @control;
+  foreach (@control) {
+    $packagesrc = $1 if /^Source:\ *(.*)/;
+    if (/^(Maintainer|Uploaders):\ *(.*)/) {
+      my $tmp = $2;
+      foreach (split /,/, $tmp) {
+	if (/(.+)<(.+)>/) {
+	  my $name = $1;
+	  my $email = $2;
+	  $name =~ s/^\ *//;
+	  $name =~ s/\ $//;
+	  my $maintainer = $schema->resultset('Maintainer')->find_or_create({email=>$email});
+	  $maintainer->name($name);
+	  $maintainer->update();
+	  push @maintainer, $maintainer;
+	}
+
+      }
+    }
+  }
+  if (!$packagesrc) {
+
+    print "Parse error: $uri/debian/control";
+    return;
+
+  }
+
+  my @changelog = `svn cat $uri/debian/changelog`;
+  if (@changelog && $changelog[0] =~ /^.*\ \((.*)\)/) {
+
+    $svndebrelease = $1;
+
+  } else {
+
+    print "Parse error: $uri/debian/changelog\n";
+    return;
+
+  }
+
+  my $package = $schema->resultset('Package')->find_or_create({name => $packagesrc});
+  $package->update_from_related('repository_id',$$repository);
+  $package->svndebrelease ($svndebrelease);
+  $package->uri($uri);
+  $package->rev($rev);
+  $package->repository_id($$repository);
+  foreach my $maintainer (@maintainer) {
+    my $package_maintainer =
+    $package->find_or_create_related('package_maintainers', {
+	'maintainer_id' => $maintainer->id});
+  }
+
+
+  # Search for the tarball
+  my $tarball = mkTarballFromPackage(\$package);
+  my $uscandata = getUscanData(\$package);
+  my $ondebiandata = getOnDebianData(\$package);
+  my $tarballurlfromtarballlayout = createTarballUrlFromTarballlayout($repository,\$package);
+  $package->iswatchfilebroken($uscandata->{iswatchfilebroken});
+  # Is the tarball on a Debian mirror?
+  if ($ondebiandata->{isnative} eq 't') {
+    $package->isnative(1);
+    $package->tarballuri('');
+    $package->istarballpresent(0);
+  } else {
+      $package->isnative(0);
+    if ($ondebiandata->{tarballuri}) {
+      $package->tarballuri($ondebiandata->{tarballuri});
+      $package->istarballpresent(1);
+      # Or on upstream repository (using uscan)
+    } elsif($uscandata->{tarballuri}) {
+      $package->tarballuri($uscandata->{tarballuri});
+      $package->istarballpresent(1);
+      # Or on a HTTP/FTP space is a tarball layout exists
+    } elsif (testUrl($tarballurlfromtarballlayout)) {
+      $package->tarballuri($tarballurlfromtarballlayout);
+      $package->istarballpresent(1);
+      # Or on the same repository
+    } elsif(exists $tarballonrepository->{$tarball}) {
+      my $t = $tarballonrepository->{$tarball};
+      $t =~ s!svn://svn.debian.org/svn/(.*)!http://svn.debian.org/wsvn/$1?op=file&rev=0&sc=0!;
+    } else {
+      $package->tarballuri('');
+      $package->istarballpresent(0);
+    }
+  } 
+
+  # 
+  $package->isuptodate($uscandata->{isuptodate});
+  $package->upstreamrelease($uscandata->{upstreamrelease});
+  $package->isindebian($ondebiandata->{isindebian});
+  print "->".$package->name."\n";
+  $package->lastcheck('now');
+  $package->update();
+}
+
+
+$config = new SvnBuildStat::Config();
+$schema = SvnBuildStat::Schema->connect(
+  $config->db_dsn,
+  $config->db_user,
+  $config->db_password,
+  {AutoCommit => 1, debug => 1}
+);
+
+sub importRepository {
+  my $repository = shift;
+
+
+  my $tarballonrepository;
+  print "Repository: ".$$repository->name."\n";
+  my $t = 'svn ls -R '.$$repository->uri;
+  my $rev = getRev($$repository->uri);
+  if(! $rev) {
+    print "Failed to get the current revision of ".$$repository->name."\n";
+    return;
+  }
+
+  if ($$repository->rev eq $rev && $$repository->lastcheck) {
+    # If he repository is up to date, a still do a refresh every 48h
+    # this because the tarball check
+    my ($year, $mon, $day, $hour, $min, $sec) = ($$repository->lastcheck =~ /(\d{4})-(\d{2})-(\d{2})\ (\d{1,2}):(\d{2}):(\d{2})/);
+    my $lastbuild = timelocal($sec, $min, $hour, $day, $mon, $year);
+    if ($lastbuild > time - 3600*48) {
+      print "No need to refresh ".$$repository->name."\n";
+      return;
+    }
+  }
+
+  my @uri;
+
+  foreach (`$t`) {
+    chomp;
+    my $uri = $$repository->uri.'/'.$_;
+    $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!
+    $uri =~ s/(|\/)debian\/control$//;
+    push @uri, $uri;
+  }
+print "Yo!\n";
+  foreach my $uri (@uri) {
+    # look for packages
+    $poolImportPkg->add($repository,$uri,$tarballonrepository) or die "Fucked\n";
+  }
+
+  $$repository->rev($rev);
+  $$repository->lastcheck('now');
+  $$repository->update();
+
+  print "end import Repo\n";
+}
+
+########## THREAD POOLS #####
+$poolImportPkg = Thread::Pool::Simple->new(
+   min => 5,
+   max => 10,
+   load => 3,
+   do => [\&importPkg],
+   lifespan => 1
+ );
+
+########
+
+# Import packages
+my $repository_rs = $schema->resultset('Repository')->search({enabled => 'true'});
+while (my $repository = $repository_rs->next) {
+  importRepository(\$repository) or warn "importRepository failed for ".$repository->name."\n";
+}
+$poolImportPkg->join;


Property changes on: svnbuildstat/script/svnbuildstat_update-db.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: svnbuildstat/script/svnbuildstat_www_cgi.pl
===================================================================
--- svnbuildstat/script/svnbuildstat_www_cgi.pl	                        (rev 0)
+++ svnbuildstat/script/svnbuildstat_www_cgi.pl	2007-07-25 17:38:59 UTC (rev 352)
@@ -0,0 +1,37 @@
+#!/usr/bin/perl -w
+
+BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
+
+use strict;
+use warnings;
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+use SvnBuildStat::WWW;
+
+SvnBuildStat::WWW->run;
+
+1;
+
+=head1 NAME
+
+svnbuildstat_www_cgi.pl - Catalyst CGI
+
+=head1 SYNOPSIS
+
+See L<Catalyst::Manual>
+
+=head1 DESCRIPTION
+
+Run a Catalyst application as a cgi script.
+
+=head1 AUTHOR
+
+Sebastian Riedel, C<sri at oook.de>
+
+=head1 COPYRIGHT
+
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut


Property changes on: svnbuildstat/script/svnbuildstat_www_cgi.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: svnbuildstat/script/svnbuildstat_www_create.pl
===================================================================
--- svnbuildstat/script/svnbuildstat_www_create.pl	                        (rev 0)
+++ svnbuildstat/script/svnbuildstat_www_create.pl	2007-07-25 17:38:59 UTC (rev 352)
@@ -0,0 +1,74 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+use Getopt::Long;
+use Pod::Usage;
+use Catalyst::Helper;
+
+my $force = 0;
+my $mech  = 0;
+my $help  = 0;
+
+GetOptions(
+    'nonew|force'    => \$force,
+    'mech|mechanize' => \$mech,
+    'help|?'         => \$help
+ );
+
+pod2usage(1) if ( $help || !$ARGV[0] );
+
+my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } );
+
+pod2usage(1) unless $helper->mk_component( 'SvnBuildStat::WWW', @ARGV );
+
+1;
+
+=head1 NAME
+
+svnbuildstat_www_create.pl - Create a new Catalyst Component
+
+=head1 SYNOPSIS
+
+svnbuildstat_www_create.pl [options] model|view|controller name [helper] [options]
+
+ Options:
+   -force        don't create a .new file where a file to be created exists
+   -mechanize    use Test::WWW::Mechanize::Catalyst for tests if available
+   -help         display this help and exits
+
+ Examples:
+   svnbuildstat_www_create.pl controller My::Controller
+   svnbuildstat_www_create.pl -mechanize controller My::Controller
+   svnbuildstat_www_create.pl view My::View
+   svnbuildstat_www_create.pl view MyView TT
+   svnbuildstat_www_create.pl view TT TT
+   svnbuildstat_www_create.pl model My::Model
+   svnbuildstat_www_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
+   dbi:SQLite:/tmp/my.db
+   svnbuildstat_www_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
+   dbi:Pg:dbname=foo root 4321
+
+ See also:
+   perldoc Catalyst::Manual
+   perldoc Catalyst::Manual::Intro
+
+=head1 DESCRIPTION
+
+Create a new Catalyst Component.
+
+Existing component files are not overwritten.  If any of the component files
+to be created already exist the file will be written with a '.new' suffix.
+This behavior can be suppressed with the C<-force> option.
+
+=head1 AUTHOR
+
+Sebastian Riedel, C<sri at oook.de>
+Maintained by the Catalyst Core Team.
+
+=head1 COPYRIGHT
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut


Property changes on: svnbuildstat/script/svnbuildstat_www_create.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: svnbuildstat/script/svnbuildstat_www_fastcgi.pl
===================================================================
--- svnbuildstat/script/svnbuildstat_www_fastcgi.pl	                        (rev 0)
+++ svnbuildstat/script/svnbuildstat_www_fastcgi.pl	2007-07-25 17:38:59 UTC (rev 352)
@@ -0,0 +1,80 @@
+#!/usr/bin/perl -w
+
+BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' }
+
+use strict;
+use warnings;
+use Getopt::Long;
+use Pod::Usage;
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+use SvnBuildStat::WWW;
+
+my $help = 0;
+my ( $listen, $nproc, $pidfile, $manager, $detach, $keep_stderr );
+ 
+GetOptions(
+    'help|?'      => \$help,
+    'listen|l=s'  => \$listen,
+    'nproc|n=i'   => \$nproc,
+    'pidfile|p=s' => \$pidfile,
+    'manager|M=s' => \$manager,
+    'daemon|d'    => \$detach,
+    'keeperr|e'   => \$keep_stderr,
+);
+
+pod2usage(1) if $help;
+
+SvnBuildStat::WWW->run( 
+    $listen, 
+    {   nproc   => $nproc,
+        pidfile => $pidfile, 
+        manager => $manager,
+        detach  => $detach,
+	keep_stderr => $keep_stderr,
+    }
+);
+
+1;
+
+=head1 NAME
+
+svnbuildstat_www_fastcgi.pl - Catalyst FastCGI
+
+=head1 SYNOPSIS
+
+svnbuildstat_www_fastcgi.pl [options]
+ 
+ Options:
+   -? -help      display this help and exits
+   -l -listen    Socket path to listen on
+                 (defaults to standard input)
+                 can be HOST:PORT, :PORT or a
+                 filesystem path
+   -n -nproc     specify number of processes to keep
+                 to serve requests (defaults to 1,
+                 requires -listen)
+   -p -pidfile   specify filename for pid file
+                 (requires -listen)
+   -d -daemon    daemonize (requires -listen)
+   -M -manager   specify alternate process manager
+                 (FCGI::ProcManager sub-class)
+                 or empty string to disable
+   -e -keeperr   send error messages to STDOUT, not
+                 to the webserver
+
+=head1 DESCRIPTION
+
+Run a Catalyst application as fastcgi.
+
+=head1 AUTHOR
+
+Sebastian Riedel, C<sri at oook.de>
+Maintained by the Catalyst Core Team.
+
+=head1 COPYRIGHT
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut


Property changes on: svnbuildstat/script/svnbuildstat_www_fastcgi.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: svnbuildstat/script/svnbuildstat_www_server.pl
===================================================================
--- svnbuildstat/script/svnbuildstat_www_server.pl	                        (rev 0)
+++ svnbuildstat/script/svnbuildstat_www_server.pl	2007-07-25 17:38:59 UTC (rev 352)
@@ -0,0 +1,111 @@
+#!/usr/bin/perl -w
+
+BEGIN { 
+    $ENV{CATALYST_ENGINE} ||= 'HTTP';
+    $ENV{CATALYST_SCRIPT_GEN} = 30;
+    require Catalyst::Engine::HTTP;
+}  
+
+use strict;
+use warnings;
+use Getopt::Long;
+use Pod::Usage;
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+
+my $debug             = 0;
+my $fork              = 0;
+my $help              = 0;
+my $host              = undef;
+my $port              = 3000;
+my $keepalive         = 0;
+my $restart           = 0;
+my $restart_delay     = 1;
+my $restart_regex     = '\.yml$|\.yaml$|\.pm$';
+my $restart_directory = undef;
+
+my @argv = @ARGV;
+
+GetOptions(
+    'debug|d'             => \$debug,
+    'fork'                => \$fork,
+    'help|?'              => \$help,
+    'host=s'              => \$host,
+    'port=s'              => \$port,
+    'keepalive|k'         => \$keepalive,
+    'restart|r'           => \$restart,
+    'restartdelay|rd=s'   => \$restart_delay,
+    'restartregex|rr=s'   => \$restart_regex,
+    'restartdirectory=s'  => \$restart_directory,
+);
+
+pod2usage(1) if $help;
+
+if ( $restart ) {
+    $ENV{CATALYST_ENGINE} = 'HTTP::Restarter';
+}
+if ( $debug ) {
+    $ENV{CATALYST_DEBUG} = 1;
+}
+
+# This is require instead of use so that the above environment
+# variables can be set at runtime.
+require SvnBuildStat::WWW;
+
+SvnBuildStat::WWW->run( $port, $host, {
+    argv              => \@argv,
+    'fork'            => $fork,
+    keepalive         => $keepalive,
+    restart           => $restart,
+    restart_delay     => $restart_delay,
+    restart_regex     => qr/$restart_regex/,
+    restart_directory => $restart_directory,
+} );
+
+1;
+
+=head1 NAME
+
+svnbuildstat_www_server.pl - Catalyst Testserver
+
+=head1 SYNOPSIS
+
+svnbuildstat_www_server.pl [options]
+
+ Options:
+   -d -debug          force debug mode
+   -f -fork           handle each request in a new process
+                      (defaults to false)
+   -? -help           display this help and exits
+      -host           host (defaults to all)
+   -p -port           port (defaults to 3000)
+   -k -keepalive      enable keep-alive connections
+   -r -restart        restart when files get modified
+                      (defaults to false)
+   -rd -restartdelay  delay between file checks
+   -rr -restartregex  regex match files that trigger
+                      a restart when modified
+                      (defaults to '\.yml$|\.yaml$|\.pm$')
+   -restartdirectory  the directory to search for
+                      modified files
+                      (defaults to '../')
+
+ See also:
+   perldoc Catalyst::Manual
+   perldoc Catalyst::Manual::Intro
+
+=head1 DESCRIPTION
+
+Run a Catalyst Testserver for this application.
+
+=head1 AUTHOR
+
+Sebastian Riedel, C<sri at oook.de>
+Maintained by the Catalyst Core Team.
+
+=head1 COPYRIGHT
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut


Property changes on: svnbuildstat/script/svnbuildstat_www_server.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: svnbuildstat/script/svnbuildstat_www_test.pl
===================================================================
--- svnbuildstat/script/svnbuildstat_www_test.pl	                        (rev 0)
+++ svnbuildstat/script/svnbuildstat_www_test.pl	2007-07-25 17:38:59 UTC (rev 352)
@@ -0,0 +1,54 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+use Getopt::Long;
+use Pod::Usage;
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+use Catalyst::Test 'SvnBuildStat::WWW';
+
+my $help = 0;
+
+GetOptions( 'help|?' => \$help );
+
+pod2usage(1) if ( $help || !$ARGV[0] );
+
+print request($ARGV[0])->content . "\n";
+
+1;
+
+=head1 NAME
+
+svnbuildstat_www_test.pl - Catalyst Test
+
+=head1 SYNOPSIS
+
+svnbuildstat_www_test.pl [options] uri
+
+ Options:
+   -help    display this help and exits
+
+ Examples:
+   svnbuildstat_www_test.pl http://localhost/some_action
+   svnbuildstat_www_test.pl /some_action
+
+ See also:
+   perldoc Catalyst::Manual
+   perldoc Catalyst::Manual::Intro
+
+=head1 DESCRIPTION
+
+Run a Catalyst action from the command line.
+
+=head1 AUTHOR
+
+Sebastian Riedel, C<sri at oook.de>
+Maintained by the Catalyst Core Team.
+
+=head1 COPYRIGHT
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut


Property changes on: svnbuildstat/script/svnbuildstat_www_test.pl
___________________________________________________________________
Name: svn:executable
   + *




More information about the Collab-qa-commits mailing list