[SCM] ci-tooling packaging branch, master, updated. 50b85d350d14e75d5fe4208f4d027ac58e749ef1
Harald Sitter
apachelogger-guest at moszumanska.debian.org
Mon Oct 5 12:24:55 UTC 2015
Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=50b85d3
The following commit has been merged in the master branch:
commit 50b85d350d14e75d5fe4208f4d027ac58e749ef1
Author: Harald Sitter <sitter at kde.org>
Date: Mon Oct 5 14:24:52 2015 +0200
rename builder class to not clash with the builder gem
---
kci/builder.rb | 99 ++----------------------------------------------
test/test_kci_builder.rb | 12 +++---
2 files changed, 9 insertions(+), 102 deletions(-)
diff --git a/kci/builder.rb b/kci/builder.rb
index 992bc5e..9b4b519 100755
--- a/kci/builder.rb
+++ b/kci/builder.rb
@@ -47,7 +47,7 @@ Project = Struct.new(:series, :stability, :name)
$stdout = $stderr
-class Builder
+class KCIBuilder
class CoverageError < Exception; end
def self.testing=(testing)
@@ -89,100 +89,7 @@ class Builder
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
+ C
# Mangle dsc to not do ARM builds unless explicitly enabled.
# With hundreds of distinct sources on CI, building all of them on three
@@ -534,5 +441,5 @@ if __FILE__ == $PROGRAM_NAME
`apt-get install -y xz-utils dpkg-dev ruby dput debhelper pkg-kde-tools devscripts python-launchpadlib ubuntu-dev-tools git`
- Builder.run
+ KCIBuilder.run
end
diff --git a/test/test_kci_builder.rb b/test/test_kci_builder.rb
index 6e200d2..9bba44e 100644
--- a/test/test_kci_builder.rb
+++ b/test/test_kci_builder.rb
@@ -2,12 +2,12 @@ require_relative 'lib/testcase'
require_relative '../kci/builder.rb'
-class KCIBuilderTest < TestCase
+class KCIBuilder < TestCase
REF_TIME = '20150717.1756'
def setup
ARGV.clear
- Builder.testing = true
+ KCIBuilder.testing = true
begin
FileUtils.cp_r(Dir.glob("#{data}/*"), Dir.pwd, verbose: true)
rescue RuntimeError
@@ -17,7 +17,7 @@ class KCIBuilderTest < TestCase
def teardown
unalias_time
- Builder.testing = false
+ KCIBuilder.testing = false
end
def alias_time
@@ -37,8 +37,8 @@ class KCIBuilderTest < TestCase
ARGV << 'wily_unstable_extra-cmake-modules'
ARGV << Dir.pwd
# Expect raise as not the entire thing is covered.
- assert_raise Builder::CoverageError do
- Builder.run
+ assert_raise KCIBuilder::CoverageError do
+ KCIBuilder.run
end
# Verify source
assert(Dir.exist?('build'))
@@ -54,7 +54,7 @@ class KCIBuilderTest < TestCase
def test_bad_project
ARGV << 'wily_extra-cmake-modules' # only two parts
assert_raise SystemExit do
- Builder.run
+ KCIBuilder.run
end
end
end
--
ci-tooling packaging
More information about the pkg-kde-commits
mailing list