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

Harald Sitter apachelogger-guest at moszumanska.debian.org
Mon Mar 9 13:15:26 UTC 2015


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

The following commit has been merged in the master branch:
commit 45536497c810074a94c6e1bc3ede3cfa10f62909
Author: Harald Sitter <sitter at kde.org>
Date:   Mon Mar 9 14:15:23 2015 +0100

    resolve a whole wall of rubocop warnings in builder
---
 kci/builder.rb | 176 +++++++++++++++++++++++++++++----------------------------
 1 file changed, 90 insertions(+), 86 deletions(-)

diff --git a/kci/builder.rb b/kci/builder.rb
index 9f8c6db..c607059 100755
--- a/kci/builder.rb
+++ b/kci/builder.rb
@@ -30,7 +30,6 @@ require_relative 'lib/cmake_parser'
 -> update_symbols
 =end
 
-
 ENV['HOME'] = '/var/lib/jenkins'
 ENV['PATH'] = '/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin'
 ENV['GNUPGHOME'] = '/var/lib/jenkins/tooling/gnupg'
@@ -48,7 +47,9 @@ project = Project.new(components[0], components[1], components[2])
 
 PPA = "ppa:kubuntu-ci/#{project.stability}"
 
-File.open('/etc/apt/apt.conf.d/apt-cacher', 'w') { |file| file.puts('Acquire::http { Proxy "http://10.0.3.1:3142"; };') }
+File.open('/etc/apt/apt.conf.d/apt-cacher', 'w') do |file|
+  file.puts('Acquire::http { Proxy "http://10.0.3.1:3142"; };')
+end
 
 # PWD
 fail 'Could not change dir to ARGV1' unless Dir.chdir(ARGV[1])
@@ -111,33 +112,36 @@ end
 
 # Rip out locale install
 Dir.chdir('build/source/') do
-    Dir.glob('debian/*.install').each do | install_file_path |
-        # Strip localized manpages
-        # e.g.  usr /share /man /  *  /man 7 /kf5options.7
-        subbed = File.open(install_file_path).read().gsub(/^.*usr\/share\/man\/(\*|\w+)\/man\d\/.*$/, '')
-        File.open(install_file_path, 'w') do |f|
-            f << subbed
-        end
+  Dir.glob('debian/*.install').each do | install_file_path |
+    # Strip localized manpages
+    # e.g.  usr /share /man /  *  /man 7 /kf5options.7
+    man_regex = %r{^.*usr/share/man/(\*|\w+)/man\d/.*$}
+    subbed = File.open(install_file_path).read.gsub(man_regex, '')
+    File.open(install_file_path, 'w') do |f|
+      f << subbed
+    end
 
-        # FIXME: bloody workaround for kconfigwidgets and kdelibs4support containing legit locale data
-        next if source_name == 'kconfigwidgets' or source_name == 'kdelibs4support'
-        subbed = File.open(install_file_path).read().gsub(/^.*usr\/share\/locale.*$/, '')
-        File.open(install_file_path, 'w') do |f|
-            f << subbed
-        end
+    # FIXME: bloody workaround for kconfigwidgets and kdelibs4support containing
+    # legit locale data
+    next if source_name == 'kconfigwidgets' || source_name == 'kdelibs4support'
+    locale_regex = %r{^.*usr/share/locale.*$}
+    subbed = File.open(install_file_path).read.gsub(locale_regex, '')
+    File.open(install_file_path, 'w') do |f|
+      f << subbed
     end
