diff options
author | fhajny <fhajny@pkgsrc.org> | 2012-08-02 08:36:40 +0000 |
---|---|---|
committer | fhajny <fhajny@pkgsrc.org> | 2012-08-02 08:36:40 +0000 |
commit | 98fff0ad85ce5c8ec0f7aeb443c154774f740571 (patch) | |
tree | 511d018b5b48fa03d8eaf9e1eba5a74a076319d0 | |
parent | 21477b67f3d857409c40c63f43fdc7cde76529ab (diff) | |
download | pkgsrc-98fff0ad85ce5c8ec0f7aeb443c154774f740571.tar.gz |
Add support for binary data in /proc/self on Illumos, see
https://github.com/puppetlabs/facter/pull/249.
Bump PKGREVISION.
-rw-r--r-- | sysutils/ruby-facter/Makefile | 3 | ||||
-rw-r--r-- | sysutils/ruby-facter/distinfo | 4 | ||||
-rw-r--r-- | sysutils/ruby-facter/patches/patch-lib_facter_util_virtual.rb | 14 | ||||
-rw-r--r-- | sysutils/ruby-facter/patches/patch-spec_unit_util__virtual_spec.rb | 45 |
4 files changed, 64 insertions, 2 deletions
diff --git a/sysutils/ruby-facter/Makefile b/sysutils/ruby-facter/Makefile index c78d745fe10..025ca1ad910 100644 --- a/sysutils/ruby-facter/Makefile +++ b/sysutils/ruby-facter/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.15 2012/06/14 15:16:07 taca Exp $ +# $NetBSD: Makefile,v 1.16 2012/08/02 08:36:40 fhajny Exp $ DISTNAME= facter-1.6.10 PKGNAME= ${RUBY_PKGPREFIX}-${DISTNAME} +PKGREVISION= 1 CATEGORIES= sysutils MAINTAINER= tonnerre@NetBSD.org diff --git a/sysutils/ruby-facter/distinfo b/sysutils/ruby-facter/distinfo index 04b1648da6d..dd5c7c2ab3e 100644 --- a/sysutils/ruby-facter/distinfo +++ b/sysutils/ruby-facter/distinfo @@ -1,5 +1,7 @@ -$NetBSD: distinfo,v 1.14 2012/06/14 15:16:07 taca Exp $ +$NetBSD: distinfo,v 1.15 2012/08/02 08:36:40 fhajny Exp $ SHA1 (facter-1.6.10.gem) = f6a547a343a263c3acdfbc2780f4209b3305c957 RMD160 (facter-1.6.10.gem) = 7f1688c6657d45dad542c784b886bc6be67c69d0 Size (facter-1.6.10.gem) = 130560 bytes +SHA1 (patch-lib_facter_util_virtual.rb) = 9c15ed5019485a4ef4b0dbfca9e0f6a56d322d12 +SHA1 (patch-spec_unit_util__virtual_spec.rb) = 074499fd2d58be48f8ab9bb4a932a56e8a5f0b1f diff --git a/sysutils/ruby-facter/patches/patch-lib_facter_util_virtual.rb b/sysutils/ruby-facter/patches/patch-lib_facter_util_virtual.rb new file mode 100644 index 00000000000..88ebf23e431 --- /dev/null +++ b/sysutils/ruby-facter/patches/patch-lib_facter_util_virtual.rb @@ -0,0 +1,14 @@ +$NetBSD: patch-lib_facter_util_virtual.rb,v 1.1 2012/08/02 08:36:40 fhajny Exp $ + +Add support for Illumos, as per https://github.com/puppetlabs/facter/pull/249 +--- lib/facter/util/virtual.rb.orig 2012-08-01 12:08:54.829488784 +0000 ++++ lib/facter/util/virtual.rb +@@ -31,7 +31,7 @@ module Facter::Util::Virtual + + def self.vserver? + return false unless FileTest.exists?("/proc/self/status") +- txt = File.read("/proc/self/status") ++ txt = File.open("/proc/self/status", "rb").read + return true if txt =~ /^(s_context|VxID):[[:blank:]]*[0-9]/ + return false + end diff --git a/sysutils/ruby-facter/patches/patch-spec_unit_util__virtual_spec.rb b/sysutils/ruby-facter/patches/patch-spec_unit_util__virtual_spec.rb new file mode 100644 index 00000000000..972323ecdb1 --- /dev/null +++ b/sysutils/ruby-facter/patches/patch-spec_unit_util__virtual_spec.rb @@ -0,0 +1,45 @@ +$NetBSD: patch-spec_unit_util__virtual_spec.rb,v 1.1 2012/08/02 08:36:40 fhajny Exp $ + +Add support for Illumos, as per https://github.com/puppetlabs/facter/pull/249 +--- spec/unit/util/virtual_spec.rb.orig 2012-08-01 12:08:54.859082399 +0000 ++++ spec/unit/util/virtual_spec.rb +@@ -2,6 +2,7 @@ + + require 'spec_helper' + require 'facter/util/virtual' ++require 'stringio' + + describe Facter::Util::Virtual do + +@@ -64,19 +65,19 @@ describe Facter::Util::Virtual do + + it "should detect vserver when vxid present in process status" do + FileTest.stubs(:exists?).with("/proc/self/status").returns(true) +- File.stubs(:read).with("/proc/self/status").returns("VxID: 42\n") ++ File.stubs(:open).with("/proc/self/status", "rb").returns(StringIO.new("VxID: 42\n")) + Facter::Util::Virtual.should be_vserver + end + + it "should detect vserver when s_context present in process status" do + FileTest.stubs(:exists?).with("/proc/self/status").returns(true) +- File.stubs(:read).with("/proc/self/status").returns("s_context: 42\n") ++ File.stubs(:open).with("/proc/self/status", "rb").returns(StringIO.new("s_context: 42\n")) + Facter::Util::Virtual.should be_vserver + end + + it "should not detect vserver when vserver flags not present in process status" do + FileTest.stubs(:exists?).with("/proc/self/status").returns(true) +- File.stubs(:read).with("/proc/self/status").returns("wibble: 42\n") ++ File.stubs(:open).with("/proc/self/status", "rb").returns(StringIO.new("wibble: 42\n")) + Facter::Util::Virtual.should_not be_vserver + end + +@@ -94,7 +95,7 @@ describe Facter::Util::Virtual do + it "should detect vserver as #{expected.inspect}" do + status = File.read(status_file) + FileTest.stubs(:exists?).with("/proc/self/status").returns(true) +- File.stubs(:read).with("/proc/self/status").returns(status) ++ File.stubs(:open).with("/proc/self/status", "rb").returns(StringIO.new(status)) + Facter::Util::Virtual.vserver?.should == expected + end + end |