Author: adam-guest
Date: 2008-02-12 09:11:29 +0000 (Tue, 12 Feb 2008)
New Revision: 1011

Modified:
   trunk/Devscripts/Debbugs.pm
   trunk/debian/changelog
   trunk/scripts/checkbashisms.pl
   trunk/scripts/debchange.pl
Log:
checkbashisms: Fix a false positive in the $(( test (Closes: #465364)

Modified: trunk/Devscripts/Debbugs.pm
===================================================================
--- trunk/Devscripts/Debbugs.pm 2008-02-11 19:50:50 UTC (rev 1010)
+++ trunk/Devscripts/Debbugs.pm 2008-02-12 09:11:29 UTC (rev 1011)
@@ -141,6 +141,21 @@
     return $bugs;
 }
 
+sub status {
+    die "Couldn't run select: $soap_broken\n" unless have_soap();
+    my @args = @_;
+
+    my $soap = SOAP::Lite->uri($soapurl)->proxy($soapproxyurl);
+
+    my $bugs = $soap->get_status(@args)->result();
+
+    if (not defined $bugs) {
+       die "Error while retrieving bug statuses from SOAP server";
+    }
+
+    return $bugs;
+}
+
 1;
 
 __END__

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-02-11 19:50:50 UTC (rev 1010)
+++ trunk/debian/changelog      2008-02-12 09:11:29 UTC (rev 1011)
@@ -1,3 +1,9 @@
+devscripts (2.10.17) UNRELEASED; urgency=low
+
+  * checkbashisms: Fix a false positive in the $(( test (Closes: #465364)
+
+ -- Adam D. Barratt <[EMAIL PROTECTED]>  Tue, 12 Feb 2008 08:50:01 +0000
+
 devscripts (2.10.16) unstable; urgency=low
 
   The "storm before the calm" release

Modified: trunk/scripts/checkbashisms.pl
===================================================================
--- trunk/scripts/checkbashisms.pl      2008-02-11 19:50:50 UTC (rev 1010)
+++ trunk/scripts/checkbashisms.pl      2008-02-12 09:11:29 UTC (rev 1011)
@@ -128,7 +128,7 @@
                '(?:^|\s+)exec\s+-[acl]' =>    q<exec -c/-l/-a name>,
                '(?:^|\s+)let\s' =>            q<let ...>,
                '\$RANDOM\b' =>                q<$RANDOM>,
-               '(?<!\$)\(\(.*\)\)' =>         q<'((' should be '$(('>,
+               '(?<!\$)\(\(+.*\)\)' =>         q<'((' should be '$(('>,
                '(\[|test)\s+-a' =>            q<test with unary -a (should be 
-e)>,
                '\&>' =>                       q<should be \>word 2\>&1>,
                '(<\&|>\&)\s*(-[^\s;|]|\d+[^\s;|]|[^-\d\s;|])' =>

Modified: trunk/scripts/debchange.pl
===================================================================
--- trunk/scripts/debchange.pl  2008-02-11 19:50:50 UTC (rev 1010)
+++ trunk/scripts/debchange.pl  2008-02-12 09:11:29 UTC (rev 1011)
@@ -38,7 +38,11 @@
 use File::Copy;
 use File::Basename;
 use Cwd;
+use lib '/usr/share/devscripts';
+use Devscripts::Debbugs;
 
+use Data::Dumper;
+
 BEGIN {
     # Load the URI::Escape module safely
     eval { require URI::Escape; };
@@ -662,34 +666,22 @@
     }
     else
     {
-       my %bugs;
-       my $lastbug;
-
        my $uripkg = uri_escape($PACKAGE);
-       my $bugs = `wget -q -O - 
'http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=$uripkg'`;
-       if ($? >> 8 != 0) {
+#      my $bugs = `wget -q -O - 
'http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=$uripkg'`;
+       my $bugs = Devscripts::Debbugs::select( "src:" . $uripkg );
+       my $statuses = Devscripts::Debbugs::status( @{$bugs} );
+#print Dumper($statuses);
+       if (not defined $bugs) {
            warn "$progname warning: wget failed, so cannot query the 
bug-tracking system\n";
            $opt_query=0;
            $warnings++;
            # This will now go and execute the "if (@closes and ! $opt_query)" 
code
        }
 
-       foreach (split /\n/, $bugs) {
-           if (m%<a(?: class=\".*?\")? 
href=\"(?:/cgi-bin/)?(?:bugreport.cgi\?bug=|/)([0-9]*).*?>\#\1: (.*?)</a>%i) {
-               $bugs{$1} = [$2];
-               $lastbug=$1;
-           }
-           elsif (defined $lastbug and
-                  m%<a(?: class=\".*?\")? 
href=\"(?:/cgi-bin/)?pkgreport.cgi\?(?:[^\"]*?;)(?:pkg|package)=([a-z0-9\+\-\.]*)%i)
 {
-               push @{$bugs{$lastbug}}, $1
-                   if exists $bugs{$lastbug};
-               $lastbug = undef;
-           }
-       }
-
        foreach my $close (@closes) {
-           if (exists $bugs{$close}) {
-               my ($title,$pkg) = @{$bugs{$close}};
+           if (exists $statuses->{$close}) {
+               my $title = $statuses->{$close}->{subject};
+               my $pkg = $statuses->{$close}->{package};
                $title =~ s/^($pkg|$PACKAGE): //;
                $title =~ s/&quot;/\"/g;
                $title =~ s/&lt;/</g;
@@ -698,17 +690,19 @@
                push @closes_text, "$title (Closes: \#$close)\n";
            }
            else { # not our package, or wnpp
-               my $bug = `wget -q -O - 
'http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=$close'`;
-               if ($? >> 8 != 0) {
+#              my $bug = `wget -q -O - 
'http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=$close'`;
+               my $bug = Devscripts::Debbugs::status( $close );
+               if (not defined $bug) {
                    warn "$progname warning: unknown bug \#$close does not 
belong to $PACKAGE,\n  disabling closing changelog entry\n";
                    $warnings++;
                    push @closes_text, "Closes?? \#$close: UNKNOWN BUG IN WRONG 
PACKAGE!!\n";
                } else {
-                   my ($bugtitle) = ($bug =~ m%<TITLE>.*?\#$close - (.*?) - 
[^-]*? report logs</TITLE>%);
+                   my $bugtitle = $bug->{$close}->{subject};               
                    $bugtitle ||= '';
-                   my ($bugpkg) = ($bug =~ m%<a(?: class=\".*?\")? 
href=\"(?:/cgi-bin/)?pkgreport.cgi\?(?:[^\"]*?;)?(?:pkg|package)=([a-z0-9\+\-\.]*)%i);
+                   my $bugpkg = $bug->{$close}->{package};
                    $bugpkg ||= '?';
-                   my ($bugsrcpkg) = ($bug =~ m%<a(?: class=\".*?\")? 
href=\"(?:/cgi-bin/)?pkgreport.cgi\?src=([a-z0-9\+\-\.]*)%i);
+#                  my ($bugsrcpkg) = ($bug =~ m%<a(?: class=\".*?\")? 
href=\"(?:/cgi-bin/)?pkgreport.cgi\?src=([a-z0-9\+\-\.]*)%i);
+                   my $bugsrcpkg;
                    $bugsrcpkg ||= '?';
                    if ($bugsrcpkg eq $PACKAGE) {
                        warn "$progname warning: bug \#$close appears to be 
already archived,\n  disabling closing changelog entry\n";



-- 
To unsubscribe, send mail to [EMAIL PROTECTED]

Reply via email to