[DRE-commits] [ohai] 03/06: refresh patches

Antonio Terceiro terceiro at moszumanska.debian.org
Mon Sep 19 18:07:31 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository ohai.

commit d53d2c66ea39a076aeede98599cbdbb811e0d0e6
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Mon Sep 19 14:17:58 2016 -0300

    refresh patches
---
 debian/changelog                                   |   3 +
 debian/control                                     |   1 +
 .../patches/0001-Drop-dependency-on-wmi-lite.patch | 263 ++-------------------
 ...d-dependency-on-rspec-collection_matchers.patch |  58 -----
 ...ative-references-for-source-code-in-tests.patch |  39 +++
 .../0003-Remove-relative-require-from-tests.patch  |  31 ---
 debian/patches/series                              |   3 +-
 7 files changed, 68 insertions(+), 330 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 3911ad2..13c7cf8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,9 @@
 ohai (8.20.0-1) UNRELEASED; urgency=medium
 
   * New upstream version 8.20.0
+    - refresh patches
+    - drop patch to avoid dependency on rspec-collection_matchers, which has
+      been packaged since.
 
  -- Antonio Terceiro <terceiro at debian.org>  Mon, 19 Sep 2016 13:53:28 -0300
 
diff --git a/debian/control b/debian/control
index a5f0673..cd5fd20 100644
--- a/debian/control
+++ b/debian/control
@@ -21,6 +21,7 @@ Build-Depends: debhelper (>= 9~),
                ruby-mixlib-shellout (>= 2.0),
                ruby-plist,
                ruby-rspec (>= 3),
+               ruby-rspec-collection-matchers,
                ruby-sigar,
                ruby-systemu (>= 2.6.4)
 Standards-Version: 3.9.7
diff --git a/debian/patches/0001-Drop-dependency-on-wmi-lite.patch b/debian/patches/0001-Drop-dependency-on-wmi-lite.patch
index f388229..171e333 100644
--- a/debian/patches/0001-Drop-dependency-on-wmi-lite.patch
+++ b/debian/patches/0001-Drop-dependency-on-wmi-lite.patch
@@ -1,249 +1,34 @@
 From: Antonio Terceiro <terceiro at debian.org>
-Date: Sat, 13 Jun 2015 13:41:36 -0300
+Date: Mon, 19 Sep 2016 14:14:19 -0300
 Subject: Drop dependency on wmi-lite
 
-wmi-lite is a Windows thing, so we definitely do not need it.
+wmi-lite is a Windows thing do it does not make any sense for Debian
 ---
- metadata.yml                     | 14 --------------
- spec/spec_helper.rb              |  1 -
- spec/unit/plugins/kernel_spec.rb |  1 -
- 3 files changed, 16 deletions(-)
+ ohai.gemspec        | 1 -
+ spec/spec_helper.rb | 1 -
+ 2 files changed, 2 deletions(-)
 
---- a/metadata.yml
-+++ b/metadata.yml
-@@ -109,20 +109,6 @@ dependencies:
-       - !ruby/object:Gem::Version
-         version: '0'
- - !ruby/object:Gem::Dependency
--  name: wmi-lite
--  requirement: !ruby/object:Gem::Requirement
--    requirements:
--    - - "~>"
--      - !ruby/object:Gem::Version
--        version: '1.0'
--  type: :runtime
--  prerelease: false
--  version_requirements: !ruby/object:Gem::Requirement
--    requirements:
--    - - "~>"
--      - !ruby/object:Gem::Version
--        version: '1.0'
--- !ruby/object:Gem::Dependency
-   name: ffi
-   requirement: !ruby/object:Gem::Requirement
-     requirements:
+diff --git a/ohai.gemspec b/ohai.gemspec
+index 7177f8c..616cd61 100644
+--- a/ohai.gemspec
++++ b/ohai.gemspec
+@@ -23,7 +23,6 @@ Gem::Specification.new do |s|
+   s.add_dependency "mixlib-shellout", "~> 2.0"
+   s.add_dependency "plist", "~> 3.1"
+   s.add_dependency "ipaddress"
+-  s.add_dependency "wmi-lite", "~> 1.0"
+   s.add_dependency "ffi", "~> 1.9"
+   # Note for ohai developers: If chef-config causes you grief, try:
+   #     bundle install --with development
+diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
+index 8932cdc..c95ba2e 100644
 --- a/spec/spec_helper.rb
 +++ b/spec/spec_helper.rb
