[Collab-qa-commits] r1175 - in buildstat/trunk: buildstat-job-manager/buildstat-job-manager buildstat-job-manager/buildstat-job-manager/examples buildstat-server/script/attic

goneri at alioth.debian.org goneri at alioth.debian.org
Thu Aug 28 18:56:30 UTC 2008


Author: goneri
Date: 2008-08-28 18:56:29 +0000 (Thu, 28 Aug 2008)
New Revision: 1175

Added:
   buildstat/trunk/buildstat-job-manager/buildstat-job-manager/examples/
   buildstat/trunk/buildstat-job-manager/buildstat-job-manager/examples/lintian_agent.pl
Removed:
   buildstat/trunk/buildstat-server/script/attic/lintian_agent.pl
Log:
move the lintian script in buildstat-job-manager package

Copied: buildstat/trunk/buildstat-job-manager/buildstat-job-manager/examples/lintian_agent.pl (from rev 1168, buildstat/trunk/buildstat-server/script/attic/lintian_agent.pl)
===================================================================
--- buildstat/trunk/buildstat-job-manager/buildstat-job-manager/examples/lintian_agent.pl	                        (rev 0)
+++ buildstat/trunk/buildstat-job-manager/buildstat-job-manager/examples/lintian_agent.pl	2008-08-28 18:56:29 UTC (rev 1175)
@@ -0,0 +1,122 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+#use lib "/home/sites/svnbuildstat.debian.net/svnbuildstat/lib";
+
+use Data::Dumper;
+use Net::FTP;
+use File::Glob ':glob';
+use Sys::Hostname;
+#use SvnBuildStat::Config;
+use LWP::Simple;
+use POSIX ":sys_wait_h";
+use File::Basename;
+use File::stat;
+use HTTP::Request::Common;
+use LWP::UserAgent;
+use HTTP::Response;
+
+my $hostname = hostname();
+my $server = "http://wawax.info:3000";
+my $admin = "Gonéri Le Bouder <goneri\@rulezlan.org>";
+chomp (my $arch = `dpkg-architecture -qDEB_HOST_ARCH`);
+
+sub getQAJob {
+  my $p;
+  my $report = {};
+
+  my $ua  = LWP::UserAgent->new();
+  my $req = POST $server."/controls/getQAJob", Content_Type => 'form-data',
+  Content      => [
+  submit => 1,
+  content => "qatool=lintian\n",
+  ];
+  my $response = $ua->request($req);
+  return unless $response->is_success();
+
+  foreach (split $/, $response->content) {
+    chomp;
+
+    $report->{$1} = $2 if (/(.*)=(.*)/);
+  }
+  print Dumper($report);
+  return unless $report->{files};
+  return unless $report->{id};
+  $report;
+}
+
+
+sub sendReport {
+
+  my ($report, $threadbuildarea) = @_;
+
+  print "sending result that are in $threadbuildarea\n";
+
+  $report->{'arch'} = $arch;
+  $report->{'admin'} = $admin;
+  $report->{hostname} = $hostname;
+  #$report->{distro} = $distro;
+
+  #$report->{'agent_release'} = $RELEASE;
+  $report->{'pbuilder_release'} = `dpkg-query -W -f='\${Version}' pbuilder`;
+
+  my $tmp = basename($report->{dsc});
+  $tmp =~ s/\.dsc//;
+  my $prefix = $tmp."_".$arch."_$hostname";
+  my $logfile = $prefix.'.log';
+  my $infofile = $prefix.'.info';
+
+  open (BUILDLOGTMP, "<","$threadbuildarea/build.log.tmp") or die;
+  seek(BUILDLOGTMP, -20000, 2); # I just keep the end of the logfile
+  open (BUILDLOG, ">", "$threadbuildarea/".$logfile) or die;
+  # If I'm not at the end of BUILDLOGTMP it means that seek moved me
+  print BUILDLOG "(log file truncated) ... " if tell(BUILDLOGTMP);
+
+  foreach (<BUILDLOGTMP>) {
+  # To avoid strange breakage I do some clean up in the log file
+    s/[[:cntrl:]]//g;
+    print BUILDLOG $_."\n";
+  }
+  close BUILDLOGTMP;
+  close BUILDLOG;
+  unlink "$threadbuildarea/build.log.tmp";
+
+# Prepare and send the report
+#  my $ftp = Net::FTP->new($ftphost, Debug => 0) or die "Cannot connect
+#  to ".$ftphost.": $@";
+#  $ftp->login($ftplogin,$ftppassword) or die "Cannot login ", $ftp->message;
+#  $ftp->binary or die "Cannot switch to binary mode ", $ftp->message;
+#  my $dir = $report->{package_id}.'-'.time;
+#  $ftp->mkdir($dir); # Do not die since mkdir fails if the 
+                                      # directory exist
+#  $ftp->cwd($dir) or die "Can't cwd ", $ftp->message;
+
+  postFile($threadbuildarea."/".$logfile);
+  $report->{logfile} = $logfile;
+  if (bsd_glob($threadbuildarea.'/*.changes')) {
+    print "build is ok\n";
+    $report->{build} = "ok";
+    foreach (bsd_glob($threadbuildarea.'/*.deb'), bsd_glob($threadbuildarea.'/*.udeb')) {
+      $report->{binarypackages} = basename($_).' ';
+      postFile($_);
+    }
+  } else {
+    print "build is nok\n";
+    $report->{build} = "nok";
+  }
+
+
+  open (BUILDREPORT,">",$threadbuildarea."/".$infofile) or die "Can't open infofile";
+  foreach (sort keys %$report) {
+    chomp $report->{$_};
+    print BUILDREPORT $_."=".$report->{$_}."\n";
+  }
+  print BUILDREPORT "-END-\n";
+  close BUILDREPORT;
+  postFile ($threadbuildarea."/".$infofile);
+
+}
+
+
+print Dumper (getQAJob());


