r8859 - in /scripts/qa/QA: Archive.pm BTS.pm Cache.pm Common.pm Config.pm DebBugs.pm DebVersions.pm DebianArchive.pm Svn.pm VerComp.pm Watch.pm

tincho-guest at users.alioth.debian.org tincho-guest at users.alioth.debian.org
Sun Nov 4 19:57:50 UTC 2007


Author: tincho-guest
Date: Sun Nov  4 19:57:50 2007
New Revision: 8859

URL: http://svn.debian.org/wsvn/?sc=1&rev=8859
Log:
- Namespace renaming (step 1)
- Watch module (incomplete)
- Correct consolidated hash upgrade on Svn

Added:
    scripts/qa/QA/Archive.pm
      - copied, changed from r8858, scripts/qa/QA/DebianArchive.pm
    scripts/qa/QA/BTS.pm
      - copied, changed from r8858, scripts/qa/QA/DebBugs.pm
    scripts/qa/QA/DebVersions.pm
      - copied, changed from r8820, scripts/qa/QA/VerComp.pm
    scripts/qa/QA/Watch.pm   (with props)
Removed:
    scripts/qa/QA/DebBugs.pm
    scripts/qa/QA/DebianArchive.pm
    scripts/qa/QA/VerComp.pm
Modified:
    scripts/qa/QA/Cache.pm
    scripts/qa/QA/Common.pm
    scripts/qa/QA/Config.pm
    scripts/qa/QA/Svn.pm

Copied: scripts/qa/QA/Archive.pm (from r8858, scripts/qa/QA/DebianArchive.pm)
URL: http://svn.debian.org/wsvn/scripts/qa/QA/Archive.pm?rev=8859&op=diff
==============================================================================
--- scripts/qa/QA/DebianArchive.pm (original)
+++ scripts/qa/QA/Archive.pm Sun Nov  4 19:57:50 2007
@@ -9,18 +9,18 @@
 # Copyright Martín Ferrari <martin.ferrari at gmail.com>, 2007
 # Released under the terms of the GNU GPL 2
 
-package QA::DebianArchive;
+package DebianQA::Archive;
 use strict;
 use warnings;
 
 our @ISA = "Exporter";
 our @EXPORT = qw(deb_download deb_get deb_get_consolidated);
 
-use QA::Cache;
-use QA::Common;
-use QA::Config '$MIRROR';
-use QA::Svn;
-use QA::VerComp;
+use DebianQA::Cache;
+use DebianQA::Common;
+use DebianQA::Config '$MIRROR';
+use DebianQA::Svn;
+use DebianQA::VerComp;
 use LWP::UserAgent;
 #use IO::Uncompress::Gunzip; # Only in lenny
 use IO::Scalar;

Copied: scripts/qa/QA/BTS.pm (from r8858, scripts/qa/QA/DebBugs.pm)
URL: http://svn.debian.org/wsvn/scripts/qa/QA/BTS.pm?rev=8859&op=diff
==============================================================================
--- scripts/qa/QA/DebBugs.pm (original)
+++ scripts/qa/QA/BTS.pm Sun Nov  4 19:57:50 2007
@@ -8,16 +8,16 @@
 # Copyright Martín Ferrari <martin.ferrari at gmail.com>, 2007
 # Released under the terms of the GNU GPL 2
 
-package QA::DebBugs;
+package DebianQA::BTS;
 use strict;
 use warnings;
 
 our @ISA = "Exporter";
 our @EXPORT = qw(bts_download bts_get bts_get_consolidated);
 
-use QA::Common;
-use QA::Cache;
-use QA::Svn;
+use DebianQA::Common;
+use DebianQA::Cache;
+use DebianQA::Svn;
 use SOAP::Lite;
 
 my $ttl = 360;	# 6 hours

