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

Harald Sitter apachelogger-guest at moszumanska.debian.org
Wed Oct 28 11:27:49 UTC 2015


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

The following commit has been merged in the master branch:
commit a0c4bdc503a714fd25279ff77229f652649fba5a
Author: Harald Sitter <sitter at kde.org>
Date:   Wed Oct 28 12:27:44 2015 +0100

    refactor upstreamscm into an scm base that is a generic pod
---
 lib/ci/scm.rb          | 27 +++++++++++++++++++++++++++
 lib/ci/upstream_scm.rb | 14 +++-----------
 2 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/lib/ci/scm.rb b/lib/ci/scm.rb
new file mode 100644
index 0000000..303d639
--- /dev/null
+++ b/lib/ci/scm.rb
@@ -0,0 +1,27 @@
+module CI
+  # SCM Base Class
+  class SCM
+    # @return [String] a type identifier (e.g. 'git', 'svn')
+    attr_reader :type
+    # @return [String] valid git URL to the SCM
+    attr_reader :url
+    # @return [String] branch of the SCM to use (if applicable)
+    attr_reader :branch
+
+    # Constructs an upstream SCM description from a packaging SCM description.
+    #
+    # Upstream SCM settings default to sane KDE settings and can be overridden
+    # via data/upstraem-scm-map.yml. The override file supports pattern matching
+    # according to File.fnmatch and ERB templating using a {BindingContext}.
+    #
+    # @param type [String] type of the SCM (git or svn)
+    # @param url [String] URL of the SCM repo
+    # @param branch [String] Branch of the SCM (if applicable)
+    #   containing debian/ (this is only used for repo-specific overrides)
+    def initialize(type, url, branch = nil)
+      @type = type
+      @url = url
+      @branch = branch
+    end
+  end
+end
diff --git a/lib/ci/upstream_scm.rb b/lib/ci/upstream_scm.rb
index b52f489..be93e0b 100644
--- a/lib/ci/upstream_scm.rb
+++ b/lib/ci/upstream_scm.rb
@@ -3,11 +3,12 @@ require 'json'
 require 'yaml'
 
 require_relative 'pattern'
+require_relative 'scm'
 
 module CI
   # Construct an upstream scm instance and fold in overrides set via
   # meta/upstream_scm.json.
-  class UpstreamSCM
+  class UpstreamSCM < SCM
     # Binding context for SCM overrides.
     # SCM overrides can use ERB syntax to access properties of the context.
     # Overrides can not access the UpstreamSCM directly!
@@ -30,13 +31,6 @@ module CI
       end
     end
 
-    # @return [String] a type identifier (e.g. 'git', 'svn')
-    attr_reader :type
-    # @return [String] valid git URL to the SCM
-    attr_reader :url
-    # @return [String] git branch of the SCM to use
-    attr_reader :branch
-
     # Constructs an upstream SCM description from a packaging SCM description.
     #
     # Upstream SCM settings default to sane KDE settings and can be overridden
@@ -53,9 +47,7 @@ module CI
       @name = File.basename(packaging_repo)
       @directory = working_directory
 
-      @type = 'git'
-      @url = "git://anongit.kde.org/#{@name.chomp('-qt4')}"
-      @branch = 'master'
+      super('git', "git://anongit.kde.org/#{@name.chomp('-qt4')}", 'master')
 
       global_override!
       repo_override!

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list