SVN devscripts commit: r552 - in trunk: debian scripts

Adam D. Barratt adam-guest at alioth.debian.org
Sat Mar 10 02:29:32 CET 2007


Author: adam-guest
Date: 2007-03-10 01:29:31 +0000 (Sat, 10 Mar 2007)
New Revision: 552

Modified:
   trunk/debian/changelog
   trunk/scripts/bts.pl
Log:
Download version graphs in "full caching" mode


Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2007-03-10 01:16:28 UTC (rev 551)
+++ trunk/debian/changelog	2007-03-10 01:29:31 UTC (rev 552)
@@ -66,9 +66,10 @@
   * svnpath: is GPLv2 or later
   * bts:
     - handle new status / maintainer mbox links when downloading bugs
-    - use bugs.d.o/mbox:NNNN to download the mbox  
+    - use bugs.d.o/mbox:NNNN to download the mbox
+    - download version graphs in "full caching" mode
 
- -- Adam D. Barratt <debian-bts at adam-barratt.org.uk>  Sat, 10 Mar 2007 01:12:38 +0000
+ -- Adam D. Barratt <debian-bts at adam-barratt.org.uk>  Sat, 10 Mar 2007 01:25:25 +0000
 
 devscripts (2.9.27) unstable; urgency=low
 

Modified: trunk/scripts/bts.pl
===================================================================
--- trunk/scripts/bts.pl	2007-03-10 01:16:28 UTC (rev 551)
+++ trunk/scripts/bts.pl	2007-03-10 01:29:31 UTC (rev 552)
@@ -1952,7 +1952,7 @@
     # occurrence of either "[<a " or plain "<a ", preserving any "[".
     my @data = split /(?:(?=\[<[Aa]\s)|(?<!\[)(?=<[Aa]\s))/, $toppage;
     foreach (@data) {
-	next unless m%<a(?: class=\".*?\")? href="(bugreport\.cgi[^\"]+)">%i;
+	next unless m%<a(?: class=\".*?\")? href="((bugreport|version)\.cgi[^\"]+)">%i;
 	my $ref = $1;
 	my ($msg, $filename) = href_to_filename($_);
 
@@ -1985,6 +1985,11 @@
 	    # Always need refreshing, as they could change each time the
 	    # bug does
 	}
+	elsif ($cachemode eq 'full' and $msg eq 'versions') {
+	    $bug2filename{$msg} = $filename;
+	    # already downloaded?
+	    next if -f $bug2filename{$msg} and not $refreshmode;
+	}
 
 	next unless exists $bug2filename{$msg};
 
@@ -2127,6 +2132,8 @@
 		s%<a((?: class=\".*?\")?) href="(pkgreport\.cgi\?src=([^\"&;]+)[^\"]*)">(.+?)</a>%<a$1 href="src_$3.html">$4</a> (<a$1 href="$btscgiurl$2">online</a>)%i;
 		s%<a((?: class=\".*?\")?) href="(pkgreport\.cgi\?submitter=([^\"&;]+)[^\"]*)">(.+?)</a>%<a$1 href="from_$3.html">$4</a> (<a$1 href="$btscgiurl$2">online</a>)%i;
 		s%<a((?: class=\".*?\")?) href="(?:/cgi-bin/)?(bugspam\.cgi[^\"]+)">%<a$1 href="$btscgiurl$2">%i;
+		s%<a((?: class=\".*?\")?) href="(version\.cgi\?package=(?:[^;]+);found=([^\%]+)\%2F([^\";]+))(?:;[^\"]+)?\">(.*?)</a>%<a$1 href=\"$3.$4.png\">$5</a>%;
+		s%<img((?: class=\".*?\")?) src="(version\.cgi\?package=(?:[^;]+);found=([^\%]+)\%2F([^;]+);width=([^;]+);height=([^;\"]+)(?:[^\"]*))\">%<img$1 src=\"$3.$4.png\" width=\"25\%\" height=\"25\%\">%;
 	    }
 	}
     }
@@ -2323,6 +2330,13 @@
 	    return undef;
 	}
     }
+    elsif ($href =~ m%<a href=\"version\.cgi\?package=[^;]+;found=([^\%]+)\%2F([^\"]+)\">%) {
+	my $package = $1;
+	my $version = $2;
+
+	$msg = 'versions';
+	$filename = "$package.$version.png";
+    }
     else {
 	return undef;
     }




More information about the Devscripts-devel mailing list