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

Harald Sitter apachelogger-guest at moszumanska.debian.org
Thu Oct 8 10:42:38 UTC 2015


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

The following commit has been merged in the master branch:
commit 7670416f97274ff8400dce36761751b4aabdf582
Author: Harald Sitter <sitter at kde.org>
Date:   Thu Oct 8 12:41:40 2015 +0200

    port builder to lint::log, remove everything that is unused now
---
 kci/builder.rb           | 129 +++++------------------------------------------
 lib/lint/log.rb          |   1 -
 lib/lint/log/lintian.rb  |  12 +----
 test/test_kci_builder.rb |   3 +-
 4 files changed, 16 insertions(+), 129 deletions(-)

diff --git a/kci/builder.rb b/kci/builder.rb
index 691f729..b1fd7d0 100755
--- a/kci/builder.rb
+++ b/kci/builder.rb
@@ -12,6 +12,7 @@ require_relative '../lib/debian/dsc_arch_twiddle'
 require_relative '../lib/cmake_parser'
 require_relative '../lib/kci'
 require_relative '../lib/lint/control'
+require_relative '../lib/lint/log'
 require_relative '../lib/lint/result'
 require_relative '../lib/lint/series'
 require_relative '../lib/lint/symbols'
@@ -182,10 +183,10 @@ class KCIBuilder
     updated_symbols = update_symbols(log_data, logs, architectures_with_log,
                                      project, source)
 
-    puts_log(log_data, updated_symbols: updated_symbols)
-
-    # Lint control file
     results = []
+    # Lint log.
+    results += lint_logs(log_data, updated_symbols: updated_symbols)
+    # Lint control file
     results << Lint::Control.new('packaging').lint
     results << Lint::Series.new('packaging').lint
     results << Lint::Symbols.new('packaging').lint
@@ -269,12 +270,6 @@ class KCIBuilder
     thread.kill
   end
 
-  def self.segmentify(data, start_marker, end_marker)
-    warn 'Compatibility function segmentify called. BuildLogSegmenter should be' \
-         ' used instead.'
-    BuildLogSegmenter.segmentify(data, start_marker, end_marker)
-  end
-
   def self.puts_kci(type, str)
     Lint::ResultLogger.puts_kci(type, str)
   end
@@ -291,110 +286,6 @@ class KCIBuilder
     puts_kci('I', str)
   end
 
