r14254 - /scripts/qa/DebianQA/Svn.pm

tincho-guest at users.alioth.debian.org tincho-guest at users.alioth.debian.org
Thu Feb 7 18:58:48 UTC 2008


Author: tincho-guest
Date: Thu Feb  7 18:58:48 2008
New Revision: 14254

URL: http://svn.debian.org/wsvn/?sc=1&rev=14254
Log:
Modified safe_svn_op to return meaningful values.
Use it to avoid errors when tag dir doesn't exist.

Modified:
    scripts/qa/DebianQA/Svn.pm

Modified: scripts/qa/DebianQA/Svn.pm
URL: http://svn.debian.org/wsvn/scripts/qa/DebianQA/Svn.pm?rev=14254&op=diff
==============================================================================
--- scripts/qa/DebianQA/Svn.pm (original)
+++ scripts/qa/DebianQA/Svn.pm Thu Feb  7 18:58:48 2008
@@ -128,9 +128,10 @@
         if(find_stamp($cdata, $dir) < $revision) {
             debug("Retrieving tags for $dir");
             my $pkghome = "$prepath/$dir$postpath";
-            my %tagdirs = %{$svn->ls($pkghome, 'HEAD', 0)};
+            my $tagdirs = safe_svn_op($svn, ls => $pkghome, 'HEAD', 0);
             my @tagdirs = sort( { deb_compare_nofail($a, $b) }
-                grep({ $tagdirs{$_}->kind() == $SVN::Node::dir } keys(%tagdirs))
+                grep({ $tagdirs->{$_}->kind() == $SVN::Node::dir }
+                    keys(%{$tagdirs || {}}))
             );
             $tags{$dir} = \@tagdirs;
         }
@@ -441,17 +442,16 @@
 sub safe_svn_op($$@) {
     my($svn, $op, @opts) = @_;
     local $SVN::Error::handler = undef;
-    my ($svn_error) = eval "\$svn->$op(\@opts)";
-    die $@ if($@);
-    if(SVN::Error::is_error($svn_error)) {
-        if($svn_error->apr_err() == $SVN::Error::FS_NOT_FOUND) {
-            $svn_error->clear();
+    my ($svn_out) = eval "\$svn->$op(\@opts)";
+    if(SVN::Error::is_error($svn_out)) {
+        if($svn_out->apr_err() == $SVN::Error::FS_NOT_FOUND) {
+            $svn_out->clear();
             return 0;
         } else {
-            SVN::Error::croak_on_error($svn_error);
-        }
-    }
-    return 1;
+            SVN::Error::croak_on_error($svn_out);
+        }
+    }
+    return $svn_out || "0E0";
 }
 
 sub split_description($) {




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