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

Harald Sitter apachelogger-guest at moszumanska.debian.org
Fri Oct 16 08:40:07 UTC 2015


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

The following commit has been merged in the master branch:
commit 6c14745ef1e1920bd7d29dcc8282443aea93c01f
Author: Harald Sitter <sitter at kde.org>
Date:   Fri Oct 16 09:32:54 2015 +0200

    make watchtarfetcher return a Tarball instance
---
 lib/ci/tar_fetcher.rb       | 22 +++++++++++++++-------
 test/test_ci_tar_fetcher.rb |  6 +++++-
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/lib/ci/tar_fetcher.rb b/lib/ci/tar_fetcher.rb
index 48a4091..1d4187c 100644
--- a/lib/ci/tar_fetcher.rb
+++ b/lib/ci/tar_fetcher.rb
@@ -1,4 +1,5 @@
 require 'open-uri'
+require 'tmpdir'
 
 require_relative 'tarball'
 
@@ -16,14 +17,21 @@ module CI
     end
 
     def fetch(destdir)
-      Dir.chdir(@dir) do
-        system('uscan',
-               '--report-status',
-               '--force-download',
-               '--download-current-version',
-               "--destdir=#{destdir}")
+      Dir.mktmpdir do |tmpdir|
+        Dir.chdir(@dir) do
+          system('uscan',
+                 '--report-status',
+                 '--force-download',
+                 '--download-current-version',
+                 "--destdir=#{tmpdir}")
+        end
+        tar = Dir.glob("#{tmpdir}/*.orig.tar*")
+        return nil unless tar.size == 1
+        tar = tar[0]
+        FileUtils.cp(tar, destdir)
+        return Tarball.new("#{destdir}/#{File.basename(tar)}")
       end
-      # FIXME: return tarball
+      nil
     end
   end
 
diff --git a/test/test_ci_tar_fetcher.rb b/test/test_ci_tar_fetcher.rb
index ede8559..80a787a 100644
--- a/test/test_ci_tar_fetcher.rb
+++ b/test/test_ci_tar_fetcher.rb
@@ -47,8 +47,12 @@ module CI
       end
 
       f = WatchTarFetcher.new(data('debian/watch'))
-      f.fetch(Dir.pwd)
+      t = f.fetch(Dir.pwd)
+      # assert_path_exist('dragon_15.08.1.orig.tar.xz')
+      assert_equal(Tarball, t.class)
       assert_path_exist('dragon_15.08.1.orig.tar.xz')
+      assert(t.orig?) # uscan mangles by default, we expect it like that
+      assert_equal('dragon_15.08.1.orig.tar.xz', File.basename(t.origify.path))
     end
   end
 end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list