[Collab-qa-commits] r1258 - buildstat/trunk/buildstat-agent
goneri at alioth.debian.org
goneri at alioth.debian.org
Tue Sep 9 12:22:44 UTC 2008
Author: goneri
Date: 2008-09-09 12:22:43 +0000 (Tue, 09 Sep 2008)
New Revision: 1258
Modified:
buildstat/trunk/buildstat-agent/buildstat-buildagent
Log:
checl devscripts version to know if dget needs the -u flag
Modified: buildstat/trunk/buildstat-agent/buildstat-buildagent
===================================================================
--- buildstat/trunk/buildstat-agent/buildstat-buildagent 2008-09-09 12:05:19 UTC (rev 1257)
+++ buildstat/trunk/buildstat-agent/buildstat-buildagent 2008-09-09 12:22:43 UTC (rev 1258)
@@ -347,6 +347,19 @@
}
+sub dgetNeedsUFlag {
+ foreach (`/usr/bin/dget -V`) {
+ # devscripts 2.10.17 adds the -u flag for dget
+ if (/version\s(\d+)\.(\d+)\.(\d+)$/) {
+ if ($1>2 || ($1==2 && $2>10) || ($1==2 && $2==10 && $3>16)) {
+ return 1;
+ }
+ }
+ }
+
+ return;
+}
+
sub build {
my $report = shift;
@@ -373,7 +386,8 @@
logger("Getting the source package");
my $dscuri = $report->{dsc};
$dscuri =~ s/\@DEB_MIRROR\@/$debmirror/;
- my $cmd = "cd $threadworkplace; dget -qxu ".$dscuri." 2> /dev/null";
+ my $uflag = dgetNeedsUFlag()?'-u':'';
+ my $cmd = "cd $threadworkplace; dget -qx $uflag ".$dscuri." 2> /dev/null";
foreach (`$cmd`) {
if (/dpkg-source:\sextracting\s(\S+)\sin\s(\S+)/) {
$packagesrc = $1;
More information about the Collab-qa-commits
mailing list