facter 1.6.11 → 1.6.12.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of facter might be problematic. Click here for more details.

Files changed (43) hide show
  1. data/CHANGELOG +26 -0
  2. data/Gemfile +14 -0
  3. data/Gemfile.lock +28 -0
  4. data/Rakefile +31 -73
  5. data/ext/build_defaults.yaml +20 -0
  6. data/ext/debian/changelog.erb +71 -0
  7. data/ext/debian/compat +1 -0
  8. data/ext/debian/control +14 -0
  9. data/ext/debian/copyright +19 -0
  10. data/ext/debian/docs +2 -0
  11. data/ext/debian/lintian-overrides +0 -0
  12. data/ext/debian/rules +9 -0
  13. data/ext/debian/source/format +1 -0
  14. data/ext/facter-diff +74 -0
  15. data/{conf → ext}/osx/PackageInfo.plist +0 -0
  16. data/{conf → ext}/osx/createpackage.sh +0 -0
  17. data/ext/osx/file_mapping.yaml +27 -0
  18. data/ext/osx/preflight.erb +30 -0
  19. data/ext/osx/prototype.plist.erb +38 -0
  20. data/ext/packaging/README.md +89 -0
  21. data/ext/packaging/tasks/00_utils.rb +214 -0
  22. data/ext/packaging/tasks/10_setupvars.rake +59 -0
  23. data/ext/packaging/tasks/apple.rake +201 -0
  24. data/ext/packaging/tasks/clean.rake +5 -0
  25. data/ext/packaging/tasks/deb.rake +105 -0
  26. data/ext/packaging/tasks/gem.rake +50 -0
  27. data/ext/packaging/tasks/mock.rake +88 -0
  28. data/ext/packaging/tasks/release.rake +18 -0
  29. data/ext/packaging/tasks/rpm.rake +39 -0
  30. data/ext/packaging/tasks/ship.rake +25 -0
  31. data/ext/packaging/tasks/sign.rake +62 -0
  32. data/ext/packaging/tasks/tar.rake +19 -0
  33. data/ext/project_data.yaml +15 -0
  34. data/{conf/redhat/facter.spec → ext/redhat/facter.spec.erb} +37 -19
  35. data/{conf → ext}/solaris/pkginfo +0 -0
  36. data/lib/facter.rb +2 -6
  37. data/lib/facter/facterversion.rb +5 -2
  38. data/lib/facter/util/ec2.rb +4 -3
  39. data/lib/facter/version.rb +13 -0
  40. data/spec/unit/facter_spec.rb +0 -5
  41. data/spec/unit/util/ec2_spec.rb +16 -0
  42. metadata +370 -200
  43. data/conf/osx/preflight +0 -16
