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

Rohan Garg rohangarg-guest at moszumanska.debian.org
Wed Feb 4 15:52:32 UTC 2015


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

The following commit has been merged in the master branch:
commit 98b19ee52daf79ef400f65ee7d2a7583147981ec
Author: Rohan Garg <rohan at kde.org>
Date:   Wed Feb 4 16:52:09 2015 +0100

    Re design to not use overlayfs and build in a temp dir
---
 dci/source.rb | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/dci/source.rb b/dci/source.rb
index 7d6cefb..aad71dc 100644
--- a/dci/source.rb
+++ b/dci/source.rb
@@ -89,8 +89,8 @@ Dir.chdir(ARGV[1]) do
     # create orig tar
     tar = "#{source_name}_#{tar_version}.orig.tar"
     File.delete(tar) if File.exists? tar
-    raise 'Failed to create a tarball' unless system("tar -cf #{tar} source")
-    raise 'Failed to compress the tarball' unless system("xz -6 #{tar}")
+    fail 'Failed to create a tarball' unless system("tar -cf #{tar} source")
+    fail 'Failed to compress the tarball' unless system("xz -6 #{tar}")
 
     system("cp -aR packaging/debian source/")
 
@@ -114,28 +114,33 @@ Dir.chdir(ARGV[1]) do
             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
+              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') { |file| file.write("#{package_name}: empty-binary-package
") }
+          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')
+          $logger.info("#{package_name} is now empty, trying to add lintian override")
+          File.open(lintian_overrides_path, 'a') { |file| file.write("#{package_name}: empty-binary-package
") }
         end
     end
 
-    # dpkg-buildpackage
-    Dir.chdir('source/') do
-        raise 'Failed to build source package' unless system("dpkg-buildpackage -S -uc -us")
+    Dir.mktmpdir do |dir|
+      FileUtils.cp_r("#{options[:workspace]}/source", dir)
+      FileUtils.cp_r("#{tar}", dir)
+      Dir.chdir("#{dir}/source") do
+        # dpkg-buildpackage
+        fail 'Failed to build source package' unless system('dpkg-buildpackage -S -uc -us')
+      end
+
+      Dir.chdir(dir) do
+        system("dcmd mv #{source_name}*_source.changes /build/")
+        system("dcmd chmod 666 /build/#{source_name}*_source.changes")
+      end
     end
-
-    system("dcmd mv #{source_name}*_source.changes /build/")
-    system("dcmd chmod 666 /build/#{source_name}*_source.changes")
-    system('chmod 2770 /build') unless File.stat('/build').setgid?
 end
 
 $logger.close

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list