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

Rohan Garg rohangarg-guest at moszumanska.debian.org
Tue Nov 3 21:32:49 UTC 2015


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

The following commit has been merged in the master branch:
commit c9f523465c8c057a6e214f0d8a80a29dc5d9916c
Author: Rohan Garg <rohan at garg.io>
Date:   Tue Nov 3 22:32:44 2015 +0100

    Glob out dsc from build dir instead of manually constructing it,
    adjust tests
---
 lib/ci/build_source.rb       | 15 ++++++++-------
 test/test_ci_build_source.rb | 13 +++++++++----
 2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/lib/ci/build_source.rb b/lib/ci/build_source.rb
index 1929432..eb3494b 100644
--- a/lib/ci/build_source.rb
+++ b/lib/ci/build_source.rb
@@ -90,14 +90,15 @@ module CI
       Dir.chdir("#{BUILD_DIR}/source/") do
         system('update-maintainer')
         # Force -sa as reprepreo refuses to accept uploads without orig.
-        if system('dpkg-buildpackage', '-us', '-uc', '-S', '-d', '-sa')
-          dsc = Dir.glob("*.dsc")
-          fail "More than one dsc!" if dsc.size > 1
-
-          @source.dsc = dsc[0]
-          return
+        unless system('dpkg-buildpackage', '-us', '-uc', '-S', '-d', '-sa')
+          fail 'Could not run dpkg-buildpackage!'
         end
-        fail 'Could not run dpkg-buildpackage!'
+      end
+
+      Dir.chdir(BUILD_DIR) do
+        dsc = Dir.glob("*.dsc")
+        fail "Exactly one dsc not found" if dsc.size != 1
+        @source.dsc = dsc[0]
       end
     end
 
diff --git a/test/test_ci_build_source.rb b/test/test_ci_build_source.rb
index 484abbc..6365d31 100644
--- a/test/test_ci_build_source.rb
+++ b/test/test_ci_build_source.rb
@@ -67,6 +67,7 @@ class VCSBuilderTest < TestCase
     assert_equal(:quilt, r.type)
     assert_equal('hello', r.name)
     assert_equal("2.10+git20150717.1756+#{OS::VERSION_ID}-0", r.version)
+    assert_equal("hello_2.10+git20150717.1756+15.04-0.dsc", r.dsc)
     assert_not_nil(r.build_version)
   end
 
@@ -76,6 +77,7 @@ class VCSBuilderTest < TestCase
     assert_equal(:native, r.type)
     assert_equal('hello', r.name)
     assert_equal("2.10+git20150717.1756+#{OS::VERSION_ID}", r.version)
+    assert_equal("hello_2.10+git20150717.1756+15.04.dsc", r.dsc)
     assert_not_nil(r.build_version)
   end
 
@@ -85,8 +87,10 @@ class VCSBuilderTest < TestCase
     assert_equal(:native, r.type)
     assert_equal('hello', r.name)
     assert_equal("2.10+git20150717.1756+#{OS::VERSION_ID}", r.version)
+    assert_not_nil(r.dsc)
+
     Dir.chdir('build/') do
-      system("dpkg-source -x #{r.name}_#{r.version}.dsc")
+      assert(system("dpkg-source -x #{r.dsc}"))
       assert(File.exist?("#{r.name}-#{r.version}/debian/#{r.name}.lintian-overrides"))
     end
   end
@@ -124,9 +128,10 @@ class VCSBuilderTest < TestCase
   def assert_changelogid(osid, author)
     send("fake_os_#{osid}".to_sym)
     source = CI::VcsSourceBuilder.new(release: @release).run
+    assert_not_nil(source.dsc)
     Dir.chdir('build') do
       # FIXME: composition should be in source really
-      dsc = "#{source.name}_#{source.version}.dsc"
+      dsc = source.dsc
       changelog = "#{source.name}-#{source.version}/debian/changelog"
       assert(system('dpkg-source', '-x', dsc))
       line = File.read(changelog).split($/).fetch(4)
@@ -146,9 +151,9 @@ class VCSBuilderTest < TestCase
 
   def test_locale_kdelibs4support
     source = CI::VcsSourceBuilder.new(release: @release).run
+    assert_not_nil(source.dsc)
     Dir.chdir('build') do
-      # FIXME: composition should be in source really
-      dsc = "#{source.name}_#{source.version}.dsc"
+      dsc = source.dsc
       install = "#{source.name}-#{source.build_version.tar}/debian/" \
                 'libkf5kdelibs4support-data.install'
       assert(system('dpkg-source', '-x', dsc))

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list