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

Harald Sitter apachelogger-guest at moszumanska.debian.org
Thu Mar 5 13:16:29 UTC 2015


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

The following commit has been merged in the master branch:
commit f292d9488f11dccfd62a596f3b4e54f659b5cbf2
Author: Harald Sitter <sitter at kde.org>
Date:   Thu Mar 5 14:15:28 2015 +0100

    add a qml module to help with dep resolution
    
    this currently has no test backing because it's a bit tricky
---
 lib/qml.rb | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/lib/qml.rb b/lib/qml.rb
new file mode 100644
index 0000000..6057bed
--- /dev/null
+++ b/lib/qml.rb
@@ -0,0 +1,68 @@
+
+# FIXME: TEST
+# FIXME: TEST
+# FIXME: TEST
+# FIXME: TEST
+# FIXME: TEST
+# FIXME: TEST
+# FIXME: TEST
+# FIXME: TEST
+# FIXME: TEST
+# FIXME: TEST
+# FIXME: TEST
+# FIXME: TEST
+
+# Management construct for QML related bits.
+module QML
+  BUILTINS = %w(QtQuick)
+  SEARCH_PATHS = ["/usr/lib/#{DPKG::HOST_MULTIARCH}/qt5/qml"]
+
+  # Describes a QML module.
+  class Module
+    IMPORT_SEPERATOR = '.'
+
+    attr_reader :identifier
+    attr_reader :version
+    attr_reader :qualifier
+
+    def self.parse(line)
+      new.send(:parse, line)
+    end
+
+    def builtin?
+      BUILTINS.include?(identifier)
+    end
+
+    def import_paths
+      @import_paths if defined?(@import_paths)
+      @import_paths = []
+      base_path = @identifier.gsub(IMPORT_SEPERATOR, File::SEPARATOR)
+      @import_paths << base_path
+      version_parts = @version.split('.')
+      version_parts.each_index do |i|
+        @import_paths << "#{base_path}.#{version_parts[0..i].join('.')}"
+      end
+      @import_paths
+    end
+
+    def to_s
+      "#{@identifier}[#{@version}]"
+    end
+
+    private
+
+    def parse(line)
+      minsize = 3 # import + name + version
+      return nil unless line && !line.empty?
+      parts = line.split(/\s/)
+      return nil unless parts.size >= minsize
+      parts.delete_if { |str| str.nil? || str.empty? }
+      return nil unless parts.size >= minsize && parts[0] == 'import'
+      @identifier = parts[1]
+      @version = parts[2]
+      # FIXME: what if part 3 is not as?
+      @qualifier = parts[4] if parts.size == 5
+      self
+    end
+  end
+end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list