Re: Bug#923459: devscripts: uscan in buster could not check version and throws warnings

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Bug#923459: devscripts: uscan in buster could not check version and throws warnings

Xavier Guimard-3
Le 28/02/2019 à 14:04, Patrick Matthäi a écrit :

> Package: devscripts
> Version: 2.19.3
> Severity: normal
>
>
> Hi,
>
> with uscan on buster (instead of stretch) uscan fails to check two packages:
>
> $ uscan --report --verbose
> uscan info: uscan (version 2.19.3) See uscan(1) for help
> uscan info: Scan watch files in .
> uscan info: Check debian/watch and debian/changelog in .
> uscan info: package="ckport" version="0.1~rc1-8" (as seen in debian/changelog)
> uscan info: package="ckport" version="0.1~rc1" (no epoch/revision)
> uscan info: ./debian/changelog sets package="ckport" version="0.1~rc1"
> uscan info: Found upstream signing keyring: debian/upstream/signing-key.asc
> uscan info: Process watch file at: debian/watch
>     package = ckport
>     version = 0.1~rc1
>     pkg_dir = .
> uscan info: opts: pgpsigurlmangle=s/$/.asc/,uversionmangle=s/~//;s/beta/~beta/;s/-pr/~pr/;s/rc/~rc/
> uscan info: line: http://software.keep-cool.org/dl/ckport/ ckport-([^-]*)\.tar\.gz
> uscan info: Parsing pgpsigurlmangle=s/$/.asc/
> uscan info: Parsing uversionmangle=s/~//;s/beta/~beta/;s/-pr/~pr/;s/rc/~rc/
> uscan info: line: http://software.keep-cool.org/dl/ckport/ ckport-([^-]*)\.tar\.gz
> uscan info: Last orig.tar.* tarball version (from debian/changelog): 0.1~rc1
> uscan info: Last orig.tar.* tarball version (dversionmangled): 0.1~rc1
> uscan info: Requesting URL:
>    http://software.keep-cool.org/dl/ckport/
> Use of uninitialized value $content in concatenation (.) or string at /usr/share/perl5/Devscripts/Uscan/http.pm line 66.

This looks like a bug in HTTP::Response: $response contains valid HTML
data in $response->{_content} but $response->decoded_content returns
"undef".

(Cc to Perl team)

Dumper of $response:
$VAR1 = bless( {
  '_msg' => 'Ok',
  '_protocol' => 'HTTP/1.1',
  '_content' => '<HTML>
<HEAD><TITLE>Index of software.keep-cool.org/dl/ckport/</TITLE></HEAD>
<BODY BGCOLOR="#99cc99" TEXT="#000000" LINK="#2020ff" VLINK="#4040cc">
<H4>Index of software.keep-cool.org/dl/ckport/</H4>
<PRE>
<A HREF=".">.                               </A>    11Aug2012 17:38
      4096
<A HREF="..">..                              </A>    29Apr2011 13:58
       4096
<A HREF=".cvsignore">.cvsignore                      </A>    05Jul2012
13:00             15
<A HREF="CVS">CVS                             </A>    05Jul2012 13:00
        4096
<A HREF="ckport-0.1beta0.tar.gz">ckport-0.1beta0.tar.gz          </A>
 15Apr2011 00:49          18636
<A HREF="ckport-0.1beta0.tar.gz.asc">ckport-0.1beta0.tar.gz.asc
</A>    15Apr2011 00:49            482
<A HREF="ckport-0.1beta1.tar.gz">ckport-0.1beta1.tar.gz          </A>
 06May2011 22:58          19485
<A HREF="ckport-0.1beta1.tar.gz.asc">ckport-0.1beta1.tar.gz.asc
</A>    06May2011 22:58            482
<A HREF="ckport-0.1beta2.tar.gz">ckport-0.1beta2.tar.gz          </A>
 28May2011 15:26          20379
<A HREF="ckport-0.1beta2.tar.gz.asc">ckport-0.1beta2.tar.gz.asc
</A>    28May2011 15:26            482
<A HREF="ckport-0.1rc0.tar.gz">ckport-0.1rc0.tar.gz            </A>
23Jul2011 22:38          20670
<A HREF="ckport-0.1rc0.tar.gz.asc">ckport-0.1rc0.tar.gz.asc        </A>
   23Jul2011 22:38            482
<A HREF="ckport-0.1rc1.tar.gz">ckport-0.1rc1.tar.gz            </A>
11Aug2012 17:38          21514
<A HREF="ckport-0.1rc1.tar.gz.asc">ckport-0.1rc1.tar.gz.asc        </A>
   11Aug2012 17:38            482
</PRE>
<HR>
<ADDRESS><A
HREF="http://www.acme.com/software/mini_httpd/">mini_httpd/1.19
19dec2003</A></ADDRESS>
</BODY>
</HTML>
',
  '_request' => bless( {
     '_uri' => bless( do{\(my $o =
'http://software.keep-cool.org/dl/ckport/')}, 'URI::http' ),
     '_content' => '',
     '_uri_canonical' => $VAR1->{'_request'}{'_uri'},
     '_headers' => bless( {
       'user-agent' => 'Debian uscan'
     }, 'HTTP::Headers' ),
     '_method' => 'GET'
     }, 'HTTP::Request' ),
  '_headers' => bless( {
    'content-type' => 'text/html; charset=%s',
    'content-length' => '1731',
    'last-modified' => 'Sat, 11 Aug 2012 15:38:03 GMT',
    '::std_case' => {
      'client-date' => 'Client-Date',
      'client-peer' => 'Client-Peer',
      'client-response-num' => 'Client-Response-Num',
      'title' => 'Title'
  },
  'client-date' => 'Thu, 28 Feb 2019 14:42:00 GMT',
  'date' => 'Thu, 28 Feb 2019 14:42:00 GMT',
  'title' => 'Index of software.keep-cool.org/dl/ckport/',
  'client-response-num' => 1,
  'server' => 'mini_httpd/1.19 19dec2003',
  'connection' => 'close',
  'client-peer' => '2a01:4f8:221:1e01::5:2:80'
 }, 'HTTP::Headers' ),
 '_rc' => 200
}, 'HTTP::Response' );