Modified: scripts/qa/QA/Cache.pm
URL: http://svn.debian.org/wsvn/scripts/qa/QA/Cache.pm?rev=8859&op=diff
==============================================================================
--- scripts/qa/QA/Cache.pm (original)
+++ scripts/qa/QA/Cache.pm Sun Nov  4 19:57:50 2007
@@ -6,7 +6,7 @@
 # Copyright Martín Ferrari <martin.ferrari at gmail.com>, 2007
 # Released under the terms of the GNU GPL 2
 
-package QA::Cache;
+package DebianQA::Cache;
 use strict;
 use warnings;
 
@@ -14,8 +14,8 @@
 our @EXPORT = (qw(
     dump_cache unlock_cache read_cache update_cache find_stamp ));
 
-use QA::Config '$CACHEDIR';
-use QA::Common;
+use DebianQA::Config '$CACHEDIR';
+use DebianQA::Common;
 use Storable qw(store_fd fd_retrieve);
 use Fcntl qw(:seek :flock);
 use File::Path;

Modified: scripts/qa/QA/Common.pm
URL: http://svn.debian.org/wsvn/scripts/qa/QA/Common.pm?rev=8859&op=diff
==============================================================================
--- scripts/qa/QA/Common.pm (original)
+++ scripts/qa/QA/Common.pm Sun Nov  4 19:57:50 2007
@@ -6,14 +6,14 @@
 # Copyright Martín Ferrari <martin.ferrari at gmail.com>, 2007
 # Released under the terms of the GNU GPL 2
 
-package QA::Common;
+package DebianQA::Common;
 use strict;
 use warnings;
 
 our @ISA = "Exporter";
 our @EXPORT = qw(debug info warn error);
 
-use QA::Config;
+use DebianQA::Config;
 use POSIX;
 
 my $basename = $0;

Modified: scripts/qa/QA/Config.pm
URL: http://svn.debian.org/wsvn/scripts/qa/QA/Config.pm?rev=8859&op=diff
==============================================================================
--- scripts/qa/QA/Config.pm (original)
+++ scripts/qa/QA/Config.pm Sun Nov  4 19:57:50 2007
@@ -1,5 +1,5 @@
 # $Id$
-package QA::Config;
+package DebianQA::Config;
 
 use strict;
 use warnings;

Copied: scripts/qa/QA/DebVersions.pm (from r8820, scripts/qa/QA/VerComp.pm)
URL: http://svn.debian.org/wsvn/scripts/qa/QA/DebVersions.pm?rev=8859&op=diff
==============================================================================
--- scripts/qa/QA/VerComp.pm (original)
+++ scripts/qa/QA/DebVersions.pm Sun Nov  4 19:57:50 2007
@@ -8,7 +8,7 @@
 # Copyright Martín Ferrari <martin.ferrari at gmail.com>, 2007
 # Released under the terms of the GNU GPL 2
 
-package QA::VerComp;
+package DebianQA::DebVersions;
 use strict;
 use warnings;
 

Modified: scripts/qa/QA/Svn.pm
URL: http://svn.debian.org/wsvn/scripts/qa/QA/Svn.pm?rev=8859&op=diff
==============================================================================
--- scripts/qa/QA/Svn.pm (original)
+++ scripts/qa/QA/Svn.pm Sun Nov  4 19:57:50 2007
@@ -10,7 +10,7 @@
 # Copyright Martín Ferrari <martin.ferrari at gmail.com>, 2007
 # Released under the terms of the GNU GPL 2
 
-package QA::Svn;
+package DebianQA::Svn;
 use strict;
 use warnings;
 
@@ -23,9 +23,9 @@
 use IO::Scalar;
 use Digest::MD5 "md5_hex";
 use Parse::DebianChangelog;
-use QA::Cache;
-use QA::Common;
-use QA::Config qw($SVN_REPO $SVN_PKG_PATH);
+use DebianQA::Cache;
+use DebianQA::Common;
+use DebianQA::Config qw($SVN_REPO $SVN_PKG_PATH);
 use SVN::Client;
 
 sub svn_download {
@@ -144,20 +144,21 @@
         }
         $svn{$dir}{watch} = $watch;
     }