-  def self.ignore?(array_of_ignores, thing_to_check)
-    array_of_ignores.each do |possibly_ignore|
-      if thing_to_check == possibly_ignore ||
-         thing_to_check.start_with?(possibly_ignore) ||
-         thing_to_check.start_with?(possibly_ignore.chomp('*'))
-        return true
-      end
-    end
-    false
-  end
-
-  def self.puts_cmake(data)
-    # Bit of compat code. Very lovely... NOT
-    parser = CMakeParser.new(data)
-    unless parser.valid
-      puts_info 'CMakeParser could not parse the log correctly. Aborting parser.'
-      return
-    end
-    missing = parser.missing
-    warnings = parser.warnings
-    disabled_features = parser.disabled_features
-
-    puts 'KCI::CMAKE'
-
-    # Force an ignore on Qt5TextToSpeech, it's not released as of right now.
-    # 2015-03-05
-    ignore_missing = %w(Qt5TextToSpeech)
-    cmake_ignore_path = "#{@workspace_path}/packaging/debian/meta/cmake-ignore"
-    if File.exist?(cmake_ignore_path)
-      ignore_missing += File.read(cmake_ignore_path).strip.split("
")
-    end
-
-    missing.each do |dep|
-      next if ignore?(ignore_missing, dep)
-      puts_warning("Missing Dep: #{dep}")
-    end
-
-    warnings.each do |warning|
-      puts_warning(warning)
-    end
-
-    disabled_features.each do |disabled_feature|
-      next if ignore?(ignore_missing, disabled_feature)
-      puts_warning("Disabled Feature: #{disabled_feature}")
-    end
-  end
-
-  def self.puts_list_missing(data)
-    data = segmentify(data,
-                      "=== Start list-missing
",
-                      "=== End list-missing
")
-    return if data.empty?
-    puts 'KCI::MISSING'
-    data.each do |line|
-      # Missing files are always considered errors
-      puts_error(line)
-    end
-  end
-
-  def self.puts_lintian(data, updated_symbols: false)
-    data = segmentify(data, "=== Start lintian
", "=== End lintian
")
-    return if data.empty?
-    puts 'KCI::LINTIAN'
-    data.each do |line|
-      next if line.start_with?('warning: ') # random warnings from lintian itself
-
-      # Package names can easily go beyond what shit can suck on, so gag it.
-      next if line.include?('source-package-component-has-long-file-name')
-      next if line.include?('package-has-long-file-name')
-
-      # We really do not care about standards versions for now. They only ever get
-      # bumped by the pkg-kde team anyway.
-      next if line.include?('out-of-date-standards-version')
-      next if line.include?('newer-standards-version')
-
-      # We package an enormous amount of GUI apps without manpages (in fact
-      # they arguably wouldn't even make sense what with being GUI apps). So
-      # ignore any and all manpage warnings to save Harald from having to override
-      # them in every single application repository.
-      next if line.include?('binary-without-manpage')
-
-      # Fuck you
-      next if line.include?('debian-revision-should-not-be-zero')
-      next if line.include?('bad-distribution-in-changes-file wily')
-      next if line.include?('not-binnmuable-any-depends-all')
-
-      # Do not print symbols warnings if we already auto-updated.
-      if updated_symbols &&
-         line.include?('symbols-file-contains-current-version-with-debian-revision')
-        next
-      end
-
-      case line[0..1]
-      when 'W:'
-        puts_warning(line)
-        next
-      when 'E:'
-        puts_error(line)
-        next
-      end
-      puts_info(line)
-    end
-  end
-
   def self.update_symbols(log_data, logs, architectures_with_log, project,
                           source)
     updated_symbols = false
@@ -437,10 +328,14 @@ class KCIBuilder
     updated_symbols
   end
 
-  def self.puts_log(log_data, updated_symbols:)
-    puts_cmake(log_data)
-    puts_list_missing(log_data)
-    puts_lintian(log_data, updated_symbols: updated_symbols)
+  def self.lint_logs(log_data, updated_symbols:)
+    results = Lint::Log.new(log_data).lint
+    if updated_symbols # Drop symbols error if we applied an update.
+      results.reject! do |i|
+        i.include?('symbols-file-contains-current-version-with-debian-revision')
+      end
+    end
+    results
   end
 end
 
diff --git a/lib/lint/log.rb b/lib/lint/log.rb
index 11bd673..953b274 100644
--- a/lib/lint/log.rb
+++ b/lib/lint/log.rb
@@ -17,7 +17,6 @@ module Lint
       [CMake, Lintian, ListMissing].each do |klass|
         results << klass.new.lint(@log_data.clone)
       end
-      # FIXME: symbols handling not implemented
       results
     end
   end
diff --git a/lib/lint/log/lintian.rb b/lib/lint/log/lintian.rb
index a57af32..947001c 100644
--- a/lib/lint/log/lintian.rb
+++ b/lib/lint/log/lintian.rb
@@ -19,8 +19,8 @@ module Lint
         # ignore any and all manpage warnings to save Harald from having to
         # override them in every single application repository.
         'binary-without-manpage',
-        # We don't care about binnmuable, there is no such thing in Ubuntu.
-        'not-binnmuable-any-depends-all',
+        # TODO: check if we still need or want these
+        # next if line.include?('not-binnmuable-any-depends-all')
         # Lintian is made for stupid people.
         # FIXME: needs test probably
         'debian-revision-should-not-be-zero',
@@ -51,14 +51,6 @@ module Lint
 
       def lint_line(line, result)
         return if exclude?(line)
-
-# FIXME: symbols
-        # # Do not print symbols warnings if we already auto-updated.
-        # if args[:updated_symbols] &&
-        #   line.include?('symbols-file-contains-current-version-with-debian-revision')
-        #   next
-        # end
-
         case line[0..1]
         when 'W:'
           result.warnings << line
diff --git a/test/test_kci_builder.rb b/test/test_kci_builder.rb
index 568fb8c..882ef4e 100644
--- a/test/test_kci_builder.rb
+++ b/test/test_kci_builder.rb
@@ -127,7 +127,8 @@ class KCIBuilderTest < TestCase
   def test_puts_log
     Dir.glob("#{data}/*/*").each do |f|
       next if File.directory?(f)
-      KCIBuilder.puts_log(File.read(f), updated_symbols: false)
+      results = KCIBuilder.lint_logs(File.read(f), updated_symbols: false)
+      assert_false(results.empty?)
     end
   end
 end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list