[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=0afe050

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

    add a dpkg module, doesn't do much yet
---
 lib/dpkg.rb | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/lib/dpkg.rb b/lib/dpkg.rb
new file mode 100644
index 0000000..485d33f
--- /dev/null
+++ b/lib/dpkg.rb
@@ -0,0 +1,31 @@
+# Wrapper around dpkg commandline tool.
+module DPKG
+  private
+
+  def self.run(cmd, args)
+    args = [*args]
+    output = `#{cmd} #{args.join(' ')}`
+    return [] if $? != 0
+    output.strip.split($RS).compact
+  end
+
+  def self.dpkg(args)
+    run('dpkg', args)
+  end
+
+  def self.architecture(var)
+    run('dpkg-architecture', [] << '--query' << var)[0]
+  end
+
+  public
+
+  def self.const_missing(name)
+    architecture("DEB_#{name}")
+  end
+
+  module_function
+
+  def list(package)
+    DPKG.dpkg([] << '-L' << package)
+  end
+end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list