-    # if $complete, retain lock
-    my $cdata = update_cache("svn", \%svn, "", $complete, $complete);
-    return $cdata unless($complete);
-
-    my @pkglist = grep({ $svn{$_}{pkgname} } @dirlist);
+    # Retain lock
+    my $cdata = update_cache("svn", \%svn, "", $complete, 1);
+
+    my @pkglist = grep({ $svn{$_}{pkgname} } keys(%$cdata));
     my %pkglist = map({ $svn{$_}{pkgname} => 1 } @pkglist);
     update_cache("consolidated", \%pkglist, "pkglist", 1, 1);
 
     my %svn2;
-    foreach(@pkglist) {
-        $svn2{$svn{$_}{pkgname}} = $svn{$_};
-        $svn2{$svn{$_}{pkgname}}{dir} = $_;
-        delete $svn2{$svn{$_}{pkgname}}{watch};
-        delete $svn2{$svn{$_}{pkgname}}{pkgname};
+    foreach(keys(%$cdata)) {
+        my $pkgname = $cdata->{$_}{pkgname};
+        # Shallow copy, it's enough here, but can't be used for anything else
+        $svn2{$pkgname} = { %{$cdata->{$_}} };
+        $svn2{$pkgname}{dir} = $_;
+        delete $svn2{$pkgname}{watch};
+        delete $svn2{$pkgname}{pkgname};
     }
     update_cache("consolidated", \%svn2, "svn", 1, 0);
     unlock_cache("svn");

Added: scripts/qa/QA/Watch.pm
URL: http://svn.debian.org/wsvn/scripts/qa/QA/Watch.pm?rev=8859&op=file
==============================================================================
--- scripts/qa/QA/Watch.pm (added)
+++ scripts/qa/QA/Watch.pm Sun Nov  4 19:57:50 2007
@@ -1,0 +1,57 @@
+# vim:ts=4:sw=4:et:ai:sts=4
+# $Id$
+#
+# Module for scanning watch files and checking upstream versions.
+#
+# Copyright gregor herrmann <gregor+debian at comodo.priv.at>, 2007
+# Copyright Damyan Ivanov <dmn at debian.org>, 2007
+# Copyright Martín Ferrari <martin.ferrari at gmail.com>, 2007
+# Released under the terms of the GNU GPL 2
+
+package DebianQA::Watch;
+use strict;
+use warnings;
+
+our @ISA = "Exporter";
+our @EXPORT = qw(watch_download watch_get watch_get_consolidated);
+
+use Digest::MD5 "md5_hex";
+use DebianQA::Cache;
+use DebianQA::Common;
+use DebianQA::Svn;
+
+sub watch_download {
+    my($force, @list) = @_;
+    $force ||= 0;
+    debug("watch_download($force, (@list))");
+
+    my $complete = ! @list;
+    if($complete) {
+        @list = get_pkglist();
+    }
+    my $cdata = watch_get() unless($force);
+    my(%watch, %watch2);
+    foreach my $pkg (@list) {
+        debug("Retrieving svn info for $pkg");
+        my $data = svn_get($pkg);
+        if($data->{watch_error}) {
+            $watch2{$pkg} = { error => $data->{watch_error} };
+            next;
+        }
+        unless($data->{watch}) {
+            $watch2{$pkg} = { error => "Missing" };
+            next;
+        }
+
+    }
+}
+# Returns the hash of bugs. Doesn't download anything.
+sub watch_get {
+    return read_cache("watch", shift, 0);
+}
+# Returns the consolidated hash of bugs. Doesn't download anything.
+sub watch_get_consolidated {
+    my $path = shift || "";
+    return read_cache("consolidated", "watch/$path", 0);
+}
+

Propchange: scripts/qa/QA/Watch.pm
------------------------------------------------------------------------------
    svn:keywords = Id




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