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

Harald Sitter apachelogger-guest at moszumanska.debian.org
Sat Jun 20 20:21:42 UTC 2015


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

The following commit has been merged in the master branch:
commit 2908c31886084e224446117edb78c45834e54eb6
Author: Harald Sitter <sitter at kde.org>
Date:   Sat Jun 20 13:20:19 2015 -0700

    let apt module do key management
---
 lib/apt.rb       |  7 +++++++
 test/test_apt.rb | 19 +++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/lib/apt.rb b/lib/apt.rb
index 990dfa5..9615746 100644
--- a/lib/apt.rb
+++ b/lib/apt.rb
@@ -50,6 +50,13 @@ module Apt
     end
   end
 
+  # Apt key management using apt-key binary
+  class Key
+    def self.method_missing(name, *caller_args)
+      system('apt-key', name.to_s.gsub('_', '-'), *caller_args)
+    end
+  end
+
   def self.method_missing(name, *caller_args)
     Abstrapt.run('apt-get', name.to_s.gsub('_', '-'), *caller_args)
   end
diff --git a/test/test_apt.rb b/test/test_apt.rb
index 5e90b27..d08bdf1 100644
--- a/test/test_apt.rb
+++ b/test/test_apt.rb
@@ -66,4 +66,23 @@ class AptTest < TestCase
       Apt.install(%w(abc def))
     end
   end
+
+  def assert_add_popen
+    class << Open3
+      alias_method popen3__, popen3
+      def popen3(*args)
+        yield
+      end
+    end
+  ensure
+    class << Open3
+      alias_method popen3, popen3__
+    end
+  end
+
+  def test_apt_key_add
+    assert_system(%w(apt-key add abc)) do
+      Apt::Key.add('abc')
+    end
+  end
 end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list