Property changes on: buildstat/trunk/buildstat-job-manager/buildstat-job-manager/examples/lintian_agent.pl
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mergeinfo
   + 

Deleted: buildstat/trunk/buildstat-server/script/attic/lintian_agent.pl
===================================================================
--- buildstat/trunk/buildstat-server/script/attic/lintian_agent.pl	2008-08-28 15:57:29 UTC (rev 1174)
+++ buildstat/trunk/buildstat-server/script/attic/lintian_agent.pl	2008-08-28 18:56:29 UTC (rev 1175)
@@ -1,122 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-
-#use lib "/home/sites/svnbuildstat.debian.net/svnbuildstat/lib";
-
-use Data::Dumper;
-use Net::FTP;
-use File::Glob ':glob';
-use Sys::Hostname;
-#use SvnBuildStat::Config;
-use LWP::Simple;
-use POSIX ":sys_wait_h";
-use File::Basename;
-use File::stat;
-use HTTP::Request::Common;
-use LWP::UserAgent;
-use HTTP::Response;
-
-my $hostname = hostname();
-my $server = "http://wawax.info:3000";
-my $admin = "Gonéri Le Bouder <goneri\@rulezlan.org>";
-chomp (my $arch = `dpkg-architecture -qDEB_HOST_ARCH`);
-
-sub getQAJob {
-  my $p;
-  my $report = {};
-
-  my $ua  = LWP::UserAgent->new();
-  my $req = POST $server."/controls/getQAJob", Content_Type => 'form-data',
-  Content      => [
-  submit => 1,
-  content => "qatool=lintian\n",
-  ];
-  my $response = $ua->request($req);
-  return unless $response->is_success();
-
-  foreach (split $/, $response->content) {
-    chomp;
-
-    $report->{$1} = $2 if (/(.*)=(.*)/);
-  }
-  print Dumper($report);
-  return unless $report->{files};
-  return unless $report->{id};
-  $report;
-}
-
-
-sub sendReport {
-
-  my ($report, $threadbuildarea) = @_;
-
-  print "sending result that are in $threadbuildarea\n";
-
-  $report->{'arch'} = $arch;
-  $report->{'admin'} = $admin;
-  $report->{hostname} = $hostname;
-  #$report->{distro} = $distro;
-
-  #$report->{'agent_release'} = $RELEASE;
-  $report->{'pbuilder_release'} = `dpkg-query -W -f='\${Version}' pbuilder`;
-
-  my $tmp = basename($report->{dsc});
-  $tmp =~ s/\.dsc//;
-  my $prefix = $tmp."_".$arch."_$hostname";
-  my $logfile = $prefix.'.log';
-  my $infofile = $prefix.'.info';
-
-  open (BUILDLOGTMP, "<","$threadbuildarea/build.log.tmp") or die;
-  seek(BUILDLOGTMP, -20000, 2); # I just keep the end of the logfile
-  open (BUILDLOG, ">", "$threadbuildarea/".$logfile) or die;
-  # If I'm not at the end of BUILDLOGTMP it means that seek moved me
-  print BUILDLOG "(log file truncated) ... " if tell(BUILDLOGTMP);
-
-  foreach (<BUILDLOGTMP>) {
-  # To avoid strange breakage I do some clean up in the log file
-    s/[[:cntrl:]]//g;
-    print BUILDLOG $_."\n";
-  }
-  close BUILDLOGTMP;
-  close BUILDLOG;
-  unlink "$threadbuildarea/build.log.tmp";
-
-# Prepare and send the report
-#  my $ftp = Net::FTP->new($ftphost, Debug => 0) or die "Cannot connect
-#  to ".$ftphost.": $@";
-#  $ftp->login($ftplogin,$ftppassword) or die "Cannot login ", $ftp->message;
-#  $ftp->binary or die "Cannot switch to binary mode ", $ftp->message;
-#  my $dir = $report->{package_id}.'-'.time;
-#  $ftp->mkdir($dir); # Do not die since mkdir fails if the 
-                                      # directory exist
-#  $ftp->cwd($dir) or die "Can't cwd ", $ftp->message;
-
-  postFile($threadbuildarea."/".$logfile);
-  $report->{logfile} = $logfile;
-  if (bsd_glob($threadbuildarea.'/*.changes')) {
-    print "build is ok\n";
-    $report->{build} = "ok";
-    foreach (bsd_glob($threadbuildarea.'/*.deb'), bsd_glob($threadbuildarea.'/*.udeb')) {
-      $report->{binarypackages} = basename($_).' ';
-      postFile($_);
-    }
-  } else {
-    print "build is nok\n";
-    $report->{build} = "nok";
-  }
-
-
-  open (BUILDREPORT,">",$threadbuildarea."/".$infofile) or die "Can't open infofile";
-  foreach (sort keys %$report) {
-    chomp $report->{$_};
-    print BUILDREPORT $_."=".$report->{$_}."\n";
-  }
-  print BUILDREPORT "-END-\n";
-  close BUILDREPORT;
-  postFile ($threadbuildarea."/".$infofile);
-
-}
-
-
-print Dumper (getQAJob());




More information about the Collab-qa-commits mailing list