Reply | Threaded
Open this post in threaded view
|

Re: Bug#923459: devscripts: uscan in buster could not check version and throws warnings

Dominique Dumont
On Thursday, 28 February 2019 15:49:53 CET Xavier wrote:
> This looks like a bug in HTTP::Response: $response contains valid HTML
> data in $response->{_content} but $response->decoded_content returns
> "undef".

Well, software.keep-cool.org http server sends back weird headers:

$ mojo get -M HEAD -v http://software.keep-cool.org/dl/ckport/
HEAD http://software.keep-cool.org/dl/ckport/ HTTP/1.1
Host: software.keep-cool.org
Accept-Encoding: gzip
User-Agent: Mojolicious (Perl)
Content-Length: 0

HTTP/1.1 200 Ok
Content-Length: 1731
Date: Thu, 28 Feb 2019 16:20:28 GMT
Last-Modified: Sat, 11 Aug 2012 15:38:03 GMT
Server: mini_httpd/1.19 19dec2003
Content-Type: text/html; charset=%s

It's possible that "charset=%s" trips up HTTP::Response.

On the other hand, the command "GET http://software.keep-cool.org/dl/ckport/"
(which uses HTTP::Response) works fine:

$  GET http://software.keep-cool.org/dl/ckport/   
<HTML>
<HEAD><TITLE>Index of software.keep-cool.org/dl/ckport/</TITLE></HEAD>
[snip]

HTH


Reply | Threaded
Open this post in threaded view
|

Re: Bug#923459: devscripts: uscan in buster could not check version and throws warnings

Patrick Matthäi-3
Am 28.02.2019 um 17:24 schrieb Dominique Dumont:

> On Thursday, 28 February 2019 15:49:53 CET Xavier wrote:
>> This looks like a bug in HTTP::Response: $response contains valid HTML
>> data in $response->{_content} but $response->decoded_content returns
>> "undef".
> Well, software.keep-cool.org http server sends back weird headers:
>
> $ mojo get -M HEAD -v http://software.keep-cool.org/dl/ckport/
> HEAD http://software.keep-cool.org/dl/ckport/ HTTP/1.1
> Host: software.keep-cool.org
> Accept-Encoding: gzip
> User-Agent: Mojolicious (Perl)
> Content-Length: 0
>
> HTTP/1.1 200 Ok
> Content-Length: 1731
> Date: Thu, 28 Feb 2019 16:20:28 GMT
> Last-Modified: Sat, 11 Aug 2012 15:38:03 GMT
> Server: mini_httpd/1.19 19dec2003
> Content-Type: text/html; charset=%s
>
> It's possible that "charset=%s" trips up HTTP::Response.
>
> On the other hand, the command "GET http://software.keep-cool.org/dl/ckport/"
> (which uses HTTP::Response) works fine:
>
> $  GET http://software.keep-cool.org/dl/ckport/   
> <HTML>
> <HEAD><TITLE>Index of software.keep-cool.org/dl/ckport/</TITLE></HEAD>
> [snip]
>
> HTH
>
Maybe it helps: on the other side other watch files for the same
download site are working:

* roaraudio
* muroar
* muroard
* roarplaylistd

--
/*
Mit freundlichem Gruß / With kind regards,
 Patrick Matthäi
 GNU/Linux Debian Developer

  Blog: http://www.linux-dev.org/
E-Mail: [hidden email]
        [hidden email]
*/

Reply | Threaded
Open this post in threaded view
|

Re: Bug#923459: devscripts: uscan in buster could not check version and throws warnings

Dominique Dumont
On Friday, 1 March 2019 09:01:26 CET you wrote:
> Maybe it helps: on the other side other watch files for the same
> download site are working:
>
> * roaraudio
> * muroar
> * muroard
> * roarplaylistd

Uh ? http://software.keep-cool.org/dl/ shows only "animals" and "ckport"

Roar audio home page points to http://roaraudio.keep-cool.org/downloads.html 
which sends back correct headers:

$ mojo get -M HEAD -v http://roaraudio.keep-cool.org/downloads.html 
HEAD http://roaraudio.keep-cool.org/downloads.html HTTP/1.1
Accept-Encoding: gzip
Host: roaraudio.keep-cool.org
Content-Length: 0
User-Agent: Mojolicious (Perl)

HTTP/1.1 200 Ok
Content-Length: 41156
Last-Modified: Wed, 30 Jan 2019 19:58:28 GMT
Server: mini_httpd/1.19 19dec2003
Content-Type: text/html; charset=iso-8859-15
Date: Fri, 01 Mar 2019 09:13:25 GMT


In any case, HTTP::Message decoded_content doc mentions: « If the "Content-
Encoding" or "charset" of the message is unknown this method will fail by
returning "undef".»

Since «%c» charset is unknown, I'd say that HTTP::Response behavior is
correct.

Given that uscan is only looking for the content of <a> tags, I'd suggest
uscan to work on response's raw content instead of decoded content.

I.e. call $reponse->content instead of $response->decoded_content.

Thoughts ?