data/CHANGELOG CHANGED
@@ -1,3 +1,29 @@
1
+ 1.6.12rc1
2
+ ===
3
+ 3ad05f1 Remove version test from facter
4
+ fce4b01 fix redhat spec release template variable
5
+ 903b1d9 Stop using sed to generate the preflight erb
6
+ 601a967 Use git read-only packaging repo for public access
7
+ dd3401e Fixup apple packaging
8
+ e0454df Remove libexec from file list as its only in 2.x
9
+ 1e7f5b3 Update debhelper compat to 7, add format
10
+ 6659e61 Fixup redhat spec erb template for f17
11
+ 6752530 Shift to using packaging repo
12
+ fe311c2 Remove obsolete tasks directory
13
+ 900895f Group requires together
14
+ 8c18e33 Move facter redhat spec file to erb
15
+ 84f8e10 Add debian build artifacts to facter project
16
+ d2d3baf Replace rake/gempackagetask with rubygems/gempackagetask
17
+ 6f58b4e Move tasks out of 'rake' subdirectory
18
+ db9d154 Move packaging files to ext, rm conf
19
+ c0cbe62 (#15464) Make Facter.version settable via Facter.version=
20
+ 0b49eae (#15464) Make contributing easy via bundle Gemfile
21
+ bf6ee4f Retabbed conf/redhat/facter.spec to lineup tag contents.
22
+ defbfb8 (#15291) Add Vendor tag to Facter spec file
23
+ 17243bb Update facter redhat spec for fedora 17
24
+ 7ca9122 Update a facter build-requires for f17
25
+ d5d2328 (#11640) Added support for new OpenStack MAC addresses
26
+
1
27
  1.6.11
2
28
  ===
3
29
  f75e46e Add build-requires of ruby-rdoc for manpage generation
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source :rubygems
2
+
3
+ gemspec
4
+
5
+ group(:development, :test) do
6
+ gem "rspec", "~> 2.10.0", :require => false
7
+ gem "mocha", "~> 0.10.5", :require => false
8
+ end
9
+
10
+ if File.exists? "#{__FILE__}.local"
11
+ eval(File.read("#{__FILE__}.local"), binding)
12
+ end
13
+
14
+ # vim:filetype=ruby
@@ -0,0 +1,28 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ facter (1.6.11)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.1.3)
10
+ metaclass (0.0.1)
11
+ mocha (0.10.5)
12
+ metaclass (~> 0.0.1)
13
+ rspec (2.10.0)
14
+ rspec-core (~> 2.10.0)
15
+ rspec-expectations (~> 2.10.0)
16
+ rspec-mocks (~> 2.10.0)
17
+ rspec-core (2.10.1)
18
+ rspec-expectations (2.10.0)
19
+ diff-lcs (~> 1.1.3)
20
+ rspec-mocks (2.10.1)
21
+
22
+ PLATFORMS
23
+ ruby
24
+
25
+ DEPENDENCIES
26
+ facter!
27
+ mocha (~> 0.10.5)
28
+ rspec (~> 2.10.0)
data/Rakefile CHANGED
@@ -1,103 +1,61 @@
1
1
  # Rakefile for facter
2
2
 
3
- $: << File.expand_path('lib')
3
+ # We need access to the Puppet.version method
4
+ $LOAD_PATH.unshift(File.expand_path("lib"))
5
+ require 'facter/version'
6
+
4
7
  $LOAD_PATH << File.join(File.dirname(__FILE__), 'tasks')
5
8
 
6
9
  require 'rubygems'
7
10
  require 'rspec'
8
11
  require 'rspec/core/rake_task'
12
+ require 'rake'
13
+ require 'yaml'
14
+
9
15
  begin
10
16
  require 'rcov'
11
17
  rescue LoadError
12
18
  end
13
19
 
14
20
  Dir['tasks/**/*.rake'].each { |t| load t }
21
+ Dir['ext/packaging/tasks/**/*'].sort.each { |t| load t }
15
22
 
16
- require 'rake'
17
- require 'rake/packagetask'
18
- require 'rake/gempackagetask'
19
-
20
- FILES = FileList[
21
- '[A-Z]*',
22
- 'install.rb',
23
- 'bin/**/*',
24
- 'lib/**/*',
25
- 'conf/**/*',
26
- 'etc/**/*',
27
- 'spec/**/*'
28
- ]
29
-
30
- def get_version
31
- `git describe`.strip
23
+ begin
24
+ @build_defaults ||= YAML.load_file('ext/build_defaults.yaml')
25
+ @packaging_url = @build_defaults['packaging_url']
26
+ @packaging_repo = @build_defaults['packaging_repo']
27
+ rescue
28
+ STDERR.puts "Unable to read the packaging repo info from ext/build_defaults.yaml"
32
29
  end
33
30
 
34
- # :build_environment and :tar are mostly borrowed from puppet-dashboard Rakefile
35
- task :build_environment do
36
- unless ENV['FORCE'] == '1'
37
- modified = `git status --porcelain | sed -e '/^\?/d'`
38
- if modified.split(/\n/).length != 0
39
- puts <<-HERE
40
- !! ERROR: Your git working directory is not clean. You must
41
- !! remove or commit your changes before you can create a package:
42
-
43
- #{`git status | grep '^#'`.chomp}
44
-
45
- !! To override this check, set FORCE=1 -- e.g. `rake package:deb FORCE=1`
46
- HERE
47
- raise
31
+ namespace :package do
32
+ desc "Bootstrap packaging automation, e.g. clone into packaging repo"
33
+ task :bootstrap do
34
+ if File.exist?("ext/#{@packaging_repo}")
35
+ puts "It looks like you already have ext/#{@packaging_repo}. If you don't like it, blow it away with package:implode."
36
+ else
37
+ cd 'ext' do
38
+ %x{git clone #{@packaging_url}}
39
+ end
48
40
  end
49
41
  end
50
- end
51
-
52
- desc "Create a release .tar.gz"
53
- task :tar => :build_environment do
54
- name = "facter"
55
- rm_rf 'pkg/tar'
56
- temp=`mktemp -d -t tmpXXXXXX`.strip!
57
- version = get_version
58
- base = "#{temp}/#{name}-#{version}/"
59
- mkdir_p base
60
- sh "git checkout-index -af --prefix=#{base}"
61
- mkdir_p "pkg/tar"
62
- sh "tar -C #{temp} -pczf #{temp}/#{name}-#{version}.tar.gz #{name}-#{version}"
63
- mv "#{temp}/#{name}-#{version}.tar.gz", "pkg/tar"
64
- rm_rf temp
65
- puts "Tarball is pkg/tar/#{name}-#{version}.tar.gz"
66
- end
67
42
 
68
- spec = Gem::Specification.new do |spec|
69
- spec.platform = Gem::Platform::RUBY
70
- spec.name = 'facter'
71
- spec.files = FILES.to_a
72
- spec.executables = %w{facter}
73
- spec.version = get_version.split('-')[0]
74
- spec.summary = 'Facter, a system inventory tool'
75
- spec.description = 'You can prove anything with facts!'
76
- spec.author = 'Puppet Labs'
77
- spec.email = 'info@puppetlabs.com'
78
- spec.homepage = 'http://puppetlabs.com'
79
- spec.rubyforge_project = 'facter'
80
- spec.has_rdoc = true
81
- spec.rdoc_options <<
82
- '--title' << 'Facter - System Inventory Tool' <<
83
- '--main' << 'README' <<
84
- '--line-numbers'
85
- end
86
- Rake::GemPackageTask.new(spec) do |pkg|
43
+ desc "Remove all cloned packaging automation"
44
+ task :implode do
45
+ rm_rf "ext/#{@packaging_repo}"
46
+ end
87
47
  end
88
48
 
89
- task :package => :tar
90
-
91
49
  task :default do
92
50
  sh %{rake -T}
93
51
  end
94
52
 
95
53
  # Aliases for spec
96
- task :test => [:spec]
97
- task :tests => [:spec]
98
- task :specs => [:spec]
54
+ task :tests => [:test]
55
+ task :specs => [:test]
99
56
 
100
- RSpec::Core::RakeTask.new do |t|
57
+ desc "Run all specs"
58
+ RSpec::Core::RakeTask.new(:test) do |t|
101
59
  t.pattern ='spec/{unit,integration}/**/*_spec.rb'
102
60
  t.fail_on_error = true
103
61
  end
@@ -0,0 +1,20 @@
1
+ ---
2
+ packaging_url: 'git://github.com/puppetlabs/packaging.git --branch=master'
3
+ packaging_repo: 'packaging'
4
+ default_cow: 'base-squeeze-i386.cow'
5
+ cows: 'base-lucid-amd64.cow base-lucid-i386.cow base-natty-amd64.cow base-natty-i386.cow base-oneiric-amd64.cow base-oneiric-i386.cow base-precise-amd64.cow base-precise-i386.cow base-sid-amd64.cow base-sid-i386.cow base-squeeze-amd64.cow base-squeeze-i386.cow base-testing-amd64.cow base-testing-i386.cow base-wheezy-i386.cow'
6
+ pbuild_conf: '/etc/pbuilderrc'
7
+ packager: 'puppetlabs'
8
+ gpg_name: 'info@puppetlabs.com'
9
+ gpg_key: '4BD6EC30'
10
+ sign_tar: TRUE
11
+ # a space separated list of mock configs
12
+ final_mocks: 'pl-5-i386 pl-5-x86_64 pl-6-i386 pl-6-x86_64 fedora-15-i386 fedora-15-x86_64 fedora-16-i386 fedora-16-x86_64 fedora-17-i386 fedora-17-x86_64'
13
+ rc_mocks: 'pl-5-i386-dev pl-5-x86_64-dev pl-6-i386-dev pl-6-x86_64-dev fedora-15-i386-dev fedora-15-x86_64-dev fedora-16-i386-dev fedora-16-x86_64-dev fedora-17-i386-dev fedora-17-x86_64-dev'
14
+ yum_host: 'burji.puppetlabs.com'
15
+ yum_repo_path: '~/repo/'
16
+ build_gem: TRUE
17
+ build_dmg: TRUE
18
+ apt_host: 'burji.puppetlabs.com'
19
+ apt_repo_url: 'http://apt.puppetlabs.com'
20
+ apt_repo_path: '/opt/repository/incoming'
@@ -0,0 +1,71 @@
1
+ facter (<%= @debversion %>) hardy lucid maverick natty oneiric unstable lenny sid wheezy lucid squeeze precise; urgency=low
2
+
3
+ * Update to version <% @debversion %>
4
+
5
+ -- Puppet Labs Release <info@puppetlabs.com> <%= Time.now.strftime("%a, %d %b %Y %H:%M:%S %z")%>
6
+
7
+ facter (2.0.0-0.1rc4puppetlabs1) hardy lucid maverick natty oneiric unstable lenny sid wheezy lucid squeeze precise; urgency=low
8
+
9
+ * Imported upstream 2.0.0rc4.
10
+
11
+ -- Moses Mendoza <moses@puppetlabs.com> Thu, 24 May 2012 17:09:25 +0000
12
+
13
+ facter (2.0.0-0.1rc3puppetlabs1) hardy lucid maverick natty oneiric unstable lenny sid wheezy lucid squeeze precise; urgency=low
14
+
15
+ * Imported upstream 2.0.0rc3.
16
+
17
+ -- Moses Mendoza <moses@puppetlabs.com> Tue, 22 May 2012 11:48:25 +0000
18
+
19
+ facter (2.0.0-0.1rc2puppetlabs1) hardy lucid maverick natty oneiric unstable lenny sid wheezy lucid squeeze precise; urgency=low
20
+
21
+ * Imported upstream 2.0.0rc2.
22
+
23
+ -- Moses Mendoza <moses@puppetlabs.com> Thu, 17 May 2012 13:15:25 +0000
24
+
25
+ facter (2.0.0-0.1rc1puppetlabs1) hardy lucid maverick natty oneiric unstable lenny sid wheezy lucid squeeze precise; urgency=low
26
+
27
+ * Imported upstream 2.0.0rc1. Updated debian/control to include ruby1.9 options.
28
+
29
+ -- Matthaus Litteken <matthaus@puppetlabs.com> Tue, 15 May 2012 23:43:25 +0000
30
+
31
+ facter (1.6.8-1puppetlabs1) hardy lucid maverick natty oneiric unstable lenny sid wheezy lucid squeeze precise; urgency=low
32
+
33
+ * Imported Upstream version 1.6.8
34
+
35
+ -- Moses Mendoza <moses@puppetlabs.com> Mon, 23 Apr 2012 13:11:30 +0000
36
+
37
+ facter (1.6.7-1puppetlabs1) hardy lucid maverick natty oneiric unstable lenny sid wheezy lucid squeeze precise; urgency=low
38
+
39
+ * Imported Upstream version 1.6.7
40
+
41
+ -- Moses Mendoza <moses@puppetlabs.com> Thu, 29 Mar 2012 22:43:30 +0000
42
+
43
+ facter (1.6.6-1puppetlabs1) hardy lucid maverick natty oneiric unstable lenny sid squeeze wheezy precise; urgency=low
44
+
45
+ * (#12436) Adding pciutils as a dependency.
46
+
47
+ -- Matthaus Litteken <matthaus@puppetlabs.com> Fri, 10 Feb 2012 01:49:22 +0000
48
+
49
+ facter (1.6.5-1puppetlabs1) hardy lucid maverick natty oneiric unstable lenny sid squeeze wheezy; urgency=low
50
+
51
+ * Release facter 1.6.5
52
+
53
+ -- Matthaus Litteken <matthaus@puppetlabs.com> Wed, 25 Jan 2012 11:46:48 -0700
54
+
55
+ facter (1.6.4-1puppetlabs1) hardy lucid maverick natty oneiric unstable lenny sid squeeze wheezy; urgency=low
56
+
57
+ * Release facter 1.6.4
58
+
59
+ -- Matthaus Litteken <matthaus@puppetlabs.com> Wed, 7 Dec 2011 13:36:48 -0700
60
+
61
+ facter (1.6.3-1puppetlabs1) hardy lucid maverick natty oneiric unstable lenny sid squeeze wheezy; urgency=low
62
+
63
+ * Initial packaging for facter 1.6.3
64
+
65
+ -- Matthaus Litteken <matthaus@puppetlabs.com> Thu, 10 Nov 2011 11:00:48 -0700
66
+
67
+ facter (1.6.2-1puppet1) hardy lucid maverick natty oneiric unstable lenny sid squeeze wheezy; urgency=low
68
+
69
+ * Initial packaging for facter 1.6.2
70
+
71
+ -- Matthaus Litteken <matthaus@puppetlabs.com> Fri, 21 Oct 2011 11:00:48 -0700
@@ -0,0 +1 @@
1
+ 7
@@ -0,0 +1,14 @@
1
+ Source: facter
2
+ Section: ruby
3
+ Priority: optional
4
+ Maintainer: Puppet Labs <info@puppetlabs.com>
5
+ Build-Depends: cdbs, debhelper (>> 7), ruby1.8 | ruby1.9.1, libopenssl-ruby1.8 | libopenssl-ruby1.9.1
6
+ Standards-Version: 3.9.1
7
+ Homepage: http://www.puppetlabs.com
8
+
9
+ Package: facter
10
+ Architecture: all
11
+ Depends: ${shlibs:Depends}, ${misc:Depends}, ruby1.8 (>= 1.8.5) | ruby1.9.1, libopenssl-ruby1.8 | libopenssl-ruby1.9.1, dmidecode, pciutils
12
+ Description: Ruby module for collecting simple facts about a host operating system
13
+ Some of the facts are preconfigured, such as the hostname and the operating
14
+ system. Additional facts can be added through simple Ruby scripts.
@@ -0,0 +1,19 @@
1
+ This package was debianized by Jacob Helwig <jacob@puppetlabs.com> on
2
+ Sat, 11 Dec 2010 21:11:11 -0800
3
+
4
+ It was downloaded from http://www.puppetlabs.com/
5
+
6
+ Upstream Author:
7
+
8
+ Puppet Labs <info@puppetlabs.com>
9
+
10
+ Copyright:
11
+
12
+ Copyright 2010-2011 Puppet Labs <info@puppetlabs.com>
13
+
14
+ License: ASL-2
15
+ http://www.apache.org/licenses/LICENSE-2.0
16
+
17
+ On a Debian system, the license can be found at
18
+ /usr/share/common-licenses/Apache-2.0 .
19
+
@@ -0,0 +1,2 @@
1
+ CHANGELOG
2
+ README.md
File without changes
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/make -f
2
+
3
+ include /usr/share/cdbs/1/rules/debhelper.mk
4
+ include /usr/share/cdbs/1/rules/buildcore.mk
5
+
6
+ LIBDIR=$(shell /usr/bin/ruby1.8 -rrbconfig -e 'puts Config::CONFIG["rubylibdir"]')
7
+
8
+ binary-install/facter::
9
+ /usr/bin/ruby1.8 install.rb --sitelibdir=$(LIBDIR) --destdir=$(CURDIR)/debian/$(cdbs_curpkg) --quick --no-rdoc
@@ -0,0 +1 @@
1
+ 3.0 (quilt)
@@ -0,0 +1,74 @@
1
+
2
+ #!/usr/bin/env sh
3
+ #
4
+ # Output the difference between a facter command run on two different versions
5
+ # of facter. Uses unified diff format.
6
+
7
+ OPTIONS_SPEC="\
8
+ facter-diff [options] <rev1> <rev2> [fact]...
9
+
10
+ Example:
11
+
12
+ ./ext/facter-diff 1.5.7 1.0.2
13
+
14
+ --
15
+ h,help Display this help"
16
+
17
+ . "$(git --exec-path)/git-sh-setup"
18
+ eval "$(echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)"
19
+ trap 'err=$?; cleanup; exit $err' 0
20
+
21
+ cleanup() {
22
+ test $origin && git checkout -q "$origin"
23
+ }
24
+
25
+ facter() {
26
+ ruby -Ilib bin/facter "$@"
27
+ }
28
+
29
+ log_facter_run() {
30
+ local ref=$1 && shift
31
+ local tmpfile=$1 && shift
32
+
33
+ git checkout -qf "$ref" ||
34
+ die "fatal: unable to checkout $ref"
35
+ facter "$@" > $tmpfile
36
+ }
37
+
38
+ verify_revision() {
39
+ git rev-parse --verify --quiet "$1" > /dev/null ||
40
+ die "fatal: '$1' is not a valid revision"
41
+ }
42
+
43
+ test $1 = "--" && shift # git rev-parse seems to leave the -- in
44
+ test $# -eq 0 && usage
45
+
46
+ test $# -gt 1 ||
47
+ die "fatal: must specify two revisions"
48
+
49
+ status=$(git status -s)
50
+ test -z "$status" ||
51
+ die "fatal: $0 cannot be used with a dirty working copy"
52
+
53
+ origin=$(git rev-parse --symbolic-full-name HEAD)
54
+ test "$origin" = "HEAD" &&
55
+ origin=$(git rev-parse HEAD)
56
+
57
+ test -x "bin/facter" ||
58
+ die "fatal: $0 must be run from the project root"
59
+
60
+ ref1="$1" && shift
61
+ ref2="$1" && shift
62
+
63
+ verify_revision $ref1
64
+ verify_revision $ref2
65
+
66
+ tmpfile1="/tmp/$(basename $0).$$.1.tmp"
67
+ tmpfile2="/tmp/$(basename $0).$$.2.tmp"
68
+
69
+ log_facter_run $ref1 $tmpfile1 $@
70
+ log_facter_run $ref2 $tmpfile2 $@
71
+
72
+ git checkout -f "$origin" > /dev/null 2>&1
73
+
74
+ diff --label "$ref1" --label "$ref2" -u $tmpfile1 $tmpfile2
File without changes
File without changes
@@ -0,0 +1,27 @@
1
+ directories:
2
+ lib:
3
+ path: 'usr/lib/ruby/site_ruby/1.8'
4
+ owner: 'root'
5
+ group: 'wheel'
6
+ perms: '0644'
7
+ bin:
8
+ path: 'usr/bin'
9
+ owner: 'root'
10
+ group: 'wheel'
11
+ perms: '0755'
12
+ facter:
13
+ path: 'var/lib/facter'
14
+ owner: 'root'
15
+ group: 'wheel'
16
+ perms: '0644'
17
+ etc:
18
+ path: 'etc'
19
+ owner: 'root'
20
+ group: 'wheel'
21
+ perms: '0644'
22
+ files:
23
+ '[A-Z]*':
24
+ path: 'usr/share/doc/facter'
25
+ owner: 'root'
26
+ group: 'wheel'
27
+ perms: '0644'