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

Harald Sitter apachelogger-guest at moszumanska.debian.org
Tue Aug 25 13:03:09 UTC 2015


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

The following commit has been merged in the master branch:
commit ed2e64add031a3ac19c645c9a02546e46dc54c28
Author: Harald Sitter <sitter at kde.org>
Date:   Tue Aug 25 14:56:30 2015 +0200

    allow parameterization of the patch series filename
    
    this is to allow an override file with the same format
---
 lib/debian/patchseries.rb                                         | 5 +++--
 .../patches/series => test_read_from_name/debian/patches/yolo}    | 0
 test/test_debian_patchseries.rb                                   | 8 ++++++++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/debian/patchseries.rb b/lib/debian/patchseries.rb
index a42fafd..ef56f53 100644
--- a/lib/debian/patchseries.rb
+++ b/lib/debian/patchseries.rb
@@ -3,8 +3,9 @@ module Debian
   class PatchSeries
     attr_reader :patches
 
-    def initialize(package_path)
+    def initialize(package_path, filename = 'series')
       @package_path = package_path
+      @filename = filename
       fail 'not a package path' unless Dir.exist?("#{package_path}/debian")
       @patches = []
       parse
@@ -13,7 +14,7 @@ module Debian
     private
 
     def parse
-      path = "#{@package_path}/debian/patches/series"
+      path = "#{@package_path}/debian/patches/#{@filename}"
       return unless File.exist?(path)
       data = File.read(path)
       data.split($/).each do |line|
diff --git a/test/data/test_debian_patchseries/test_read/debian/patches/series b/test/data/test_debian_patchseries/test_read_from_name/debian/patches/yolo
similarity index 100%
copy from test/data/test_debian_patchseries/test_read/debian/patches/series
copy to test/data/test_debian_patchseries/test_read_from_name/debian/patches/yolo
diff --git a/test/test_debian_patchseries.rb b/test/test_debian_patchseries.rb
index 46880f9..5cf6aee 100644
--- a/test/test_debian_patchseries.rb
+++ b/test/test_debian_patchseries.rb
@@ -10,4 +10,12 @@ class DebianPatchSeriesTest < TestCase
       assert_include(s.patches, f, "patch #{f} should be in series")
     end
   end
+
+  def test_read_from_name
+    s = Debian::PatchSeries.new(data, 'yolo')
+    assert_equal(4, s.patches.size)
+    %w(a.patch b.patch above-is-garbage.patch level.patch).each do |f|
+      assert_include(s.patches, f, "patch #{f} should be in series")
+    end
+  end
 end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list