Bug#712261: uscan: fails with alioth downloads: failed: 406 Not Acceptable [patch-fixed]

Dmitry Smirnov onlyjob at member.fsf.org
Sun Jul 7 16:58:40 UTC 2013


Sorry, to actually download something from Alioth (not merely get a
list of files) another hunk is needed as below:

--- a/usr/bin/uscan
+++ b/tmp/uscan
@@ -691,8 +691,9 @@
 
     # Comma-separated list of features that sites being queried might
     # want to be aware of
     $headers->header('X-uscan-features' => 'enhanced-matching');
+    $headers->header('Accept' => '*/*');
     %dehs_tags = ('package' => $pkg);
 
     if ($watch_version == 1) {
        ($site, $dir, $filepattern, $lastversion, $action) = split ' ', $line, 5;
@@ -1313,9 +1314,11 @@
        }
        # substitute HTML entities
        # Is anything else than "&" required?  I doubt it.
        print STDERR "$progname debug: requesting URL $upstream_url\n" if $debug;
-       $request = HTTP::Request->new('GET', $upstream_url);
+       my $headers = HTTP::Headers->new;
+       $headers->header('Accept' => '*/*');
+       $request = HTTP::Request->new('GET', $upstream_url, $headers);
        $response = $user_agent->request($request, "$destdir/$newfile_base");
        if (! $response->is_success) {
            if (defined $pkg_dir) {
                uscan_warn "$progname warning: In directory $pkg_dir, downloading\n  $upstream_url failed: " . $response->status_line . "\n";


-- 
Regards,
 Dmitry Smirnov
 GPG key : 4096R/53968D1B

---

Free speech is the bedrock of liberty and a free society. And yes, it
includes the right to blaspheme and offend.
        -- Ayaan Hirsi Ali, 2010



More information about the devscripts-devel mailing list