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

Harald Sitter apachelogger-guest at moszumanska.debian.org
Tue Oct 6 11:06:09 UTC 2015


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

The following commit has been merged in the master branch:
commit 92f4edb97d3ab78644471c762955d790094f925d
Author: Harald Sitter <sitter at kde.org>
Date:   Tue Oct 6 12:59:11 2015 +0200

    transition kcibuilder to build_source.rb
    
    this now enables natives to have a correctly native version, so adjust
    test accordingly
---
 kci/builder.rb           | 96 +-----------------------------------------------
 test/test_kci_builder.rb |  7 ++--
 2 files changed, 5 insertions(+), 98 deletions(-)

diff --git a/kci/builder.rb b/kci/builder.rb
index 800d489..d3b5604 100755
--- a/kci/builder.rb
+++ b/kci/builder.rb
@@ -5,6 +5,7 @@ require 'fileutils'
 require 'json'
 require 'timeout'
 
+require_relative 'lib/ci/build_source'
 require_relative 'lib/ci/build_version'
 require_relative 'lib/debian/changelog'
 require_relative 'lib/debian/dsc_arch_twiddle'
@@ -87,100 +88,7 @@ class KCIBuilder
     version = CI::BuildVersion.new(changelog)
     source_name = changelog.name
 
-    FileUtils.rm_r('build') if File.exist?('build')
-    FileUtils.mkpath('build/source/')
-
-    # copy upstream sources around
-    if Dir.exist?('source') && !Dir.glob('source/*').empty?
-      abort 'Failed to copy source' unless system('cp -r source/* build/source/')
-      Dir.chdir('build/source') do
-        FileUtils.rm_rf(Dir.glob('**/.bzr'))
-        FileUtils.rm_rf(Dir.glob('**/.git'))
-        FileUtils.rm_rf(Dir.glob('**/.svn'))
-      end
-
-      # create orig tar
-      Dir.chdir('build/') do
-        tar = "#{source_name}_#{version.tar}.orig.tar"
-        abort 'Failed to create a tarball' unless system("tar -cf #{tar} source")
-        abort 'Failed to compress the tarball' unless system("xz -6 #{tar}")
-      end
-
-      # Copy packaging
-      unless system('cp -r packaging/debian build/source/')
-        abort 'Failed to copy packaging'
-      end
-    else
-      # This is a native package as we have no upstream source directory.
-      # TODO: quite possibly this should be porperly validated via source format and
-      #       or changelog version format.
-      unless system('cp -r packaging/* build/source/')
-        abort 'Failed to copy packaging'
-      end
-    end
-
-    # Create changelog entry
-    Dir.chdir('build/source/') do
-      env = {
-        'DEBFULLNAME' => 'Kubuntu CI',
-        'DEBEMAIL' => 'kubuntu-ci at lists.launchpad.net'
-      }
-      args = []
-      args << '-b'
-      args << '-v' << version.full
-      args << '-D' << project.series
-      args << '"Automatic Kubuntu Build"'
-      abort 'Failed to create changelog entry' unless system(env, 'dch', *args)
-    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
-        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' || 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
-      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
-      # Rip out symbol files unless we are on latest
-      unless project.series == KCI.latest_series
-        symbols = Dir.glob('debian/symbols') +
-                  Dir.glob('debian/*.symbols') +
-                  Dir.glob('debian/*.symbols.*')
-        symbols.each { |s| FileUtils.rm(s) }
-      end
-    end
-
-    # dpkg-buildpackage
-    Dir.chdir('build/source/') do
-      system('update-maintainer')
-      unless system('dpkg-buildpackage -us -uc -S -d')
-        abort 'Failed to build source package'
-      end
-    end
+    source = VcsSourceBuilder.new(release: project.series).run
 
     # Mangle dsc to not do ARM builds unless explicitly enabled.
     # With hundreds of distinct sources on CI, building all of them on three
diff --git a/test/test_kci_builder.rb b/test/test_kci_builder.rb
index d6a07ab..1202798 100644
--- a/test/test_kci_builder.rb
+++ b/test/test_kci_builder.rb
@@ -56,10 +56,9 @@ class KCIBuilderTest < TestCase
     Dir.chdir('build')
     content = Dir.glob('*')
     assert_include(content,
-                   'hello_2.10+git20150717.1756+15.04-0_source.changes')
-    assert_include(content, 'hello_2.10+git20150717.1756+15.04-0.dsc')
-    assert_include(content, 'hello_2.10+git20150717.1756+15.04-0.tar.gz')
-    assert_include(content, 'source')
+                   'hello_2.10+git20150717.1756+15.04_source.changes')
+    assert_include(content, 'hello_2.10+git20150717.1756+15.04.dsc')
+    assert_include(content, 'hello_2.10+git20150717.1756+15.04.tar.gz')
   end
 
   def test_bad_project

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list