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

Harald Sitter apachelogger-guest at moszumanska.debian.org
Sat May 2 17:49:35 UTC 2015


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

The following commit has been merged in the master branch:
commit 3fd9d1ab53214ebfdaa16bcc855855030a542b13
Author: Harald Sitter <sitter at kde.org>
Date:   Sat May 2 19:47:54 2015 +0200

    make sure dist-upgrade can be run as dist_upgrade
---
 lib/apt.rb       | 9 +++++++--
 test/test_apt.rb | 6 ++++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/lib/apt.rb b/lib/apt.rb
index adc1c84..816cbee 100644
--- a/lib/apt.rb
+++ b/lib/apt.rb
@@ -6,6 +6,11 @@ require 'logger'
 # method call on to apt.
 # So calling Apt.install will call 'apt install'. Also convenient default
 # arguments will be injected into the call to give debugging and so forth.
+#
+# Commands that contain a hyphen are spelt with an underscore due to ruby
+# langauge restrictions. All underscores are automatically replaced with hyphens
+# upon method handling. To bypass this the Abstrapt.run method needs to be used
+# directly.
 module Apt
   # Represents a repository
   class Repository
@@ -30,14 +35,14 @@ module Apt
   end
 
   def self.method_missing(name, *caller_args)
-    Abstrapt.run('apt-get', name.to_s, *caller_args)
+    Abstrapt.run('apt-get', name.to_s.gsub('_', '-'), *caller_args)
   end
 
   # More cow powers!
   # Calls apt-get instead of apt. Otherwise the same as {Apt}
   module Get
     def self.method_missing(name, *caller_args)
-      Abstrapt.run('apt-get', name.to_s, *caller_args)
+      Abstrapt.run('apt-get', name.to_s.gsub('_', '-'), *caller_args)
     end
   end
 
diff --git a/test/test_apt.rb b/test/test_apt.rb
index 137bbdb..33a2d69 100644
--- a/test/test_apt.rb
+++ b/test/test_apt.rb
@@ -44,4 +44,10 @@ class AptTest < TestCase
       Apt.install('abc', args: '--purge')
     end
   end
+
+  def test_underscore
+    assert_system_default(%w(dist-upgrade)) do
+      Apt.dist_upgrade
+    end
+  end
 end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list