[SCM] ci-tooling packaging branch, master, updated. 578931ba4d726523652a3a9edc94012df1916466

Harald Sitter apachelogger-guest at moszumanska.debian.org
Mon May 11 12:37:49 UTC 2015


Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=2d8457c

The following commit has been merged in the master branch:
commit 2d8457cedd3113f2d0357f8d9ea250f0358028b0
Author: Harald Sitter <sitter at kde.org>
Date:   Mon May 11 14:10:32 2015 +0200

    introduce Project::GitTransactionError
    
    instead of failing RuntimeError on git clone/checkout problems raise a
    custom GitTransactionError and in the factory only catch generic Project
    Errors rather than all errors. this is to enable things used by Project
    to actually raise in a fatal manner which otherwise the factory simply
    swollows
---
 lib/projects.rb | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/lib/projects.rb b/lib/projects.rb
index eec3cf3..d4717d0 100644
--- a/lib/projects.rb
+++ b/lib/projects.rb
@@ -8,6 +8,9 @@ require_relative 'debian/control'
 require_relative 'debian/source'
 
 class Project
+  class Error < Exception; end
+  class GitTransactionError < Error; end
+
   # Name of the thing (e.g. the repo name)
   attr_reader :name
   # Super component (e.g. plasma)
@@ -70,9 +73,11 @@ class Project
         while (i += 1) < 5
           break if system('git pull')
         end
-        fail 'Failed to pull' if i >= 5
+        fail GitTransactionError, 'Failed to pull' if i >= 5
 
-        fail "No branch #{type}" unless system("git checkout kubuntu_#{type}")
+        unless system("git checkout kubuntu_#{type}")
+          fail GitTransactionError, "No branch #{type}"
+        end
 
         next unless File.exist?('debian/control')
 
@@ -128,7 +133,7 @@ class ProjectFactory
         repos.each do |name|
           begin
             ret << Project.new(name, component, type: type)
-          rescue
+          rescue Project::Error
           end
         end
       end
@@ -137,7 +142,7 @@ class ProjectFactory
         names.each do |name|
           begin
             ret << Project.new(name, component, type: type)
-          rescue
+          rescue Project::Error
           end
         end
       end
@@ -149,7 +154,7 @@ class ProjectFactory
             unless blacklist.include?(name)
               ret << Project.new(name, component, type: type)
             end
-          rescue
+          rescue Project::Error
           end
         end
       end
@@ -175,7 +180,7 @@ class ProjectFactory
           begin
             ret << Project.new(repo, custom_ci['org'], custom_ci['git_host'],
                                type: type)
-          rescue
+          rescue Project::Error
           end
         end
       end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list