r6694 - /scripts/qa/versioncheck2.pl

tincho-guest at users.alioth.debian.org tincho-guest at users.alioth.debian.org
Thu Aug 16 02:15:37 UTC 2007


Author: tincho-guest
Date: Thu Aug 16 02:15:37 2007
New Revision: 6694

URL: http://svn.debian.org/wsvn/?sc=1&rev=6694
Log:
Flattened out %maindata, to make things simpler.

Modified:
    scripts/qa/versioncheck2.pl

Modified: scripts/qa/versioncheck2.pl
URL: http://svn.debian.org/wsvn/scripts/qa/versioncheck2.pl?rev=6694&op=diff
==============================================================================
--- scripts/qa/versioncheck2.pl (original)
+++ scripts/qa/versioncheck2.pl Thu Aug 16 02:15:37 2007
@@ -679,7 +679,15 @@
 my %maindata;
 my(@wmodified, @cmodified);
 if(not $force_rescan and from_cache(\%maindata, "maindata", 168)) { # 1 week
-    $svn->log( ["$SVN_REPO/trunk"], $maindata{lastrev}, "HEAD", 1, 1, sub {
+    if($maindata{packages}) {
+        debugmsg("Converting maindata hash\n");
+        my %md;
+        $md{"//lastrev"} = $maindata{lastrev};
+        $md{$_} = $maindata{packages}{$_} foreach(
+            keys %{$maindata{packages}});
+        %maindata = %md;
+    }
+    $svn->log( ["$SVN_REPO/trunk"], $maindata{"//lastrev"}, "HEAD", 1, 1, sub {
             foreach(keys %{$_[0]}) {
                 if(m{^/?trunk/([^/]+)/debian/(changelog|watch)$}) {
                     if($2 eq "changelog") {
@@ -691,35 +699,33 @@
             }
         }
     );
-} else {
-    $maindata{packages} = {};
-}
-$maindata{lastrev} = $cur_ver;
+}
+$maindata{"//lastrev"} = $cur_ver;
 foreach(@svn_packages) {
-    next if($maindata{packages}{$_});
-    $maindata{packages}{$_} = {};
+    next if($maindata{$_});
+    $maindata{$_} = {};
     push @wmodified, $_;
     push @cmodified, $_;
 }
 my %tmp = map({ $_ => 1 } @cmodified); # eliminate dupes
 foreach my $pkg (keys %tmp) {
-    $maindata{packages}{$pkg} ||= {};
-    foreach(keys %{$maindata{packages}{$pkg}}) {
-        delete $maindata{packages}{$pkg}{$_} if(/^chl_/);
+    $maindata{$pkg} ||= {};
+    foreach(keys %{$maindata{$pkg}}) {
+        delete $maindata{$pkg}{$_} if(/^chl_/);
     }
     my $data = read_changelog($pkg);
     foreach(keys %$data) {
-        $maindata{packages}{$pkg}{$_} = $data->{$_};
+        $maindata{$pkg}{$_} = $data->{$_};
     }
 }
 if($cpan_updated) {
     push @wmodified, grep(
-        { $maindata{packages}{$_}{watch_cpan} }
+        { $maindata{$_}{watch_cpan} }
         @svn_packages );
 }
 %tmp = map({ $_ => 1 } @wmodified); # eliminate dupes
 foreach(keys %tmp) {
-    my $pkg = $maindata{packages}{$_};
+    my $pkg = $maindata{$_};
     my($st, @data) = read_watch($_);
     foreach(keys %{$pkg}) {
         delete $pkg->{$_} if(/^watch_/);
@@ -787,7 +793,7 @@
     $total++;
 
     debugmsg("Examining $_\n" );
-    my $pkg = $maindata{packages}{$_};
+    my $pkg = $maindata{$_};
 
     debugmsg(sprintf(" - Archive has %s\n", $packages{$_} || 'none'));
     debugmsg(sprintf(" - experimental has %s\n",




More information about the Pkg-perl-cvs-commits mailing list