[SCM] ci-tooling packaging branch, master, updated. 1f7f343530167918566867f85e181d2c9517b107

Harald Sitter apachelogger-guest at moszumanska.debian.org
Tue Jan 12 09:26:53 UTC 2016


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

The following commit has been merged in the master branch:
commit 261bbeb27ef61a82179d2533a17fe9f5d7a7289e
Author: Harald Sitter <sitter at kde.org>
Date:   Tue Jan 12 10:25:53 2016 +0100

    improve readability and performance of path splitting a bit
---
 lib/projects.rb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/projects.rb b/lib/projects.rb
index e51dc9e..70dd4b3 100644
--- a/lib/projects.rb
+++ b/lib/projects.rb
@@ -265,9 +265,10 @@ class ProjectFactory
         end
         repos = static_ci['repos'].collect { |e| p OpenStruct.new(e) }
         repos.each do |repo|
-          component = repo.path.split('/')[-2]
-          name = repo.path.split('/')[-1]
-          git_path = repo.path.split('/')[0..-3].join('/')
+          repo_path_parts = repo.path.split('/')
+          name = repo_path_parts.pop
+          component = repo_path_parts.pop || ''
+          git_path = repo_path_parts.pop || ''
           case static_ci['type']
           when 'neon'
             # FIXME: fekking hardcoded url

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list