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

Harald Sitter apachelogger-guest at moszumanska.debian.org
Thu Dec 3 13:41:49 UTC 2015


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

The following commit has been merged in the master branch:
commit bf6916c7f87518e23bfec112d7ac4fca15b60fa5
Author: Harald Sitter <sitter at kde.org>
Date:   Thu Dec 3 14:33:36 2015 +0100

    resolve numberous style violations in source_publisher.rb
---
 kci/source_publisher.rb | 65 ++++++++++++++++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 22 deletions(-)

diff --git a/kci/source_publisher.rb b/kci/source_publisher.rb
index a402ab7..acf11cd 100755
--- a/kci/source_publisher.rb
+++ b/kci/source_publisher.rb
@@ -8,9 +8,22 @@ require_relative '../lib/debian/changelog'
 require_relative '../lib/lp'
 require_relative '../lib/retry'
 
+# Publishes a source to launchpad and waits for it to build.
 class SourcePublisher
-  WAITING_STATES = ['Needs building',  'Currently building', 'Uploading build', 'Cancelling build']
-  FAILED_STATES = ['Chroot problem', 'Failed to upload', 'Failed to build', 'Build for superseded Source', 'Cancelled build', 'Dependency wait']
+  WAITING_STATES = [
+    'Needs building',
+    'Currently building',
+    'Uploading build',
+    'Cancelling build'
+  ]
+  FAILED_STATES = [
+    'Chroot problem',
+    'Failed to upload',
+    'Failed to build',
+    'Build for superseded Source',
+    'Cancelled build',
+    'Dependency wait'
+  ]
   SUCCESS_STATES = ['Successfully built']
 
   def initialize(source_name, source_version, ppa = 'unstable')
@@ -28,7 +41,8 @@ class SourcePublisher
       sleep(60)
       fail_count -= 1
       if fail_count <= 0
-        fail 'Upload was likely rejected, we have been waiting for well over 30 minutes!'
+        fail 'Upload was likely rejected, we have been waiting for well' \
+             ' over 30 minutes!'
       end
     end
 
@@ -77,7 +91,7 @@ class SourcePublisher
     loop do
       has_pending = false
       source_id = File.basename(source.self_link)
-      build_summary = @ppa.getBuildSummariesForSourceIds(:source_ids => source_id)
+      build_summary = @ppa.getBuildSummariesForSourceIds(source_ids: source_id)
       status = build_summary[source_id]['status']
       case status
       when 'FULLYBUILT_PENDING'
@@ -86,7 +100,8 @@ class SourcePublisher
         has_pending = false
       else
         # FIXME: fail?
-        puts "Something very terrible happened as the overall state is #{status}, which was not expected at all"
+        puts 'Something very terrible happened as the overall state is' \
+             " #{status}, which was not expected at all"
         print_state(get_source)
         return false
       end
@@ -109,21 +124,23 @@ class SourcePublisher
   private
 
   def print_state(source)
-    puts "%s/%s (%s) %s" % [source.distro_series.name,
-      source.source_package_name,
-      source.source_package_version,
-      source.status]
+    puts format('%s/%s (%s) %s',
+                source.distro_series.name,
+                source.source_package_name,
+                source.source_package_version,
+                source.status)
     build_logs = {}
     anchor_file = File.open('_anchor-chain', 'w')
-    source.getBuilds().each do |build|
-      puts "  %s [%s] (%s) %s :: %s :: %s" % [source.source_package_name,
-        build.arch_tag,
-        source.source_package_version,
-        build.buildstate,
-        build.web_link,
-        build.build_log_url]
-        build_logs[build.arch_tag] = build.build_log_url
-        anchor_file.write("%s	%s
" % [build.arch_tag, build.build_log_url])
+    source.getBuilds.each do |build|
+      puts format('  %s [%s] (%s) %s :: %s :: %s',
+                  source.source_package_name,
+                  build.arch_tag,
+                  source.source_package_version,
+                  build.buildstate,
+                  build.web_link,
+                  build.build_log_url)
+      build_logs[build.arch_tag] = build.build_log_url
+      anchor_file.write(format("%s	%s
", build.arch_tag, build.build_log_url))
     end
     anchor_file.close
 
@@ -133,7 +150,7 @@ class SourcePublisher
     end
     puts build_log_marker
 
-    source.getPublishedBinaries().each do |binary|
+    source.getPublishedBinaries.each do |binary|
       puts "    #{binary.display_name} #{binary.status}"
     end
   end
@@ -165,7 +182,9 @@ class SourcePublisher
 
   def source
     return @source if defined?(@source)
-    sources = @ppa.getPublishedSources(source_name: @source_name, version: @source_version, exact_match: true)
+    sources = @ppa.getPublishedSources(source_name: @source_name,
+                                       version: @source_version,
+                                       exact_match: true)
     return nil if sources.size < 1
     fail "Unexpectedly too many matching sources #{sources}" if sources.size > 1
     @source = sources[0]
@@ -179,12 +198,14 @@ class SourcePublisher
 end
 
 if __FILE__ == $PROGRAM_NAME
-  _version = "5.4.0"
+  _version = '5.4.0'
   # job_name = ARGV[0]
   # ppa_name = ARGV[1]
 
   # publisher = SourcePublisher.new(changelog.name, changelog.version, ARGV[1])
-  publisher = SourcePublisher.new("qtxmlpatterns-opensource-src", "5.4.0-0ubuntu1~ubuntu14.10~ppa2", 'unstable')
+  publisher = SourcePublisher.new('qtxmlpatterns-opensource-src',
+                                  '5.4.0-0ubuntu1~ubuntu14.10~ppa2',
+                                  'unstable')
   abort 'PPA Build Failed' unless publisher.wait
   sleep(5)
 end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list