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

Harald Sitter apachelogger-guest at moszumanska.debian.org
Thu Apr 2 11:41:20 UTC 2015


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

The following commit has been merged in the master branch:
commit dd3bee92683f49dfda976a20eb3d389c93cb42d0
Author: Harald Sitter <sitter at kde.org>
Date:   Thu Apr 2 13:39:56 2015 +0200

    prevent directory imports as parsing valid in the QML module
    
    directory imports look like:
      import "foo" as Bar
    the quote is the identifing property of a directory import. we can savely
    ignore them (for now anyway) as we have no way of knowing what the pwd
    at the time is and thus cannot resolve these. Also, foreign modules should
    not be imported through directory pathing anyway
---
 lib/qml.rb              | 1 +
 test/test_qml_module.rb | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/lib/qml.rb b/lib/qml.rb
index c6e041d..0637a7a 100644
--- a/lib/qml.rb
+++ b/lib/qml.rb
@@ -53,6 +53,7 @@ module QML
       return nil unless parts.size >= minsize
       parts.delete_if { |str| str.nil? || str.empty? }
       return nil unless parts.size >= minsize && parts[0] == 'import'
+      return nil if parts[1].start_with?('"') # Directory import.
       @identifier = parts[1]
       @version = parts[2]
       # FIXME: what if part 3 is not as?
diff --git a/test/test_qml_module.rb b/test/test_qml_module.rb
index 8429e79..77aee9c 100644
--- a/test/test_qml_module.rb
+++ b/test/test_qml_module.rb
@@ -46,4 +46,8 @@ class QMLTest < TestCase
     assert_equal(ref, QML::Module.new(id))
     assert_not_equal(ref, QML::Module.new('yolo'))
   end
+
+  def test_directory
+    assert_nil(QML::Module.parse('import "private" as Private'))
+  end
 end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list