Hi,

I made a quick fix to address this bug as attached against git head:
 a830277fec6cea2b4c6cba86ca3a45ceea309b06 

This should not only works for default but also work for auto.

Sean Whitton, what do you think of this?

I will test this later this week when I find some time.

Regards,

Osamu

PS: Writing perl code is headache for me.
diff --git a/scripts/uscan.pl b/scripts/uscan.pl
index f871daf2..74177045 100755
--- a/scripts/uscan.pl
+++ b/scripts/uscan.pl
@@ -3589,20 +3589,39 @@ EOF
 
     # Download signature
     my $pgpsig_url;
+    my $sigrequest;
+    my $sigresponse;
     if (($options{'pgpmode'} eq 'default' or $options{'pgpmode'} eq 'auto') and $signature == 1) {
 	uscan_verbose "Start checking for common possible upstream OpenPGP signature files\n";
 	foreach my $suffix (qw(asc gpg pgp sig sign)) {
-	    my $sigrequest = HTTP::Request->new('HEAD' => "$upstream_url.$suffix");
-	    my $sigresponse = $user_agent->request($sigrequest);
-	    if ($sigresponse->is_success()) {
-		if ($options{'pgpmode'} eq 'default') {
-		    uscan_warn "Possible OpenPGP signature found at:\n   $upstream_url.$suffix.\n   Please consider adding opts=pgpsigurlmangle=s/\$/.$suffix/\n   to debian/watch.  see uscan(1) for more details.\n";
-		    $options{'pgpmode'} = 'none';
-		} else {
-		    $options{'pgpmode'} = 'mangle';
-		    $options{'pgpsigurlmangle'} = [ 's/$/.' . $suffix . '/', ];
+	    if ($upstream_url =~ m/(.*)\?(.*)/) {
+		my $upstream_url1 = $1;
+		my $upstream_url2 = $2;
+		$sigrequest = HTTP::Request->new('HEAD' => "$upstream_url1.$suffix?$upstream_url2");
+		$sigresponse = $user_agent->request($sigrequest);
+		if ($sigresponse->is_success()) {
+		    if ($options{'pgpmode'} eq 'default') {
+			uscan_warn "Possible OpenPGP signature found at:\n   $upstream_url1.$suffix?$upstream_url2.\n   Please consider adding opts=pgpsigurlmangle=s/\?/.$suffix?/\n   to debian/watch.  see uscan(1) for more details.\n";
+			$options{'pgpmode'} = 'none';
+		    } else { # auto
+			$options{'pgpmode'} = 'mangle';
+			$options{'pgpsigurlmangle'} = [ 's/\?/.' . $suffix . '?/', ];
+		    }
+		    last;
+		}
+	    } else {
+		$sigrequest = HTTP::Request->new('HEAD' => "$upstream_url.$suffix");
+		$sigresponse = $user_agent->request($sigrequest);
+		if ($sigresponse->is_success()) {
+		    if ($options{'pgpmode'} eq 'default') {
+			uscan_warn "Possible OpenPGP signature found at:\n   $upstream_url.$suffix.\n   Please consider adding opts=pgpsigurlmangle=s/\$/.$suffix/\n   to debian/watch.  see uscan(1) for more details.\n";
+			$options{'pgpmode'} = 'none';
+		    } else { # auto
+			$options{'pgpmode'} = 'mangle';
+			$options{'pgpsigurlmangle'} = [ 's/$/.' . $suffix . '/', ];
+		    }
+		    last;
 		}
-		last;
 	    }
 	}
 	uscan_verbose "End checking for common possible upstream OpenPGP signature files\n";

Reply via email to