diff options
author | Benedikt Boehm <hollow@gentoo.org> | 2009-04-18 15:56:45 +0000 |
---|---|---|
committer | Benedikt Boehm <hollow@gentoo.org> | 2009-04-18 15:56:45 +0000 |
commit | 965c4d79c22424718ba5bd1c7318f8fcfc35b3a4 (patch) | |
tree | 11142d26c8ffe0cbf80649747080a32336113e4a | |
parent | stable amd64, bug 266562 (diff) | |
download | gentoo-2-965c4d79c22424718ba5bd1c7318f8fcfc35b3a4.tar.gz gentoo-2-965c4d79c22424718ba5bd1c7318f8fcfc35b3a4.tar.bz2 gentoo-2-965c4d79c22424718ba5bd1c7318f8fcfc35b3a4.zip |
fix virtual detection for openvz and vserver
(Portage version: 2.2_rc28/cvs/Linux i686)
-rw-r--r-- | dev-ruby/facter/ChangeLog | 10 | ||||
-rw-r--r-- | dev-ruby/facter/facter-1.5.2-r1.ebuild | 31 | ||||
-rw-r--r-- | dev-ruby/facter/files/facter-1.5.2-virtual.patch | 31 |
3 files changed, 70 insertions, 2 deletions
diff --git a/dev-ruby/facter/ChangeLog b/dev-ruby/facter/ChangeLog index 65b72f5012fc..e783aa7c629d 100644 --- a/dev-ruby/facter/ChangeLog +++ b/dev-ruby/facter/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-ruby/facter -# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-ruby/facter/ChangeLog,v 1.10 2008/09/09 09:33:56 matsuu Exp $ +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/facter/ChangeLog,v 1.11 2009/04/18 15:56:44 hollow Exp $ + +*facter-1.5.2-r1 (18 Apr 2009) + + 18 Apr 2009; Benedikt Böhm <hollow@gentoo.org> + +files/facter-1.5.2-virtual.patch, +facter-1.5.2-r1.ebuild: + fix virtual detection for openvz and vserver *facter-1.5.2 (09 Sep 2008) diff --git a/dev-ruby/facter/facter-1.5.2-r1.ebuild b/dev-ruby/facter/facter-1.5.2-r1.ebuild new file mode 100644 index 000000000000..f52a2546c8cb --- /dev/null +++ b/dev-ruby/facter/facter-1.5.2-r1.ebuild @@ -0,0 +1,31 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/facter/facter-1.5.2-r1.ebuild,v 1.1 2009/04/18 15:56:44 hollow Exp $ + +inherit ruby + +DESCRIPTION="A cross-platform Ruby library for retrieving facts from operating systems" +LICENSE="GPL-2" +HOMEPAGE="http://reductivelabs.com/projects/facter/index.html" +SRC_URI="http://reductivelabs.com/downloads/${PN}/${P}.tgz" + +SLOT="0" +IUSE="" +KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" + +USE_RUBY="ruby18" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-virtual.patch +} + +src_compile() { + : +} + +src_install() { + DESTDIR="${D}" ruby_einstall || die + DESTDIR="${D}" erubydoc +} diff --git a/dev-ruby/facter/files/facter-1.5.2-virtual.patch b/dev-ruby/facter/files/facter-1.5.2-virtual.patch new file mode 100644 index 000000000000..91cb039620fa --- /dev/null +++ b/dev-ruby/facter/files/facter-1.5.2-virtual.patch @@ -0,0 +1,31 @@ +Index: facter-1.5.2/lib/facter/virtual.rb +=================================================================== +--- facter-1.5.2.orig/lib/facter/virtual.rb ++++ facter-1.5.2/lib/facter/virtual.rb +@@ -7,7 +7,7 @@ Facter.add("virtual") do + + setcode do + +- if FileTest.exists?("/proc/user_beancounters") ++ if FileTest.exists?("/proc/vz/veinfo") && !FileTest.exists?("/proc/vz/version") + result = "openvz" + end + +@@ -45,12 +45,11 @@ Facter.add("virtual") do + result = "vmware_server" + end + +- mountexists = system "which mount > /dev/null 2>&1" +- if $?.exitstatus == 0 +- output = %x{mount} +- output.each {|p| +- result = "vserver" if p =~ /\/dev\/hdv1/ +- } ++ if FileTest.exists?("/proc/self/status") ++ txt = File.read("/proc/self/status") ++ if txt =~ /^(s_context|VxID):[[:blank:]]*[1-9]/ ++ result = "vserver" ++ end + end + + if FileTest.directory?('/proc/virtual') |