-    # If the package is now empty, lintian override the empty warning to avoid false positives
-    Dir.glob('debian/*.install').each do | install_file_path |
-        next unless File.open(install_file_path, 'r').read.strip.empty?
-        package_name = File.basename(install_file_path, '.install')
-        lintian_overrides_path = install_file_path.gsub('.install', '.lintian-overrides')
-        puts "#{package_name} is now empty, trying to add lintian override"
-        fopen_flag = 'w'
-        if File.exist?(lintian_overrides_path)
-            fopen_flag = 'a'
-        end
-        File.open(lintian_overrides_path, fopen_flag) { |file| file.write("#{package_name}: empty-binary-package
") }
+  end
+  # If the package is now empty, lintian override the empty warning to avoid
+  # false positives
+  Dir.glob('debian/*.install').each do | install_file_path |
+    next unless File.open(install_file_path, 'r').read.strip.empty?
+    package_name = File.basename(install_file_path, '.install')
+    lintian_overrides_path = install_file_path.gsub('.install',
+                                                    '.lintian-overrides')
+    puts "#{package_name} is now empty, trying to add lintian override"
+    File.open(lintian_overrides_path, 'a') do |file|
+      file.write("#{package_name}: empty-binary-package
")
     end
+  end
 end
 
 # dpkg-buildpackage
@@ -161,37 +165,39 @@ def timeout_spawn(cmd, timeout)
     return false
   end
 end
+
 Dir.chdir('build/source/') do
-    changelog = Changelog.new
-    # Upload likes to get stuck, so we do timeout control to prevent all of
-    # builder from getting stuck.
-    # We try to dput two times in a row giving it first 30 minutes and then
-    # 15 minutes to complete. If it didn't manage to upload after that we
-    # ignore the package and move on.
-    `cp -rf /var/lib/jenkins/.ssh /root/`
-    `chown -Rv root:root /root/.ssh`
-    if `ssh-keygen -F ppa.launchpad.net`.strip.empty?
-      `ssh-keyscan -H ppa.launchpad.net >> ~/.ssh/known_hosts`
-    end
-    dput = "dput -c #{DPUTCONF} #{PPA} ../#{changelog.name}_#{changelog.version(Changelog::BASE | Changelog::BASESUFFIX)}*.changes"
-    success = false
-    4.times do |count|
-        # Note: count starts at 0 ;)
-        if timeout_spawn(dput, 60 * (30.0/(count+1)))
-            success = true
-            break
-        end
-        sleep(60) # Sleep for a minute
-    end
-    raise '		 !!!!!!!!!!!!!!!! dput failed two times !!!!!!!!!!!!!!!!' unless success
-    Dir.chdir('../..') do # main dir
-        raise 'PPA Interaction Failed' unless system("#{File.expand_path(File.dirname(__FILE__))}/ppa-wait.py #{changelog.name} #{changelog.version} #{project.stability}")
-        # Write upload data to file, we perhaps want to do something outside the build container.
-        data = { :name => changelog.name,
-                 :version => changelog.version,
-                 :type => project.stability }
-        File.write('source.json', JSON.generate(data))
+  changelog = Changelog.new
+  # Upload likes to get stuck, so we do timeout control to prevent all of
+  # builder from getting stuck.
+  # We try to dput two times in a row giving it first 30 minutes and then
+  # 15 minutes to complete. If it didn't manage to upload after that we
+  # ignore the package and move on.
+  `cp -rf /var/lib/jenkins/.ssh /root/`
+  `chown -Rv root:root /root/.ssh`
+  if `ssh-keygen -F ppa.launchpad.net`.strip.empty?
+    `ssh-keyscan -H ppa.launchpad.net >> ~/.ssh/known_hosts`
+  end
+  dput = "dput -c #{DPUTCONF} #{PPA} ../#{changelog.name}_#{changelog.version(Changelog::BASE | Changelog::BASESUFFIX)}*.changes"
+  success = false
+  4.times do |count|
+    # Note: count starts at 0 ;)
+    if timeout_spawn(dput, 60 * (30.0 / (count + 1)))
+      success = true
+      break
     end
+    sleep(60) # Sleep for a minute
+  end
+  fail '		 !!!!!!!!!!!! dput failed two times !!!!!!!!!!!!' unless success
+  Dir.chdir('../..') do # main dir
+    fail 'PPA Interaction Failed' unless system("#{File.expand_path(File.dirname(__FILE__))}/ppa-wait.py #{changelog.name} #{changelog.version} #{project.stability}")
+    # Write upload data to file, we perhaps want to do something outside the
+    # build container.
+    data = { :name => changelog.name,
+             :version => changelog.version,
+             :type => project.stability }
+    File.write('source.json', JSON.generate(data))
+  end
 end
 
 exit 0 unless File.exist?('logs/i386.log.gz')
@@ -236,13 +242,8 @@ def puts_cmake(data, source_name)
   end
 
   missing.each do |dep|
-    p dep
-    p ignore_missing
     ignore = false
     ignore_missing.each do |possibly_ignore|
-      p possibly_ignore == dep
-      p dep.start_with?(possibly_ignore)
-      p dep.start_with?(possibly_ignore.chomp('*'))
       if possibly_ignore == dep || dep.start_with?(possibly_ignore) ||
          dep.start_with?(possibly_ignore.chomp('*'))
         ignore = true
@@ -329,35 +330,38 @@ log_data = File.open("logs/#{archindep}.log").read
 
 updated_symbols = false
 # FIXME: stability wtf
-if project.series == 'vivid' && log_data.match(/dpkg-gensymbols: warning: (.*)\/symbols doesn't match completely debian\/(.*).symbols/)
-    puts 'KCI::SYMBOLS'
-    if log_data.include?('dpkg-gensymbols: warning: some new symbols appeared')
-        match = log_data.match(/--- debian\/(.*).symbols/)
-        if match and match.size > 1
-            Dir.chdir("#{WORKSPACE_PATH}/packaging") do
-                system('git config core.sparsecheckout')
-                system('git checkout -f remotes/packaging/kubuntu_unstable')
-                system('git branch -a')
-                system('git status')
-                system('git reset --hard')
-                captures = match.captures
-                captures.each do |lib_package|
-                    puts "pkgkde-symbolshelper batchpatch -v #{base_version} -c #{architectures_with_log.join(',')} #{logs.join(' ')}"
-                    system("pkgkde-symbolshelper batchpatch -v #{base_version} -c #{architectures_with_log.join(',')} #{logs.join(' ')}")
-                    updated_symbols = ($? == 0)
-                    puts_info("Auto-updated symbols of #{lib_package}")
-                end
-                # Username et al apparently is somehow coming from .git or something apparently
-                system('git status')
-                system('git diff')
-                system('git commit -a -m "Automatic symbol update"')
-            end
-        else
-            puts_error('Failed to update symbols as the package name(s) could not be parsed.')
+gensymbols_regex = %r{dpkg-gensymbols: warning: (.*)/symbols doesn't match completely debian/(.*).symbols}
+if project.series == 'vivid' && log_data.match(gensymbols_regex)
+  puts 'KCI::SYMBOLS'
+  if log_data.include?('dpkg-gensymbols: warning: some new symbols appeared')
+    match = log_data.match(/--- debian\/(.*).symbols/)
+    if match && match.size > 1
+      Dir.chdir("#{WORKSPACE_PATH}/packaging") do
+        system('git config core.sparsecheckout')
+        system('git checkout -f remotes/packaging/kubuntu_unstable')
+        system('git branch -a')
+        system('git status')
+        system('git reset --hard')
+        captures = match.captures
+        captures.each do |lib_package|
+          puts "pkgkde-symbolshelper batchpatch -v #{base_version} -c #{architectures_with_log.join(',')} #{logs.join(' ')}"
+          system("pkgkde-symbolshelper batchpatch -v #{base_version} -c #{architectures_with_log.join(',')} #{logs.join(' ')}")
+          updated_symbols = ($? == 0)
+          puts_info("Auto-updated symbols of #{lib_package}")
         end
+        # Username et al apparently is somehow coming from .git or something
+        # apparently
+        system('git status')
+        system('git diff')
+        system('git commit -a -m "Automatic symbol update"')
+      end
     else
-        puts_error('It would very much appear that symbols have been retracted')
+      puts_error('Failed to update symbols as the package name(s) could not be'\
+                 ' parsed.')
     end
+  else
+    puts_error('It would very much appear that symbols have been retracted')
+  end
 end
 
 puts_cmake(log_data, source_name)

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list