[csw-devel] SF.net SVN: gar:[15008] csw/mgar/pkg/facter/trunk
phipsy at users.sourceforge.net
phipsy at users.sourceforge.net
Fri Jul 8 14:45:47 CEST 2011
Revision: 15008
http://gar.svn.sourceforge.net/gar/?rev=15008&view=rev
Author: phipsy
Date: 2011-07-08 12:45:47 +0000 (Fri, 08 Jul 2011)
Log Message:
-----------
Determined to get facter 1.6 build right
Modified Paths:
--------------
csw/mgar/pkg/facter/trunk/Makefile
Added Paths:
-----------
csw/mgar/pkg/facter/trunk/files/0001-puppetlabs-ticket-7038-to-fix-prtdiag.patch
Removed Paths:
-------------
csw/mgar/pkg/facter/trunk/files/0001-puppetlabs-ticket-7038-prtdiag-fixes.patch
Modified: csw/mgar/pkg/facter/trunk/Makefile
===================================================================
--- csw/mgar/pkg/facter/trunk/Makefile 2011-07-08 12:32:03 UTC (rev 15007)
+++ csw/mgar/pkg/facter/trunk/Makefile 2011-07-08 12:45:47 UTC (rev 15008)
@@ -24,9 +24,9 @@
LICENSE = LICENSE
RUNTIME_DEP_PKGS = CSWruby18
-BUILD_DEP_PKGS = $(RUNTIME_DEP_PKGS)
+BUILD_DEP_PKGS = $(RUNTIME_DEP_PKGS)
-PATCHFILES += 0001-puppetlabs-ticket-7038-prtdiag-fixes.patch
+PATCHFILES += 0001-puppetlabs-ticket-7038-to-fix-prtdiag.patch
ARCHALL = 1
CONFIGURE_SCRIPTS =
Deleted: csw/mgar/pkg/facter/trunk/files/0001-puppetlabs-ticket-7038-prtdiag-fixes.patch
===================================================================
--- csw/mgar/pkg/facter/trunk/files/0001-puppetlabs-ticket-7038-prtdiag-fixes.patch 2011-07-08 12:32:03 UTC (rev 15007)
+++ csw/mgar/pkg/facter/trunk/files/0001-puppetlabs-ticket-7038-prtdiag-fixes.patch 2011-07-08 12:45:47 UTC (rev 15008)
@@ -1,1017 +0,0 @@
-From bcdc9d013a4f680500d702d3232feaed1a53942b Mon Sep 17 00:00:00 2001
-From: Mark Phillips <none at none>
-Date: Fri, 8 Jul 2011 13:43:48 +0200
-Subject: [PATCH] puppetlabs ticket 7038 prtdiag fixes
-
----
- CHANGELOG | 39 ------
- ...ratingsystem_detection_after_clear_on_ubuntu.rb | 18 +++
- .../ticket_7039_facter_multiple_facts_one_file.rb | 31 +++++
- autotest/discover.rb | 9 ++
- autotest/facter_rspec.rb | 45 +++++++
- autotest/rspec.rb | 74 +++++++++++
- conf/redhat/facter.spec | 5 +-
- conf/solaris/pkginfo | 2 +-
- documentation/custom.page | 22 +++
- documentation/index.page | 19 +++
- ext/facter-diff | 74 +++++++++++
- lib/facter.rb | 2 +-
- lib/facter/util/manufacturer.rb | 7 +-
- lib/facter/util/prtdiag.rb | 29 ++++
- man/man8/facter.8 | 54 ++++++++
- .../manufacturer/solaris_sunfire_v120_prtdiag | 33 +++++
- spec/fixtures/manufacturer/solaris_t5220_prtdiag | 136 ++++++++++++++++++++
- spec/unit/util/manufacturer_spec.rb | 7 -
- spec/unit/util/prtdiag_spec.rb | 56 ++++++++
- tasks/rake/changlog.rake | 15 ++
- tasks/rake/ci.rake | 16 +++
- tasks/rake/dailybuild.rake | 9 ++
- tasks/rake/mail_patches.rake | 48 +++++++
- tasks/rake/metrics.rake | 6 +
- tasks/rake/sign.rake | 14 ++
- 25 files changed, 715 insertions(+), 55 deletions(-)
- create mode 100644 acceptance/tests/operatingsystem_detection_after_clear_on_ubuntu.rb
- create mode 100644 acceptance/tests/ticket_7039_facter_multiple_facts_one_file.rb
- create mode 100644 autotest/discover.rb
- create mode 100644 autotest/facter_rspec.rb
- create mode 100644 autotest/rspec.rb
- create mode 100644 documentation/custom.page
- create mode 100644 documentation/index.page
- create mode 100755 ext/facter-diff
- create mode 100644 lib/facter/util/prtdiag.rb
- create mode 100644 man/man8/facter.8
- create mode 100644 spec/fixtures/manufacturer/solaris_sunfire_v120_prtdiag
- create mode 100644 spec/fixtures/manufacturer/solaris_t5220_prtdiag
- create mode 100755 spec/unit/util/prtdiag_spec.rb
- create mode 100644 tasks/rake/changlog.rake
- create mode 100644 tasks/rake/ci.rake
- create mode 100644 tasks/rake/dailybuild.rake
- create mode 100644 tasks/rake/mail_patches.rake
- create mode 100644 tasks/rake/metrics.rake
- create mode 100644 tasks/rake/sign.rake
-
-diff --git a/CHANGELOG b/CHANGELOG
-index d43323e..cbb40bc 100644
---- a/CHANGELOG
-+++ b/CHANGELOG
-@@ -1,42 +1,3 @@
--1.6.0
--===
--9404a7a (#7670) Add an acceptance test
--0c23845 maint: Fix spelling of acceptance directory
--926e912 (#7670) Stop preloading all facts in the application
--2255abe (#7670) Never fail to find a fact that is present
--8002c24 (#7507) Fix 1.9.2 test failure
--0635822 Removed inappropriately uncredited Ohai method from ec2 fact
--6b1cd16 (#6614) Update ipaddress6 fact to work with Ruby 1.9
--21fe217 (#6612) Changed uptime spec to be endian agnostic
--19f96b5 (#6728) Facter improperly detects openvzve on CloudLinux systems
--5b10173 (#5135) Fix faulty logic in physicalprocessorcount
--53cd946 Ensures that ARP facts are returned only on EC2 hosts
--bfa038d Fixed #6974 - Moved to Apache 2.0 license
--d56bca8 refactor the mechanism for allowing for resolution ordering to be influenced
--9f4c5c6 (#6740) facter doesn't always respect facts in environment variables
--7441b32 Partial fix for #6971 - Fix for virtual tests
--7f3e89d (#2714) Fixed faulty test
--bfc16f6 (#2714) Added timeout to prtdiag resulution
--c2ff833 (#5135) Refactored physicalprocessorcount
--0c4a98b Re-factor. Do not use pure-Ruby file reading against "/proc/cpuinfo" and possibly any entry under "/sys" from the sysfs file system.
--cb52b06 Fix. Using sysfs file system entries to count the number of physical CPUs. Fall-back to "/proc/cpuinfo" included for backward-compatibility with legacy systems.
--3efa9d7 (#3856) Add virtualbox detection via lspci (graphics card), dmidecode, and prtdiag for Solaris and corresponding tests. Darwin case is not handled yet.
--7c80172 (#6883) Update Facter install.rb to be slightly more informative.
--d31e3f9 (#5394) Document each Facter fact.
--af4947c (#6862) Add a default subject for the mail_patches rake task
--d6967a0 (#6613) Switch solaris macaddress fact to netstat
--e056218 (#6817) Fix for Ruby 1.9 by calling .each_line on a string
--861c2b2 maint: cleanup whitespace
--f6c9927 (#6719) Corrected faulty logic in bugfix
--e42e57c (#3856) Add virtualbox detection via lspci (graphics card), dmidecode, and prtdiag for Solaris and corresponding tests. Darwin case is not handled yet.
--0b5b546 (#6883) Update Facter install.rb to be slightly more informative.
--7c08270 (#5394) Document each Facter fact.
--06eb3f5 (#6883) Update Facter install.rb to be slightly more informative.
--1063753 (#6862) Add a default subject for the mail_patches rake task
--56b5f10 (#6613) Switch solaris macaddress fact to netstat
--fd4f31c (#6817) Fix for Ruby 1.9 by calling .each_line on a string
--72996ff maint: cleanup whitespace
--
- 1.5.9
- =====
- 4de8b20 Updated CHANGELOG for 1.5.9rc6
-diff --git a/acceptance/tests/operatingsystem_detection_after_clear_on_ubuntu.rb b/acceptance/tests/operatingsystem_detection_after_clear_on_ubuntu.rb
-new file mode 100644
-index 0000000..3c7c4d9
---- /dev/null
-+++ b/acceptance/tests/operatingsystem_detection_after_clear_on_ubuntu.rb
-@@ -0,0 +1,18 @@
-+test_name "#7670: Facter should properly detect operatingsystem on Ubuntu after a clear"
-+
-+script_contents = <<-OS_DETECT
-+ require 'facter'
-+ Facter['operatingsystem'].value
-+ Facter.clear
-+ exit Facter['operatingsystem'].value == 'Ubuntu'
-+OS_DETECT
-+
-+script_name = "/tmp/facter_os_detection_test_#{$$}"
-+
-+agents.each do |agent|
-+ next unless agent['platform'].include? 'ubuntu'
-+
-+ create_remote_file(agent, script_name, script_contents)
-+
-+ on(agent, "ruby #{script_name}")
-+end
-diff --git a/acceptance/tests/ticket_7039_facter_multiple_facts_one_file.rb b/acceptance/tests/ticket_7039_facter_multiple_facts_one_file.rb
-new file mode 100644
-index 0000000..fb78628
---- /dev/null
-+++ b/acceptance/tests/ticket_7039_facter_multiple_facts_one_file.rb
-@@ -0,0 +1,31 @@
-+test_name "#7039: Facter having issue handling multiple facts in a single file"
-+
-+fact_file= %q{
-+Facter.add(:test_fact1) do
-+ setcode do
-+ "test fact 1"
-+ end
-+end
-+
-+Facter.add(:test_fact2) do
-+ setcode do
-+ "test fact 2"
-+ end
-+end
-+}
-+
-+agent1=agents.first
-+step "Agent: Create fact file with multiple facts"
-+create_remote_file(agent1, '/tmp/test_facts.rb', fact_file )
-+
-+step "Agent: Verify test_fact1 from /tmp/test_facts.rb"
-+on(agent1, "export FACTERLIB=/tmp && facter --puppet test_fact1") do
-+ fail_test "Fact 1 not returned by facter --puppet test_fact1" unless
-+ stdout.include? 'test fact 1'
-+end
-+
-+step "Agent: Verify test_fact2 from /tmp/test_facts.rb"
-+on(agent1, "export FACTERLIB=/tmp && facter --puppet test_fact2") do
-+ fail_test "Fact 1 not returned by facter --puppet test_fact2" unless
-+ stdout.include? 'test fact 2'
-+end
-diff --git a/autotest/discover.rb b/autotest/discover.rb
-new file mode 100644
-index 0000000..030d07f
---- /dev/null
-+++ b/autotest/discover.rb
-@@ -0,0 +1,9 @@
-+require 'autotest'
-+
-+Autotest.add_discovery do
-+ "rspec"
-+end
-+
-+Autotest.add_discovery do
-+ "facter"
-+end
-diff --git a/autotest/facter_rspec.rb b/autotest/facter_rspec.rb
-new file mode 100644
-index 0000000..90e646d
---- /dev/null
-+++ b/autotest/facter_rspec.rb
-@@ -0,0 +1,45 @@
-+require 'autotest'
-+require 'autotest/rspec'
-+
-+Autotest.add_hook :initialize do |at|
-+ at.clear_mappings
-+
-+ # the libraries under lib/facter
-+ at.add_mapping(%r%^lib/facter/(.*)\.rb$%) { |filename, m|
-+ at.files_matching %r!spec/(unit|integration)/#{m[1]}.rb!
-+ }
-+
-+ # the actual spec files themselves
-+ at.add_mapping(%r%^spec/(unit|integration)/.*\.rb$%) { |filename, _|
-+ filename
-+ }
-+
-+ # force a complete re-run for all of these:
-+
-+ # main facter lib
-+ at.add_mapping(%r!^lib/facter\.rb$!) { |filename, _|
-+ at.files_matching %r!spec/(unit|integration)/.*\.rb!
-+ }
-+
-+ # the spec_helper
-+ at.add_mapping(%r!^spec/spec_helper\.rb$!) { |filename, _|
-+ at.files_matching %r!spec/(unit|integration)/.*\.rb!
-+ }
-+
-+ # the facter spec libraries
-+ at.add_mapping(%r!^spec/lib/spec.*!) { |filename, _|
-+ at.files_matching %r!spec/(unit|integration)/.*\.rb!
-+ }
-+
-+ # the monkey patches for rspec
-+ at.add_mapping(%r!^spec/lib/monkey_patches/.*!) { |filename, _|
-+ at.files_matching %r!spec/(unit|integration)/.*\.rb!
-+ }
-+end
-+
-+class Autotest::FacterRspec < Autotest::Rspec
-+ def spec_commands
-+ ENV["AUTOTEST"] = "true"
-+ ENV["PATH"].split(File::PATH_SEPARATOR).collect { |dir| File.join(dir, "spec") }
-+ end
-+end
-diff --git a/autotest/rspec.rb b/autotest/rspec.rb
-new file mode 100644
-index 0000000..e395dfe
---- /dev/null
-+++ b/autotest/rspec.rb
-@@ -0,0 +1,74 @@
-+require 'autotest'
-+
-+Autotest.add_hook :initialize do |at|
-+ at.clear_mappings
-+ # watch out: Ruby bug (1.8.6):
-+ # %r(/) != /\//
-+ at.add_mapping(%r%^spec/.*\.rb$%) { |filename, _|
-+ filename
-+ }
-+ at.add_mapping(%r%^lib/(.*)\.rb$%) { |_, m|
-+ ["spec/#{m[1]}_spec.rb"]
-+ }
-+ at.add_mapping(%r%^spec/(spec_helper|shared/.*)\.rb$%) {
-+ at.files_matching %r{^spec/.*_spec\.rb$}
-+ }
-+end
-+
-+class RspecCommandError < StandardError; end
-+
-+class Autotest::Rspec < Autotest
-+
-+ def initialize
-+ super
-+
-+ self.failed_results_re = /^\d+\)\n(?:\e\[\d*m)?(?:.*?Error in )?'([^\n]*)'(?: FAILED)?(?:\e\[\d*m)?\n(.*?)\n\n/m
-+ self.completed_re = /\Z/ # FIX: some sort of summary line at the end?
-+ end
-+
-+ def consolidate_failures(failed)
-+ filters = Hash.new { |h,k| h[k] = [] }
-+ failed.each do |spec, failed_trace|
-+ if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) } then
-+ filters[f] << spec
-+ break
-+ end
-+ end
-+ return filters
-+ end
-+
-+ def make_test_cmd(files_to_test)
-+ return "#{ruby} -S #{spec_command} #{add_options_if_present} #{files_to_test.keys.flatten.join(' ')}"
-+ end
-+
-+ def add_options_if_present
-+ File.exist?("spec/spec.opts") ? "-O spec/spec.opts " : ""
-+ end
-+
-+ # Finds the proper spec command to use. Precendence is set in the
-+ # lazily-evaluated method spec_commands. Alias + Override that in
-+ # ~/.autotest to provide a different spec command then the default
-+ # paths provided.
-+ def spec_command(separator=File::ALT_SEPARATOR)
-+ unless defined? @spec_command then
-+ @spec_command = spec_commands.find { |cmd| File.exists? cmd }
-+
-+ raise RspecCommandError, "No spec command could be found!" unless @spec_command
-+
-+ @spec_command.gsub! File::SEPARATOR, separator if separator
-+ end
-+ @spec_command
-+ end
-+
-+ # Autotest will look for spec commands in the following
-+ # locations, in this order:
-+ #
-+ # * bin/spec
-+ # * default spec bin/loader installed in Rubygems
-+ def spec_commands
-+ [
-+ File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'spec')),
-+ File.join(Config::CONFIG['bindir'], 'spec')
-+ ]
-+ end
-+end
-diff --git a/conf/redhat/facter.spec b/conf/redhat/facter.spec
-index e78b655..99a6505 100644
---- a/conf/redhat/facter.spec
-+++ b/conf/redhat/facter.spec
-@@ -5,7 +5,7 @@
-
- Summary: Ruby module for collecting simple facts about a host operating system
- Name: facter
--Version: 1.6.0
-+Version: 1.5.8
- Release: 1%{?dist}
- License: Apache 2.0
- Group: System Environment/Base
-@@ -52,9 +52,6 @@ rm -rf %{buildroot}
-
-
- %changelog
--* Thu Jun 23 2011 Michael Stahnke <stahnma at puppetlabs.com> - 1.6.0-1
--- Update to 1.6.0
--
- * Sat Aug 28 2010 Todd Zullinger <tmz at pobox.com> - 1.5.8-1
- - Update to 1.5.8
-
-diff --git a/conf/solaris/pkginfo b/conf/solaris/pkginfo
-index 262a436..968a459 100644
---- a/conf/solaris/pkginfo
-+++ b/conf/solaris/pkginfo
-@@ -1,6 +1,6 @@
- PKG=CSWfacter
- NAME=facter - System Fact Gatherer
--VERSION=1.6.0
-+VERSION=1.3.5
- CATEGORY=application
- VENDOR=http://www.puppetlabs.com/puppet/related-projects/facter
- HOTLINE=http://puppetlabs.com/cgi-bin/facter.cgi
-diff --git a/documentation/custom.page b/documentation/custom.page
-new file mode 100644
-index 0000000..0708a70
---- /dev/null
-+++ b/documentation/custom.page
-@@ -0,0 +1,22 @@
-+---
-+inMenu: true
-+directoryName: Custom Facts
-+---
-+
-+Facter does everything it can to make adding custom facts easy. It will
-+autoload any files it finds in a ``facter/`` directory in its search
-+path, so you don't need to modify the package files. Also, Facter will
-+search through your environment for any variables whose names start with
-+'FACTER_' (case insensitive) and automatically add those facts.
-+
-+As a simple example, here is how I publish my home directory to Puppet:
-+
-+ Facter.add("home") do
-+ setcode do
-+ ENV['HOME']
-+ end
-+ end
-+
-+I have ~/lib/ruby in my $RUBYLIB environment variable, so I just created
-+~/lib/ruby/facter and dropped the above code into a ``home.rb`` file
-+within that directory.
-diff --git a/documentation/index.page b/documentation/index.page
-new file mode 100644
-index 0000000..c64938a
---- /dev/null
-+++ b/documentation/index.page
-@@ -0,0 +1,19 @@
-+---
-+inMenu: false
-+directoryName: Facter
-+---
-+
-+A cross-platform Ruby library for retrieving facts from operating systems.
-+Supports multiple resolution mechanisms, any of which can be restricted to
-+working only on certain operating systems or environments. Facter is especially
-+useful for retrieving things like operating system names, IP addresses, MAC
-+addresses, and SSH keys.
-+
-+It is easy to extend Facter to include your own [custom facts](custom.html) or
-+to include additional mechanisms for retrieving facts.
-+
-+* [Downloads](/downloads/facter/)
-+* [Bug Tracking](/cgi-bin/facter.cgi)
-+* [API Documentation](/downloads/facter/apidocs/)
-+
-+*$Id$*
-diff --git a/ext/facter-diff b/ext/facter-diff
-new file mode 100755
-index 0000000..6616318
---- /dev/null
-+++ b/ext/facter-diff
-@@ -0,0 +1,74 @@
-+
-+#!/usr/bin/env sh
-+#
-+# Output the difference between a facter command run on two different versions
-+# of facter. Uses unified diff format.
-+
-+OPTIONS_SPEC="\
-+facter-diff [options] <rev1> <rev2> [fact]...
-+
-+Example:
-+
-+ ./ext/facter-diff 1.5.7 1.0.2
-+
-+--
-+h,help Display this help"
-+
-+. "$(git --exec-path)/git-sh-setup"
-+eval "$(echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)"
-+trap 'err=$?; cleanup; exit $err' 0
-+
-+cleanup() {
-+ test $origin && git checkout -q "$origin"
-+}
-+
-+facter() {
-+ ruby -Ilib bin/facter "$@"
-+}
-+
-+log_facter_run() {
-+ local ref=$1 && shift
-+ local tmpfile=$1 && shift
-+
-+ git checkout -qf "$ref" ||
-+ die "fatal: unable to checkout $ref"
-+ facter "$@" > $tmpfile
-+}
-+
-+verify_revision() {
-+ git rev-parse --verify --quiet "$1" > /dev/null ||
-+ die "fatal: '$1' is not a valid revision"
-+}
-+
-+test $1 = "--" && shift # git rev-parse seems to leave the -- in
-+test $# -eq 0 && usage
-+
-+test $# -gt 1 ||
-+ die "fatal: must specify two revisions"
-+
-+status=$(git status -s)
-+test -z "$status" ||
-+ die "fatal: $0 cannot be used with a dirty working copy"
-+
-+origin=$(git rev-parse --symbolic-full-name HEAD)
-+test "$origin" = "HEAD" &&
-+ origin=$(git rev-parse HEAD)
-+
-+test -x "bin/facter" ||
-+ die "fatal: $0 must be run from the project root"
-+
-+ref1="$1" && shift
-+ref2="$1" && shift
-+
-+verify_revision $ref1
-+verify_revision $ref2
-+
-+tmpfile1="/tmp/$(basename $0).$$.1.tmp"
-+tmpfile2="/tmp/$(basename $0).$$.2.tmp"
-+
-+log_facter_run $ref1 $tmpfile1 $@
-+log_facter_run $ref2 $tmpfile2 $@
-+
-+git checkout -f "$origin" > /dev/null 2>&1
-+
-+diff --label "$ref1" --label "$ref2" -u $tmpfile1 $tmpfile2
-diff --git a/lib/facter.rb b/lib/facter.rb
-index eed32f8..2073b84 100644
---- a/lib/facter.rb
-+++ b/lib/facter.rb
-@@ -24,7 +24,7 @@ module Facter
- include Comparable
- include Enumerable
-
-- FACTERVERSION = '1.6.0'
-+ FACTERVERSION = '1.5.9'
- # = Facter
- # Functions as a hash of 'facts' you might care about about your
- # system, such as mac address, IP address, Video card, etc.
-diff --git a/lib/facter/util/manufacturer.rb b/lib/facter/util/manufacturer.rb
-index 8e9bde2..33389c9 100644
---- a/lib/facter/util/manufacturer.rb
-+++ b/lib/facter/util/manufacturer.rb
-@@ -1,6 +1,8 @@
- # mamufacturer.rb
- # Support methods for manufacturer specific facts
-
-+require 'facter/util/prtdiag'
-+
- module Facter::Manufacturer
-
- def self.get_dmi_table()
-@@ -62,11 +64,10 @@ module Facter::Manufacturer
- end
-
- def self.prtdiag_sparc_find_system_info()
-- # Parses prtdiag for a SPARC architecture string, won't work with Solaris x86
-- output = Facter::Util::Resolution.exec('/usr/sbin/prtdiag')
-
-+ # Parses prtdiag for a SPARC architecture string, won't work with Solaris x86
- # System Configuration: Sun Microsystems sun4u Sun SPARC Enterprise M3000 Server
-- sysconfig = output.split("\n")[0]
-+ sysconfig = Facter::Util::Prtdiag.system_configuration
- if sysconfig =~ /^System Configuration:\s+(.+?)\s+(sun\d+\S+)\s+(.+)/ then
- Facter.add('manufacturer') do
- setcode do
-diff --git a/lib/facter/util/prtdiag.rb b/lib/facter/util/prtdiag.rb
-new file mode 100644
-index 0000000..5edce5b
---- /dev/null
-+++ b/lib/facter/util/prtdiag.rb
-@@ -0,0 +1,29 @@
-+# Module to safely query prtdiag
-+#
-+# prtdiag will fail if it is called on a non-solaris host, or if it is in a
-+# zone, and it will hang if a service that prtdiag relies on is crashed.
-+# This should abstract safely retrieving information from prtdiag
-+
-+require 'timeout'
-+
-+module Facter::Util::Prtdiag
-+
-+ def self.system_configuration
-+ begin
-+ Timeout.timeout(6) do
-+ output = Facter::Util::Resolution.exec('/usr/sbin/prtdiag')
-+ if output
-+ output.each_line do |pd|
-+ return pd if pd =~ /System Configuration/
-+ end
-+ end
-+ end
-+ rescue Timeout::Error => detail
-+ warn "Timed out while calling prtdiag"
-+ # This call avoids zombies -- basically, create a thread that will
-+ # dezombify all of the child processes that we're ignoring because
-+ # of the timeout.
-+ Thread.new { Process.waitall }
-+ end
-+ end
-+end
-diff --git a/man/man8/facter.8 b/man/man8/facter.8
-new file mode 100644
-index 0000000..ff24b89
---- /dev/null
-+++ b/man/man8/facter.8
-@@ -0,0 +1,54 @@
-+.TH "" "" ""
-+.SH NAME
-+ \-
-+.\" Man page generated from reStructeredText.
-+.
-+.SH SYNOPSIS
-+.sp
-+Collect and display facts about the system.
-+.SH USAGE
-+.INDENT 0.0
-+.INDENT 3.5
-+.sp
-+facter [\-d|\-\-debug] [\-h|\-\-help] [\-p|\-\-puppet] [\-v|\-\-version] [\-y|\-\-yaml] [fact] [fact] [...]
-+.UNINDENT
-+.UNINDENT
-+.SH DESCRIPTION
-+.sp
-+Collect and display facts about the current system. The library behind
-+Facter is easy to expand, making Facter an easy way to collect
-+information about a system from within the shell or within Ruby.
-+.sp
-+If no facts are specifically asked for, then all facts will be returned.
-+.SH OPTIONS
-+.sp
-+debug: Enable debugging.
-+.sp
-+help: Print this help message
-+.INDENT 0.0
-+.TP
-+.B puppet: Load the Puppet libraries, thus allowing Facter to load
-+.
-+Puppet\-specific facts.
-+.UNINDENT
-+.sp
-+version: Print the version and exit.
-+.sp
-+yaml: Emit facts in YAML format.
-+.SH EXAMPLE
-+.INDENT 0.0
-+.INDENT 3.5
-+.sp
-+facter kernel
-+.UNINDENT
-+.UNINDENT
-+.SH AUTHOR
-+.sp
-+Luke Kanies
-+.SH COPYRIGHT
-+.sp
-+Copyright (c) 2006 Reductive Labs, LLC Licensed under the GNU Public
-+License
-+.\" Generated by docutils manpage writer.
-+.\"
-+.
-diff --git a/spec/fixtures/manufacturer/solaris_sunfire_v120_prtdiag b/spec/fixtures/manufacturer/solaris_sunfire_v120_prtdiag
-new file mode 100644
-index 0000000..e9949b5
---- /dev/null
-+++ b/spec/fixtures/manufacturer/solaris_sunfire_v120_prtdiag
-@@ -0,0 +1,33 @@
-+System Configuration: Sun Microsystems sun4u Sun Fire V120 (UltraSPARC-IIe 648MHz)
-+System clock frequency: 100 MHz
-+Memory size: 2048 Megabytes
-+
-+========================= CPUs =========================
-+
-+ Run Ecache CPU CPU
-+Brd CPU Module MHz MB Impl. Mask
-+--- --- ------- ----- ------ ------ ----
-+ 0 0 0 648 0.5 13 3.3
-+
-+
-+========================= IO Cards =========================
-+
-+ Bus# Freq
-+Brd Type MHz Slot Name Model
-+--- ---- ---- ---- -------------------------------- ----------------------
-+ 0 PCI-1 33 12 ebus
-+ 0 PCI-1 33 3 pmu-pci10b9,7101
-+ 0 PCI-1 33 3 lomp
-+ 0 PCI-1 33 7 isa
-+ 0 PCI-1 33 12 network-pci108e,1101 SUNW,pci-eri
-+ 0 PCI-1 33 12 usb-pci108e,1103.1
-+ 0 PCI-1 33 13 ide-pci10b9,5229
-+ 0 PCI-1 33 5 network-pci108e,1101 SUNW,pci-eri
-+ 0 PCI-1 33 5 usb-pci108e,1103.1
-+ 0 PCI-2 33 8 scsi-glm Symbios,53C896
-+ 0 PCI-2 33 8 scsi-glm Symbios,53C896
-+ 0 PCI-2 33 5 network-pci108e,2bad SUNW,pci-gem
-+
-+
-+No failures found in System
-+===========================
-diff --git a/spec/fixtures/manufacturer/solaris_t5220_prtdiag b/spec/fixtures/manufacturer/solaris_t5220_prtdiag
-new file mode 100644
-index 0000000..91a428d
---- /dev/null
-+++ b/spec/fixtures/manufacturer/solaris_t5220_prtdiag
-@@ -0,0 +1,136 @@
-+System Configuration: Sun Microsystems sun4v SPARC Enterprise T5220
-+Memory size: 32640 Megabytes
-+
-+================================ Virtual CPUs ================================
-+
-+
-+CPU ID Frequency Implementation Status
-+------ --------- ---------------------- -------
-+0 1165 MHz SUNW,UltraSPARC-T2 on-line
-+1 1165 MHz SUNW,UltraSPARC-T2 on-line
-+2 1165 MHz SUNW,UltraSPARC-T2 on-line
-+3 1165 MHz SUNW,UltraSPARC-T2 on-line
-+4 1165 MHz SUNW,UltraSPARC-T2 on-line
-+5 1165 MHz SUNW,UltraSPARC-T2 on-line
-+6 1165 MHz SUNW,UltraSPARC-T2 on-line
-+7 1165 MHz SUNW,UltraSPARC-T2 on-line
-+8 1165 MHz SUNW,UltraSPARC-T2 on-line
-+9 1165 MHz SUNW,UltraSPARC-T2 on-line
-+10 1165 MHz SUNW,UltraSPARC-T2 on-line
-+11 1165 MHz SUNW,UltraSPARC-T2 on-line
-+12 1165 MHz SUNW,UltraSPARC-T2 on-line
-+13 1165 MHz SUNW,UltraSPARC-T2 on-line
-+14 1165 MHz SUNW,UltraSPARC-T2 on-line
-+15 1165 MHz SUNW,UltraSPARC-T2 on-line
-+16 1165 MHz SUNW,UltraSPARC-T2 on-line
-+17 1165 MHz SUNW,UltraSPARC-T2 on-line
-+18 1165 MHz SUNW,UltraSPARC-T2 on-line
-+19 1165 MHz SUNW,UltraSPARC-T2 on-line
-+20 1165 MHz SUNW,UltraSPARC-T2 on-line
-+21 1165 MHz SUNW,UltraSPARC-T2 on-line
-+22 1165 MHz SUNW,UltraSPARC-T2 on-line
-+23 1165 MHz SUNW,UltraSPARC-T2 on-line
-+24 1165 MHz SUNW,UltraSPARC-T2 on-line
-+25 1165 MHz SUNW,UltraSPARC-T2 on-line
-+26 1165 MHz SUNW,UltraSPARC-T2 on-line
-+27 1165 MHz SUNW,UltraSPARC-T2 on-line
-+28 1165 MHz SUNW,UltraSPARC-T2 on-line
-+29 1165 MHz SUNW,UltraSPARC-T2 on-line
-+30 1165 MHz SUNW,UltraSPARC-T2 on-line
-+31 1165 MHz SUNW,UltraSPARC-T2 on-line
-+32 1165 MHz SUNW,UltraSPARC-T2 on-line
-+33 1165 MHz SUNW,UltraSPARC-T2 on-line
-+34 1165 MHz SUNW,UltraSPARC-T2 on-line
-+35 1165 MHz SUNW,UltraSPARC-T2 on-line
-+36 1165 MHz SUNW,UltraSPARC-T2 on-line
-+37 1165 MHz SUNW,UltraSPARC-T2 on-line
-+38 1165 MHz SUNW,UltraSPARC-T2 on-line
-+39 1165 MHz SUNW,UltraSPARC-T2 on-line
-+40 1165 MHz SUNW,UltraSPARC-T2 on-line
-+41 1165 MHz SUNW,UltraSPARC-T2 on-line
-+42 1165 MHz SUNW,UltraSPARC-T2 on-line
-+43 1165 MHz SUNW,UltraSPARC-T2 on-line
-+44 1165 MHz SUNW,UltraSPARC-T2 on-line
-+45 1165 MHz SUNW,UltraSPARC-T2 on-line
-+46 1165 MHz SUNW,UltraSPARC-T2 on-line
-+47 1165 MHz SUNW,UltraSPARC-T2 on-line
-+48 1165 MHz SUNW,UltraSPARC-T2 on-line
-+49 1165 MHz SUNW,UltraSPARC-T2 on-line
-+50 1165 MHz SUNW,UltraSPARC-T2 on-line
-+51 1165 MHz SUNW,UltraSPARC-T2 on-line
-+52 1165 MHz SUNW,UltraSPARC-T2 on-line
-+53 1165 MHz SUNW,UltraSPARC-T2 on-line
-+54 1165 MHz SUNW,UltraSPARC-T2 on-line
-+55 1165 MHz SUNW,UltraSPARC-T2 on-line
-+56 1165 MHz SUNW,UltraSPARC-T2 on-line
-+57 1165 MHz SUNW,UltraSPARC-T2 on-line
-+58 1165 MHz SUNW,UltraSPARC-T2 on-line
-+59 1165 MHz SUNW,UltraSPARC-T2 on-line
-+60 1165 MHz SUNW,UltraSPARC-T2 on-line
-+61 1165 MHz SUNW,UltraSPARC-T2 on-line
-+62 1165 MHz SUNW,UltraSPARC-T2 on-line
-+63 1165 MHz SUNW,UltraSPARC-T2 on-line
-+
-+======================= Physical Memory Configuration ========================
-+Segment Table:
-+--------------------------------------------------------------
-+Base Segment Interleave Bank Contains
-+Address Size Factor Size Modules
-+--------------------------------------------------------------
-+0x0 32 GB 8 4 GB MB/CMP0/BR0/CH0/D0
-+ MB/CMP0/BR0/CH1/D0
-+ 4 GB MB/CMP0/BR0/CH0/D1
-+ MB/CMP0/BR0/CH1/D1
-+ 4 GB MB/CMP0/BR1/CH0/D0
-+ MB/CMP0/BR1/CH1/D0
-+ 4 GB MB/CMP0/BR1/CH0/D1
-+ MB/CMP0/BR1/CH1/D1
-+ 4 GB MB/CMP0/BR2/CH0/D0
-+ MB/CMP0/BR2/CH1/D0
-+ 4 GB MB/CMP0/BR2/CH0/D1
-+ MB/CMP0/BR2/CH1/D1
-+ 4 GB MB/CMP0/BR3/CH0/D0
-+ MB/CMP0/BR3/CH1/D0
-+ 4 GB MB/CMP0/BR3/CH0/D1
-+ MB/CMP0/BR3/CH1/D1
-+
-+
-+================================ IO Devices ================================
-+Slot + Bus Name + Model
-+Status Type Path
-+----------------------------------------------------------------------------
-+MB/NET0 PCIE network-pciex8086,105e
-+ /pci at 0/pci at 0/pci at 1/pci at 0/pci at 2/network at 0
-+MB/NET1 PCIE network-pciex8086,105e
-+ /pci at 0/pci at 0/pci at 1/pci at 0/pci at 2/network at 0,1
-+MB/NET2 PCIE network-pciex8086,105e
-+ /pci at 0/pci at 0/pci at 1/pci at 0/pci at 3/network at 0
-+MB/NET3 PCIE network-pciex8086,105e
-+ /pci at 0/pci at 0/pci at 1/pci at 0/pci at 3/network at 0,1
-+MB/SASHBA PCIE scsi-pciex1000,58 LSI,1068E
-+ /pci at 0/pci at 0/pci at 2/scsi at 0
-+MB PCIX usb-pciclass,0c0310
-+ /pci at 0/pci at 0/pci at 1/pci at 0/pci at 1/pci at 0/usb at 0
-+MB PCIX usb-pciclass,0c0310
-+ /pci at 0/pci at 0/pci at 1/pci at 0/pci at 1/pci at 0/usb at 0,1
-+MB PCIX usb-pciclass,0c0320
-+ /pci at 0/pci at 0/pci at 1/pci at 0/pci at 1/pci at 0/usb at 0,2
-+
-+============================ Environmental Status ============================
-+Fan sensors:
-+All fan sensors are OK.
-+
-+Temperature sensors:
-+All temperature sensors are OK.
-+
-+Current sensors:
-+All current sensors are OK.
-+
-+Voltage sensors:
-+All voltage sensors are OK.
-+
-+Voltage indicators:
-+All voltage indicators are OK.
-+
-+============================ FRU Status ============================
-+All FRUs are enabled.
-diff --git a/spec/unit/util/manufacturer_spec.rb b/spec/unit/util/manufacturer_spec.rb
-index c3b372e..77644af 100644
---- a/spec/unit/util/manufacturer_spec.rb
-+++ b/spec/unit/util/manufacturer_spec.rb
-@@ -16,13 +16,6 @@ describe Facter::Manufacturer do
- Facter::Manufacturer.get_dmi_table().should be_nil
- end
-
-- it "should parse prtdiag output" do
-- Facter::Util::Resolution.stubs(:exec).returns("System Configuration: Sun Microsystems sun4u Sun SPARC Enterprise M3000 Server")
-- Facter::Manufacturer.prtdiag_sparc_find_system_info()
-- Facter.value(:manufacturer).should == "Sun Microsystems"
-- Facter.value(:productname).should == "Sun SPARC Enterprise M3000 Server"
-- end
--
- it "should strip white space on dmi output with spaces" do
- sample_output_file = File.dirname(__FILE__) + "/../data/linux_dmidecode_with_spaces"
- dmidecode_output = File.new(sample_output_file).read()
-diff --git a/spec/unit/util/prtdiag_spec.rb b/spec/unit/util/prtdiag_spec.rb
-new file mode 100755
-index 0000000..3301c04
---- /dev/null
-+++ b/spec/unit/util/prtdiag_spec.rb
-@@ -0,0 +1,56 @@
-+#!/usr/bin/env ruby
-+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
-+
-+require 'facter/util/prtdiag'
-+
-+def fixture_data(fixture_name)
-+ fixture_path = File.join(SPECDIR, 'fixtures', 'manufacturer')
-+ File.read(File.join(fixture_path, fixture_name))
-+end
-+
-+describe Facter::Util::Prtdiag, 'prtdiag' do
-+ describe 'on a solaris sunfire v120' do
-+ before do
-+ Facter::Util::Prtdiag.expects("system_configuration").returns(fixture_data('solaris_sunfire_v120_prtdiag'))
-+ Facter::Manufacturer.prtdiag_sparc_find_system_info()
-+ end
-+
-+ it 'sets the correct manufacturer fact' do
-+ Facter.value(:manufacturer).should == "Sun Microsystems"
-+ end
-+
-+ it 'sets the correct productname fact' do
-+ Facter.value(:productname).should == "Sun Fire V120 (UltraSPARC-IIe 648MHz)"
-+ end
-+ end
-+
-+ describe 'on a solaris t5520' do
-+ before do
-+ Facter::Util::Prtdiag.expects("system_configuration").returns(fixture_data('solaris_t5220_prtdiag'))
-+ Facter::Manufacturer.prtdiag_sparc_find_system_info()
-+ end
-+
-+ it 'sets the correct manufacturer fact' do
-+ Facter.value(:manufacturer).should == "Sun Microsystems"
-+ end
-+
-+ it 'sets the correct productname fact' do
-+ Facter.value(:productname).should == "SPARC Enterprise T5220"
-+ end
-+ end
-+
-+ describe 'on an unknown SunOS sparc system' do
-+ before do
-+ Facter::Util::Prtdiag.expects("system_configuration").returns(nil)
-+ Facter::Manufacturer.prtdiag_sparc_find_system_info()
-+ end
-+
-+ it 'clears the manufacturer fact' do
-+ Facter.value(:manufacturer).should be_nil
-+ end
-+
-+ it 'clears the productname fact' do
-+ Facter.value(:productname).should be_nil
-+ end
-+ end
-+end
-diff --git a/tasks/rake/changlog.rake b/tasks/rake/changlog.rake
-new file mode 100644
-index 0000000..0c2f1d2
---- /dev/null
-+++ b/tasks/rake/changlog.rake
-@@ -0,0 +1,15 @@
-+desc "Create a ChangeLog based on git commits."
-+task :changelog do
-+ begin
-+ gitc = %x{which git-changelog}
-+ rescue
-+ puts "This task needs the git-changelog binary - http://github.com/ReinH/git-changelog"
-+ end
-+
-+ CHANGELOG_DIR = "#{Dir.pwd}"
-+ mkdir(CHANGELOG_DIR) unless File.directory?(CHANGELOG_DIR)
-+ change_body = `git-changelog --limit=99999`
-+ File.open(File.join(CHANGELOG_DIR, "CHANGELOG"), 'w') do |f|
-+ f << change_body
-+ end
-+end
-diff --git a/tasks/rake/ci.rake b/tasks/rake/ci.rake
-new file mode 100644
-index 0000000..e0e5aed
---- /dev/null
-+++ b/tasks/rake/ci.rake
-@@ -0,0 +1,16 @@
-+desc "Prep CI RSpec tests"
-+task :ci_prep do
-+ require 'rubygems'
-+ begin
-+ gem 'ci_reporter'
-+ require 'ci/reporter/rake/rspec'
-+ require 'ci/reporter/rake/test_unit'
-+ ENV['CI_REPORTS'] = 'results'
-+ rescue LoadError
-+ puts 'Missing ci_reporter gem. You must have the ci_reporter gem installed to run the CI spec tests'
-+ end
-+end
-+
-+desc "Run the CI RSpec tests"
-+task :ci_spec => [:ci_prep, 'ci:setup:rspec', :spec] do
-+end
-diff --git a/tasks/rake/dailybuild.rake b/tasks/rake/dailybuild.rake
-new file mode 100644
-index 0000000..709bd48
---- /dev/null
-+++ b/tasks/rake/dailybuild.rake
-@@ -0,0 +1,9 @@
-+desc "Create a Facter daily build"
-+task :daily => :changelog do
-+ version = "facter" + "-" + Time.now.localtime.strftime("%Y%m%d")
-+ sh "git archive --format=tar --prefix=#{version}/ HEAD^{tree} >#{version}.tar"
-+ sh "pax -waf #{version}.tar -s ':^:#{version}/:' ChangeLog"
-+ sh "rm ChangeLog"
-+ sh "gzip -f -9 #{version}.tar"
-+end
-+
-diff --git a/tasks/rake/mail_patches.rake b/tasks/rake/mail_patches.rake
-new file mode 100644
-index 0000000..1346faa
---- /dev/null
-+++ b/tasks/rake/mail_patches.rake
-@@ -0,0 +1,48 @@
-+desc "Send patch information to the puppet-dev list"
-+task :mail_patches do
-+ if Dir.glob("00*.patch").length > 0
-+ raise "Patches already exist matching '00*.patch'; clean up first"
-+ end
-+
-+ unless %x{git status} =~ /On branch (.+)/
-+ raise "Could not get branch from 'git status'"
-+ end
-+ branch = $1
-+
-+ unless branch =~ %r{^([^\/]+)/([^\/]+)/([^\/]+)$}
-+ raise "Branch name does not follow <type>/<parent>/<name> model; cannot autodetect parent branch"
-+ end
-+
-+ type, parent, name = $1, $2, $3
-+
-+ # Create all of the patches
-+ sh "git format-patch -C -M -s -n --subject-prefix='PATCH/facter' #{parent}..HEAD"
-+
-+ # Add info to the patches
-+ additional_info = "Local-branch: #{branch}\n"
-+ files = Dir.glob("00*.patch")
-+ files.each do |file|
-+ contents = File.read(file)
-+ contents.sub!(/^---\n/, "---\n#{additional_info}")
-+ File.open(file, 'w') do |file_handle|
-+ file_handle.print contents
-+ end
-+ end
-+
-+ # And then mail them out.
-+
-+ # If we've got more than one patch, add --compose
-+ if files.length > 1
-+ compose = "--compose"
-+ subject = %Q{--subject "#{type} #{name} against #{parent}"}
-+ else
-+ compose = ""
-+ subject = ""
-+ end
-+
-+ # Now send the mail.
-+ sh "git send-email #{compose} #{subject} --no-signed-off-by-cc --suppress-from --to puppet-dev at googlegroups.com 00*.patch"
-+
-+ # Finally, clean up the patches
-+ sh "rm 00*.patch"
-+end
-diff --git a/tasks/rake/metrics.rake b/tasks/rake/metrics.rake
-new file mode 100644
-index 0000000..63af552
---- /dev/null
-+++ b/tasks/rake/metrics.rake
-@@ -0,0 +1,6 @@
-+begin
-+ require 'metric_fu'
-+rescue LoadError
-+ # Metric-fu not installed
-+ # http://metric-fu.rubyforge.org/
-+end
-diff --git a/tasks/rake/sign.rake b/tasks/rake/sign.rake
-new file mode 100644
-index 0000000..f0e9d83
---- /dev/null
-+++ b/tasks/rake/sign.rake
-@@ -0,0 +1,14 @@
-+desc "Sign the package with the Puppet Labs release key"
-+task :sign_packages do
-+
-+version = Facter::FACTERVERSION
-+
-+# Sign package
-+
-+sh "gpg --homedir $HOME/pl_release_key --detach-sign --output pkg/facter-#{version}.tar.gz.sign --armor pkg/facter-#{version}.tar.gz"
-+
-+# Sign gem
-+
-+sh "gpg --homedir $HOME/pl_release_key --detach-sign --output pkg/facter-#{version}.gem.sign --armor pkg/facter-#{version}.gem"
-+
-+end
---
-1.7.6
-
Added: csw/mgar/pkg/facter/trunk/files/0001-puppetlabs-ticket-7038-to-fix-prtdiag.patch
===================================================================
--- csw/mgar/pkg/facter/trunk/files/0001-puppetlabs-ticket-7038-to-fix-prtdiag.patch (rev 0)
+++ csw/mgar/pkg/facter/trunk/files/0001-puppetlabs-ticket-7038-to-fix-prtdiag.patch 2011-07-08 12:45:47 UTC (rev 15008)
@@ -0,0 +1,53 @@
+From cbb45c1b56535bd8782be19ae67d68cba29fe9f4 Mon Sep 17 00:00:00 2001
+From: Mark Phillips <none at none>
+Date: Fri, 8 Jul 2011 14:41:08 +0200
+Subject: [PATCH] puppetlabs ticket 7038 to fix prtdiag
+
+---
+ lib/facter.rb | 2 +-
+ lib/facter/util/manufacturer.rb | 7 ++++---
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/facter.rb b/lib/facter.rb
+index eed32f8..2073b84 100644
+--- a/lib/facter.rb
++++ b/lib/facter.rb
+@@ -24,7 +24,7 @@ module Facter
+ include Comparable
+ include Enumerable
+
+- FACTERVERSION = '1.6.0'
++ FACTERVERSION = '1.5.9'
+ # = Facter
+ # Functions as a hash of 'facts' you might care about about your
+ # system, such as mac address, IP address, Video card, etc.
+diff --git a/lib/facter/util/manufacturer.rb b/lib/facter/util/manufacturer.rb
+index 8e9bde2..33389c9 100644
+--- a/lib/facter/util/manufacturer.rb
++++ b/lib/facter/util/manufacturer.rb
+@@ -1,6 +1,8 @@
+ # mamufacturer.rb
+ # Support methods for manufacturer specific facts
+
++require 'facter/util/prtdiag'
++
+ module Facter::Manufacturer
+
+ def self.get_dmi_table()
+@@ -62,11 +64,10 @@ module Facter::Manufacturer
+ end
+
+ def self.prtdiag_sparc_find_system_info()
+- # Parses prtdiag for a SPARC architecture string, won't work with Solaris x86
+- output = Facter::Util::Resolution.exec('/usr/sbin/prtdiag')
+
++ # Parses prtdiag for a SPARC architecture string, won't work with Solaris x86
+ # System Configuration: Sun Microsystems sun4u Sun SPARC Enterprise M3000 Server
+- sysconfig = output.split("\n")[0]
++ sysconfig = Facter::Util::Prtdiag.system_configuration
+ if sysconfig =~ /^System Configuration:\s+(.+?)\s+(sun\d+\S+)\s+(.+)/ then
+ Facter.add('manufacturer') do
+ setcode do
+--
+1.7.6
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list