summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenedikt Boehm <hollow@gentoo.org>2010-03-12 07:56:26 +0000
committerBenedikt Boehm <hollow@gentoo.org>2010-03-12 07:56:26 +0000
commit4e6275af9d20a242597afc2d8e581e4b009050cc (patch)
tree0f42c367bdaeacaaa5e3b92aa02cc2039f1163b9 /dev-ruby/facter
parentVersion Bump (diff)
downloadgentoo-2-4e6275af9d20a242597afc2d8e581e4b009050cc.tar.gz
gentoo-2-4e6275af9d20a242597afc2d8e581e4b009050cc.tar.bz2
gentoo-2-4e6275af9d20a242597afc2d8e581e4b009050cc.zip
backport FQDN patch from upstream
(Portage version: 2.2_rc63/cvs/Linux i686)
Diffstat (limited to 'dev-ruby/facter')
-rw-r--r--dev-ruby/facter/ChangeLog6
-rw-r--r--dev-ruby/facter/facter-1.5.7.ebuild8
-rw-r--r--dev-ruby/facter/files/facter-1.5.7-fqdn.patch70
3 files changed, 82 insertions, 2 deletions
diff --git a/dev-ruby/facter/ChangeLog b/dev-ruby/facter/ChangeLog
index 60a4e3d59f6d..143277ed825d 100644
--- a/dev-ruby/facter/ChangeLog
+++ b/dev-ruby/facter/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for dev-ruby/facter
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-ruby/facter/ChangeLog,v 1.22 2010/02/25 21:58:23 grobian Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/facter/ChangeLog,v 1.23 2010/03/12 07:56:25 hollow Exp $
+
+ 12 Mar 2010; Benedikt Böhm <hollow@gentoo.org> facter-1.5.7.ebuild,
+ +files/facter-1.5.7-fqdn.patch:
+ backport FQDN patch from upstream
25 Feb 2010; Fabian Groffen <grobian@gentoo.org> facter-1.5.7.ebuild:
Marked ~x64-macos, thanks Ramon van Alteren, bug #305367
diff --git a/dev-ruby/facter/facter-1.5.7.ebuild b/dev-ruby/facter/facter-1.5.7.ebuild
index 6ddf9a7dd5ef..e8ca5c310f52 100644
--- a/dev-ruby/facter/facter-1.5.7.ebuild
+++ b/dev-ruby/facter/facter-1.5.7.ebuild
@@ -1,6 +1,8 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-ruby/facter/facter-1.5.7.ebuild,v 1.2 2010/02/25 21:58:23 grobian Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/facter/facter-1.5.7.ebuild,v 1.3 2010/03/12 07:56:25 hollow Exp $
+
+EAPI="2"
inherit ruby
@@ -15,6 +17,10 @@ KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64
USE_RUBY="ruby18"
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.5.7-fqdn.patch
+}
+
src_compile() {
:
}
diff --git a/dev-ruby/facter/files/facter-1.5.7-fqdn.patch b/dev-ruby/facter/files/facter-1.5.7-fqdn.patch
new file mode 100644
index 000000000000..685e8c0ef9ce
--- /dev/null
+++ b/dev-ruby/facter/files/facter-1.5.7-fqdn.patch
@@ -0,0 +1,70 @@
+commit dca615c98b864d75e2ac5899d98d04a2bd979eba
+Author: Ohad Levy <ohad.levy@infineon.com>
+Date: Mon Jan 18 10:42:43 2010 +0800
+
+ fixes #2573, #2085, #1291 - fixes domain and fqdn facts resolution
+
+ This patch removes the relationship between the domain fact and LDAP/NIS domains.
+ domain fact relates to DNS domain - this will avoid the confusion caused
+ by the LDAP/NIS domain (which might be different to the DNS domain name).
+ Additionally, if hostname is already in long form, it won't try to build
+ the fqdn fact from hostname and domain.
+
+diff --git a/lib/facter/domain.rb b/lib/facter/domain.rb
+index b1bba4d..5dfead0 100644
+--- a/lib/facter/domain.rb
++++ b/lib/facter/domain.rb
+@@ -4,14 +4,14 @@ Facter.add(:domain) do
+ # steps is important
+
+ Facter.value(:hostname)
+- next $domain if defined? $domain and ! $domain.nil?
++ # try to fetch the domain from hostname if long hostname is used.
++ if defined? $fqdn and $fqdn =~ /^([\w-]+)\.(.+)$/
++ next $2
++ end
+
+ domain = Facter::Util::Resolution.exec('dnsdomainname')
+ next domain if domain =~ /.+\..+/
+
+- domain = Facter::Util::Resolution.exec('domainname')
+- next domain if domain =~ /.+\..+/
+-
+ if FileTest.exists?("/etc/resolv.conf")
+ domain = nil
+ search = nil
+diff --git a/lib/facter/fqdn.rb b/lib/facter/fqdn.rb
+index 5ebc5f5..6271995 100644
+--- a/lib/facter/fqdn.rb
++++ b/lib/facter/fqdn.rb
+@@ -1,5 +1,9 @@
+ Facter.add(:fqdn) do
+ setcode do
++ # try to fetch the fqdn from hostname if long hostname is used.
++ Facter.value(:hostname)
++ next $fqdn if defined? $fqdn and ! $fqdn.nil?
++
+ host = Facter.value(:hostname)
+ domain = Facter.value(:domain)
+ if host and domain
+diff --git a/lib/facter/hostname.rb b/lib/facter/hostname.rb
+index 188efa4..c3ca968 100644
+--- a/lib/facter/hostname.rb
++++ b/lib/facter/hostname.rb
+@@ -1,12 +1,13 @@
+ Facter.add(:hostname, :ldapname => "cn") do
+ setcode do
++ require 'socket'
+ hostname = nil
+- name = Facter::Util::Resolution.exec('hostname') or nil
++ name = Socket.gethostbyname(Socket.gethostname).first
+ if name
+ if name =~ /^([\w-]+)\.(.+)$/
+ hostname = $1
+- # the Domain class uses this
+- $domain = $2
++ # the FQDN/Domain facts use this
++ $fqdn = name
+ else
+ hostname = name
+ end