-@@ -9,7 +9,6 @@ $:.unshift(File.dirname(__FILE__) + '/..
+@@ -8,7 +8,6 @@ $:.unshift(File.dirname(__FILE__) + "/../lib")
  
- require 'spec/support/platform_helpers'
- require 'spec/support/integration_helper'
--require 'wmi-lite'
- require 'ohai'
+ require "spec/support/platform_helpers"
+ require "spec/support/integration_helper"
+-require "wmi-lite"
+ require "ohai"
  Ohai.config[:log_level] = :error
  
---- a/spec/unit/plugins/kernel_spec.rb
-+++ b/spec/unit/plugins/kernel_spec.rb
-@@ -39,7 +39,6 @@ describe Ohai::System, "plugin kernel" d
- 
-   describe "when running on windows", :windows_only do
-     before do
--      require 'wmi-lite/wmi'
- 
-       @ohai_system = Ohai::System.new
-       @plugin = get_plugin("kernel", @ohai_system)
-@@ -61,10 +60,6 @@ describe Ohai::System, "plugin kernel" d
-       allow(os).to receive(:invoke).with(caption.name).and_return('Microsoft Windows 7 Ultimate')
-       allow(os).to receive(:invoke).with(version.name).and_return('6.1.7601')
- 
--      os_wmi = WmiLite::Wmi::Instance.new(os)
--
--      expect_any_instance_of(WmiLite::Wmi).to receive(:first_of).with('Win32_OperatingSystem').and_return(os_wmi)
--
-       # Mock a Win32_ComputerSystem OLE32 WMI object
-       x64_system_type = 'x64-based PC'
- 
-@@ -73,13 +68,9 @@ describe Ohai::System, "plugin kernel" d
- 
-       allow(cs).to receive(:invoke).with('SystemType').and_return(x64_system_type)
- 
--      cs_wmi = WmiLite::Wmi::Instance.new(cs)
--
--      expect_any_instance_of(WmiLite::Wmi).to receive(:first_of).with('Win32_ComputerSystem').and_return(cs_wmi)
--
-       @plugin.run
-     end
--    it "should set the correct system information" do
-+    xit "should set the correct system information" do
-       expect(@ohai_system.data[:kernel][:name]).to eq("Microsoft Windows 7 Ultimate")
-       expect(@ohai_system.data[:kernel][:release]).to eq("6.1.7601")
-       expect(@ohai_system.data[:kernel][:version]).to eq("6.1.7601 Service Pack 1 Build 7601")
---- a/spec/unit/plugins/packages_spec.rb
-+++ b/spec/unit/plugins/packages_spec.rb
-@@ -113,7 +113,6 @@ describe Ohai::System, 'plugin packages'
-     end
- 
-     context 'on windows', :windows_only do
--      require 'wmi-lite'
- 
-       let(:plugin) do
-         get_plugin('packages').tap do |plugin|
-@@ -178,11 +177,10 @@ describe Ohai::System, 'plugin packages'
- 
-       before(:each) do
-         allow(plugin).to receive(:collect_os).and_return(:windows)
--        expect_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_Product').and_return(win32_product_output)
-         plugin.run
-       end
- 
--      it 'gets package info' do
-+      xit 'gets package info' do
-         expect(plugin[:packages]['Chef Development Kit v0.7.0'][:version]).to eq('0.7.0.1')
-         expect(plugin[:packages]['Chef Development Kit v0.7.0'][:vendor]).to eq("\"Chef Software, Inc. <maintainers at chef.io>\"")
-         expect(plugin[:packages]['Chef Development Kit v0.7.0'][:installdate]).to eq('20150925')
---- a/spec/unit/plugins/windows/memory_spec.rb
-+++ b/spec/unit/plugins/windows/memory_spec.rb
-@@ -18,7 +18,6 @@ require File.expand_path(File.dirname(__
- 
- describe Ohai::System, "Windows memory plugin", :windows_only do
-   before do
--    require "wmi-lite/wmi"
-     @plugin = get_plugin("windows/memory")
-     mock_os = { 
-                 "TotalVisibleMemorySize" => "10485760",
-@@ -26,27 +25,26 @@ describe Ohai::System, "Windows memory p
-                 "SizeStoredInPagingFiles" => "20971520",
-                 "FreeSpaceInPagingFiles" =>  "15728640"
-               }
--    expect_any_instance_of(WmiLite::Wmi).to receive(:first_of).with('Win32_OperatingSystem').and_return(mock_os)
-   end
- 
--  it "should get total memory" do
-+  xit "should get total memory" do
-     @plugin.run
-     expect(@plugin["memory"]["total"]).to eql("10485760kB")
-   end
- 
--  it "should get free memory" do
-+  xit "should get free memory" do
-     @plugin.run
-     expect(@plugin["memory"]["free"]).to eql("5242880kB")
-   end
- 
--  it "should get total swap" do
-+  xit "should get total swap" do
-     @plugin.run
-     expect(@plugin["memory"]["swap"]["total"]).to eql("20971520kB")
-   end
- 
--  it "should get free memory" do
-+  xit "should get free memory" do
-     @plugin.run
-     expect(@plugin["memory"]["swap"]["free"]).to eql("15728640kB")
-   end
- 
--end
-\ No newline at end of file
-+end
---- a/spec/functional/plugins/root_group_spec.rb
-+++ b/spec/functional/plugins/root_group_spec.rb
-@@ -26,7 +26,7 @@ describe Ohai::System, 'root_group plugi
-   describe 'windows platform', :windows_only do
-     let (:wmi) {  wmi = WmiLite::Wmi.new }
- 
--    it 'should return the system\'s administrators (root) group' do
-+    xit 'should return the system\'s administrators (root) group' do
-       # Notethat the Win32_Group WMI provider can be slow if your
-       # system is domain-joined and has hundreds of thousands of
-       # groups in Active Directory -- not a typical test scenario, but
---- a/spec/unit/plugins/windows/cpu_spec.rb
-+++ b/spec/unit/plugins/windows/cpu_spec.rb
-@@ -60,9 +60,6 @@ describe Ohai::System, 'Windows cpu plug
-     @plugin = get_plugin('windows/cpu')
-     allow(@plugin).to receive(:collect_os).and_return(:windows)
- 
--    @double_wmi = double(WmiLite::Wmi)
--    @double_wmi_instance = instance_double(WmiLite::Wmi)
--
-     @processors = [{ 'description' => 'Intel64 Family 6 Model 70 Stepping 1',
-                      'deviceid' => 'CPU0',
-                      'family' => 2,
-@@ -87,28 +84,20 @@ describe Ohai::System, 'Windows cpu plug
-                      'stepping' => 9,
-                      'l2cachesize' => 64 }]
- 
--    allow(WmiLite::Wmi).to receive(:new).and_return(@double_wmi_instance)
--
--    allow(@double_wmi_instance).to receive(:instances_of)
--      .with('Win32_Processor')
--      .and_return(@processors)
--
-     @plugin.run
-   end
- 
--  it 'should set total cpu to 2' do
-+  xit 'should set total cpu to 2' do
-     expect(@plugin[:cpu][:total]).to eq(4)
-   end
- 
--  it 'should set real cpu to 2' do
-+  xit 'should set real cpu to 2' do
-     expect(@plugin[:cpu][:real]).to eq(2)
-   end
- 
--  it 'should set 2 distinct cpus numbered 0 and 1' do
-+  xit 'should set 2 distinct cpus numbered 0 and 1' do
-     expect(@plugin[:cpu]).to have_key('0')
-     expect(@plugin[:cpu]).to have_key('1')
-   end
- 
--  it_behaves_like 'a cpu', 0
--  it_behaves_like 'a cpu', 1
- end
---- a/spec/unit/plugins/windows/virtualization_spec.rb
-+++ b/spec/unit/plugins/windows/virtualization_spec.rb
-@@ -28,7 +28,7 @@ describe Ohai::System, 'Windows virtuali
-   end
- 
-   context 'when running on vmware' do
--    it 'system is vmware' do
-+    xit 'system is vmware' do
-       allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [4, 7, 8, 9, 10, 11, 12, 14, 15, 16, 19, 26, 27, 28, 29, 30, 32, 39, 40, 41, 42, 50, 57, 58],
-                                                                                                      'biosversion' => ['INTEL  - 6040000', 'PhoenixBIOS 4.0 Release 6.0     '],
-                                                                                                      'buildnumber' => nil,
-@@ -64,7 +64,7 @@ describe Ohai::System, 'Windows virtuali
-   end
- 
-   context 'when running on parallels desktop' do
--    it 'system is parallels' do
-+    xit 'system is parallels' do
-       allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [4, 7, 9, 10, 15, 24, 25, 27, 28, 29, 30, 32, 42, 44, 48, 49, 51, 64, 65, 67],
-                                                                                                      'biosversion' => ['PRLS   - 1'],
-                                                                                                      'buildnumber' => nil,
-@@ -101,7 +101,7 @@ describe Ohai::System, 'Windows virtuali
-   end
- 
-   context 'when running on kvm' do
--    it 'system is kvm' do
-+    xit 'system is kvm' do
-       allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [3, 42, 48, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79],
-                                                                                                      'biosversion' => ['BOCHS  - 1'],
-                                                                                                      'buildnumber' => nil,
-@@ -137,7 +137,7 @@ describe Ohai::System, 'Windows virtuali
-   end
- 
-   context 'when running on virtualbox' do
--    it 'system is vbox' do
-+    xit 'system is vbox' do
-       allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [4, 7, 15, 16, 27, 30, 32],
-                                                                                                      'biosversion' => ['VBOX   - 1'],
-                                                                                                      'buildnumber' => nil,
-@@ -174,7 +174,7 @@ describe Ohai::System, 'Windows virtuali
-   end
- 
-   context 'when running on a hardware system' do
--    it 'does not set virtualization attributes' do
-+    xit 'does not set virtualization attributes' do
-       allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [7, 11, 12, 15, 16, 17, 19, 23, 24, 25, 26, 27, 28, 29, 32, 33, 40, 42, 43],
-                                                                                                      'biosversion' => ['DELL   - 1072009', 'A10', 'American Megatrends - 4028D'],
-                                                                                                      'buildnumber' => nil,
diff --git a/debian/patches/0002-Avoid-dependency-on-rspec-collection_matchers.patch b/debian/patches/0002-Avoid-dependency-on-rspec-collection_matchers.patch
deleted file mode 100644
index 11ff06d..0000000
--- a/debian/patches/0002-Avoid-dependency-on-rspec-collection_matchers.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From: Antonio Terceiro <terceiro at debian.org>
-Date: Sat, 13 Jun 2015 15:29:00 -0300
-Subject: Avoid dependency on rspec-collection_matchers
-
-That extra dependency is used only for 3 tests. If
-rspec-collection_matchers ever gets packaged, this patch can be dropped.
----
- spec/spec_helper.rb                       | 2 +-
- spec/unit/plugins/solaris2/kernel_spec.rb | 2 +-
- spec/unit/provides_map_spec.rb            | 4 ++--
- 3 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
-index c829eff..1abcdf0 100644
---- a/spec/spec_helper.rb
-+++ b/spec/spec_helper.rb
-@@ -1,5 +1,5 @@
- require 'rspec'
--require 'rspec/collection_matchers'
-+#require 'rspec/collection_matchers'
- 
- # require 'pry-debugger'
- # require 'pry-stack_explorer'
-diff --git a/spec/unit/plugins/solaris2/kernel_spec.rb b/spec/unit/plugins/solaris2/kernel_spec.rb
-index 729b20a..4bab5b8 100644
---- a/spec/unit/plugins/solaris2/kernel_spec.rb
-+++ b/spec/unit/plugins/solaris2/kernel_spec.rb
-@@ -146,7 +146,7 @@ describe Ohai::System, "Solaris2.X kernel plugin" do
-   it "gives excruciating detail about kernel modules" do
-     @plugin.run
- 
--    expect(@plugin[:kernel][:modules]).to have(107).modules
-+    expect(@plugin[:kernel][:modules].size).to eq(107)
- 
-     # Teh daterz
-     # Id Loadaddr   Size Info Rev Module Name
-diff --git a/spec/unit/provides_map_spec.rb b/spec/unit/provides_map_spec.rb
-index 9fa9a8f..8c4c98e 100644
---- a/spec/unit/provides_map_spec.rb
-+++ b/spec/unit/provides_map_spec.rb
-@@ -125,7 +125,7 @@ describe Ohai::ProvidesMap do
- 
-     it "should find providers for subattributes if any exists when the attribute doesn't have a provider" do
-       providers = provides_map.deep_find_providers_for(["cat"])
--      expect(providers).to have(3).plugins
-+      expect(providers.size).to eq(3)
-       expect(providers).to include(plugin_1)
-       expect(providers).to include(plugin_2)
-       expect(providers).to include(plugin_3)
-@@ -182,7 +182,7 @@ describe Ohai::ProvidesMap do
- 
-     it "should find all the plugins providing attributes" do
-       all_plugins = provides_map.all_plugins
--      expect(all_plugins).to have(4).plugins
-+      expect(all_plugins.size).to eq(4)
-       expect(all_plugins).to include(plugin_1)
-       expect(all_plugins).to include(plugin_2)
-       expect(all_plugins).to include(plugin_3)
diff --git a/debian/patches/0002-Remove-relative-references-for-source-code-in-tests.patch b/debian/patches/0002-Remove-relative-references-for-source-code-in-tests.patch
new file mode 100644
index 0000000..0a80243
--- /dev/null
+++ b/debian/patches/0002-Remove-relative-references-for-source-code-in-tests.patch
@@ -0,0 +1,39 @@
+From: Lucas Kanashiro <kanashiro.duarte at gmail.com>
+Date: Mon, 19 Sep 2016 14:17:24 -0300
+Subject: Remove relative references for source code in tests
+
+---
+ spec/spec_helper.rb                  | 6 +++++-
+ spec/unit/plugins/root_group_spec.rb | 2 +-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
+index c95ba2e..807f0da 100644
+--- a/spec/spec_helper.rb
++++ b/spec/spec_helper.rb
+@@ -11,7 +11,11 @@ require "spec/support/integration_helper"
+ require "ohai"
+ Ohai.config[:log_level] = :error
+ 
+-PLUGIN_PATH = File.expand_path("../../lib/ohai/plugins", __FILE__)
++if ENV['ADTTMP']
++  PLUGIN_PATH = '/usr/lib/ruby/vendor_ruby/ohai/plugins/'
++else
++  PLUGIN_PATH = File.expand_path("../../lib/ohai/plugins", __FILE__)
++end
+ SPEC_PLUGIN_PATH = File.expand_path("../data/plugins", __FILE__)
+ 
+ RSpec.configure do |config|
+diff --git a/spec/unit/plugins/root_group_spec.rb b/spec/unit/plugins/root_group_spec.rb
+index 67ee4c1..2e8b035 100644
+--- a/spec/unit/plugins/root_group_spec.rb
++++ b/spec/unit/plugins/root_group_spec.rb
+@@ -17,7 +17,7 @@
+ #
+ 
+ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+-require File.expand_path(File.dirname(__FILE__) + "/../../../lib/ohai/util/win32/group_helper.rb")
++require 'ohai/util/win32/group_helper.rb'
+ 
+ describe Ohai::System, "root_group" do
+   before(:each) do
diff --git a/debian/patches/0003-Remove-relative-require-from-tests.patch b/debian/patches/0003-Remove-relative-require-from-tests.patch
deleted file mode 100644
index e54dd5d..0000000
--- a/debian/patches/0003-Remove-relative-require-from-tests.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Description: Remove relative references for source code in tests
-Author: Lucas Kanashiro <kanashiro.duarte at gmail.com>
-Last-Updated: 2016-03-04
-
---- a/spec/unit/plugins/root_group_spec.rb
-+++ b/spec/unit/plugins/root_group_spec.rb
-@@ -17,7 +17,7 @@
- #
- 
- require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
--require File.expand_path(File.dirname(__FILE__) + '/../../../lib/ohai/util/win32/group_helper.rb')
-+require 'ohai/util/win32/group_helper.rb'
- 
- describe Ohai::System, 'root_group' do
-   before(:each) do
---- a/spec/spec_helper.rb
-+++ b/spec/spec_helper.rb
-@@ -12,7 +12,12 @@ require 'spec/support/integration_helper
- require 'ohai'
- Ohai.config[:log_level] = :error
- 
--PLUGIN_PATH = File.expand_path("../../lib/ohai/plugins", __FILE__)
-+if ENV['ADTTMP']
-+  PLUGIN_PATH = '/usr/lib/ruby/vendor_ruby/ohai/plugins/'
-+else
-+  PLUGIN_PATH = File.expand_path("../../lib/ohai/plugins", __FILE__)
-+end
-+
- SPEC_PLUGIN_PATH = File.expand_path("../data/plugins", __FILE__)
- 
- RSpec.configure do |config|
diff --git a/debian/patches/series b/debian/patches/series
index d6def11..7fb4840 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,2 @@
 0001-Drop-dependency-on-wmi-lite.patch
-0002-Avoid-dependency-on-rspec-collection_matchers.patch
-0003-Remove-relative-require-from-tests.patch
+0002-Remove-relative-references-for-source-code-in-tests.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ohai.git



More information about the Pkg-ruby-extras-commits mailing list