facter 1.6.12 → 1.6.13.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.

data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  Facter - Host Fact Detection and Reporting
2
2
 
3
- Copyright 2011 Puppet Labs Inc
3
+ Copyright 2005-2012 Puppet Labs Inc
4
4
 
5
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
6
  you may not use this file except in compliance with the License.
data/Rakefile CHANGED
@@ -10,7 +10,6 @@ require 'rubygems'
10
10
  require 'rspec'
11
11
  require 'rspec/core/rake_task'
12
12
  require 'rake'
13
- require 'yaml'
14
13
 
15
14
  begin
16
15
  require 'rcov'
@@ -20,29 +19,35 @@ end
20
19
  Dir['tasks/**/*.rake'].each { |t| load t }
21
20
  Dir['ext/packaging/tasks/**/*'].sort.each { |t| load t }
22
21
 
23
- begin
24
- @build_defaults ||= YAML.load_file('ext/build_defaults.yaml')
22
+ build_defs_file = 'ext/build_defaults.yaml'
23
+ if File.exist?(build_defs_file)
24
+ begin
25
+ require 'yaml'
26
+ @build_defaults ||= YAML.load_file(build_defs_file)
27
+ rescue Exception => e
28
+ STDERR.puts "Unable to load yaml from #{build_defs_file}:"
29
+ STDERR.puts e
30
+ end
25
31
  @packaging_url = @build_defaults['packaging_url']
26
32
  @packaging_repo = @build_defaults['packaging_repo']
27
- rescue
28
- STDERR.puts "Unable to read the packaging repo info from ext/build_defaults.yaml"
29
- end
33
+ raise "Could not find packaging url in #{build_defs_file}" if @packaging_url.nil?
34
+ raise "Could not find packaging repo in #{build_defs_file}" if @packaging_repo.nil?
30
35
 
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}}
36
+ namespace :package do
37
+ desc "Bootstrap packaging automation, e.g. clone into packaging repo"
38
+ task :bootstrap do
39
+ if File.exist?("ext/#{@packaging_repo}")
40
+ puts "It looks like you already have ext/#{@packaging_repo}. If you don't like it, blow it away with package:implode."
41
+ else
42
+ cd 'ext' do
43
+ %x{git clone #{@packaging_url}}
44
+ end
39
45
  end
40
46
  end
41
- end
42
-
43
- desc "Remove all cloned packaging automation"
44
- task :implode do
45
- rm_rf "ext/#{@packaging_repo}"
47
+ desc "Remove all cloned packaging automation"
48
+ task :implode do
49
+ rm_rf "ext/#{@packaging_repo}"
50
+ end
46
51
  end
47
52
  end
48
53
 
@@ -2,12 +2,12 @@
2
2
  packaging_url: 'git://github.com/puppetlabs/packaging.git --branch=master'
3
3
  packaging_repo: 'packaging'
4
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'
5
+ cows: 'base-lucid-i386.cow base-natty-i386.cow base-oneiric-i386.cow base-precise-i386.cow base-sid-i386.cow base-squeeze-i386.cow base-stable-i386.cow base-testing-i386.cow base-unstable-i386.cow base-wheezy-i386.cow'
6
6
  pbuild_conf: '/etc/pbuilderrc'
7
7
  packager: 'puppetlabs'
8
8
  gpg_name: 'info@puppetlabs.com'
9
9
  gpg_key: '4BD6EC30'
10
- sign_tar: TRUE
10
+ sign_tar: FALSE
11
11
  # a space separated list of mock configs
12
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
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'
@@ -18,3 +18,6 @@ build_dmg: TRUE
18
18
  apt_host: 'burji.puppetlabs.com'
19
19
  apt_repo_url: 'http://apt.puppetlabs.com'
20
20
  apt_repo_path: '/opt/repository/incoming'
21
+ ips_repo: '/var/pkgrepo'
22
+ ips_store: '/opt/repository'
23
+ ips_host: 'solaris-11-ips-repo.acctest.dc1.puppetlabs.net'
@@ -2,13 +2,13 @@ Source: facter
2
2
  Section: ruby
3
3
  Priority: optional
4
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
5
+ Build-Depends: cdbs, debhelper (>> 7), ruby | ruby-interpreter, libopenssl-ruby | libopenssl-ruby1.8 | libopenssl-ruby1.9.1, rdoc
6
6
  Standards-Version: 3.9.1
7
7
  Homepage: http://www.puppetlabs.com
8
8
 
9
9
  Package: facter
10
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
11
+ Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter, libopenssl-ruby | libopenssl-ruby1.8 | libopenssl-ruby1.9.1, dmidecode, pciutils
12
12
  Description: Ruby module for collecting simple facts about a host operating system
13
13
  Some of the facts are preconfigured, such as the hostname and the operating
14
14
  system. Additional facts can be added through simple Ruby scripts.
@@ -1,2 +1 @@
1
- CHANGELOG
2
1
  README.md
@@ -3,7 +3,8 @@
3
3
  include /usr/share/cdbs/1/rules/debhelper.mk
4
4
  include /usr/share/cdbs/1/rules/buildcore.mk
5
5
 
6
- LIBDIR=$(shell /usr/bin/ruby1.8 -rrbconfig -e 'puts Config::CONFIG["rubylibdir"]')
6
+ LIBDIR=$(shell /usr/bin/ruby -rrbconfig -e 'puts RbConfig::CONFIG["vendordir"]')
7
+ BINDIR=$(shell /usr/bin/ruby -rrbconfig -e 'puts RbConfig::CONFIG["bindir"]')
7
8
 
8
9
  binary-install/facter::
9
- /usr/bin/ruby1.8 install.rb --sitelibdir=$(LIBDIR) --destdir=$(CURDIR)/debian/$(cdbs_curpkg) --quick --no-rdoc
10
+ /usr/bin/ruby install.rb --sitelibdir=$(LIBDIR) --bindir=$(BINDIR) --ruby=/usr/bin/ruby --destdir=$(CURDIR)/debian/$(cdbs_curpkg) --quick
@@ -0,0 +1,10 @@
1
+ set name=pkg.fmri value=pkg://puppetlabs.com/application/<%=@name%>@<%=@ipsversion%>
2
+ set name=pkg.summary value="<%=@summary%>"
3
+ set name=pkg.human-version value="<%=@version%>"
4
+ set name=pkg.description value="<%=@description%>"
5
+ set name=info.classification value="org.opensolaris.category.2008:Applications/System Utilities"
6
+ set name=org.opensolaris.consolidation value="puppet"
7
+ set name=description value="<%=@description%>"
8
+ set name=variant.opensolaris.zone value=global value=nonglobal
9
+ set name=variant.arch value=sparc value=i386
10
+ license facter.license license="Apache v2.0"
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/make -f
2
+
3
+ LIBDIR=$(shell /usr/bin/ruby18 -rrbconfig -e 'puts Config::CONFIG["rubylibdir"]')
4
+ DESTDIR=$(CURDIR)/pkg/ips/proto
5
+
6
+ binary-install/facter::
7
+ /usr/bin/ruby18 install.rb --destdir=$(DESTDIR) --bindir=/usr/bin --sbindir=/usr/sbin --sitelibdir=$(LIBDIR) --mandir=/usr/share/man
@@ -0,0 +1,18 @@
1
+ <transform file dir link hardlink path=usr/share/man/.+(/.+)? -> default facet.doc.man true>
2
+ <transform file path=usr/share/man/.+(/.+)? -> add restart_fmri svc:/application/man-index:default>
3
+
4
+ # drop user
5
+ <transform dir path=usr$->drop>
6
+ <transform dir path=usr/bin$->drop>
7
+ <transform dir path=usr/sbin$->drop>
8
+ <transform dir path=usr/share$->drop>
9
+ <transform dir path=usr/share/man$->drop>
10
+ <transform dir path=usr/ruby$->drop>
11
+ <transform dir path=usr/ruby/1.8$->drop>
12
+ <transform dir path=usr/ruby/1.8/lib$->drop>
13
+ <transform dir path=usr/ruby/1.8/lib/ruby$->drop>
14
+ <transform dir path=usr/ruby/1.8/lib/ruby/1.8$->drop>
15
+
16
+
17
+ # saner dependencies
18
+ <transform depend -> edit fmri "@[^ \t\n\r\f\v]*" "">
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <pkg-info version="1.0">
3
+ <plist version="1.0">
4
4
  <dict>
5
5
  <key>CFBundleIdentifier</key>
6
6
  <string><%= @title %></string>
@@ -35,4 +35,4 @@
35
35
  <key>IFPkgFlagUpdateInstalledLanguages</key>
36
36
  <false/>
37
37
  </dict>
38
- </pkg-info>
38
+ </plist>
@@ -0,0 +1,117 @@
1
+ ## Create self signed certificate
2
+
3
+ - Generate the key pair
4
+
5
+ | keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048
6
+
7
+
8
+ - Extract Certificate
9
+
10
+ | keytool -export -rfc -keystore keystore.jks -storepass password -alias selfsigned -file mycert.pem
11
+
12
+ - Extract Cert Key to PEM format
13
+
14
+ | keytool -importkeystore -srcstoretype JKS -srckeystore keystore.jks -deststoretype PKCS12 -destkeystore mykey.der
15
+ | openssl pkcs12 -in mykey.der -nodes -out mykey.pem
16
+
17
+ ## For installation.
18
+
19
+ - Check the publishers
20
+
21
+ | pkg publisher
22
+ solaris origin online http://pkg.oracle.com/solaris/release/
23
+
24
+ - Add puppetlabs.com as a publisher
25
+
26
+ | pkg set-publisher -p http://solaris-11-ips-repo.acctest.dc1.puppetlabs.net puppetlabs.com
27
+
28
+ - Check that we have it correct
29
+
30
+ | pkg publisher
31
+ solaris origin online http://pkg.oracle.com/solaris/release/
32
+ puppetlabs.com origin online http://solaris-11-ips-repo.acctest.dc1.puppetlabs.net/
33
+
34
+ - Verify that puppetlabs.com was set correctly,
35
+
36
+ | pkg publisher puppetlabs.com
37
+ Publisher: puppetlabs.com
38
+ Alias:
39
+ Origin URI: http://solaris-11-ips-repo.acctest.dc1.puppetlabs.net/
40
+ SSL Key: None
41
+ SSL Cert: None
42
+ Client UUID: 37084c4a-fdc6-11e1-832b-8800273bd610
43
+ Catalog Updated: September 13, 2012 08:31:25 PM
44
+ Enabled: Yes
45
+ Signature Policy: verify
46
+
47
+ - Try installing puppet
48
+
49
+ | pkg install puppet
50
+ Creating Plan |
51
+ pkg install: Chain was rooted in an untrusted self-signed certificate.
52
+ The package involved is:pkg://puppetlabs.com/system/management/puppet@3.0.0,5.11-6.192:20120913T212942Z
53
+
54
+ - We have two choices here, first, to ignore the signature policy for both publisher and image
55
+
56
+ | pkg set-publisher --set-property=signature-policy=ignore puppetlabs.com
57
+ | pkg publisher puppetlabs.com
58
+ Publisher: puppetlabs.com
59
+ Alias:
60
+ Origin URI: http://solaris-11-ips-repo.acctest.dc1.puppetlabs.net/
61
+ SSL Key: None
62
+ SSL Cert: None
63
+ Client UUID: 140bb5c8-fe62-11e1-af70-8800273bd610
64
+ Catalog Updated: September 14, 2012 05:11:45 PM
65
+ Enabled: Yes
66
+ Signature Policy: ignore
67
+ | pkg set-property signature-policy ignore
68
+ | pkg install puppet
69
+
70
+ - Or trust the self signed certificate from puppetlabs.com (this certificate needs to be published in our web site)
71
+
72
+ | pkg set-publisher --approve-ca-cert /root/mycert.pem puppetlabs.com
73
+
74
+ - Verify that approve cert went well.
75
+
76
+ | pkg publisher puppetlabs.com
77
+
78
+ Publisher: puppetlabs.com
79
+ Alias:
80
+ Origin URI: http://solaris-11-ips-repo.acctest.dc1.puppetlabs.net/
81
+ SSL Key: None
82
+ SSL Cert: None
83
+ Client UUID: 37084c4a-fdc6-11e1-832b-8800273bd610
84
+ Catalog Updated: September 13, 2012 08:31:25 PM
85
+ Approved CAs: 791b5791a81e9c2eb3fb9f84f4f86f8ea6fcd672
86
+ Enabled: Yes
87
+ Signature Policy: verify
88
+
89
+ | pkg install puppet
90
+
91
+ - Checking about information on the package (See the human readable version string)
92
+
93
+ | pkg info -r puppet
94
+ Name: system/management/puppet
95
+ Summary: Puppet, an automated configuration management tool
96
+ Description: Puppet, an automated configuration management tool
97
+ Category: System/Administration and Configuration
98
+ State: Not installed
99
+ Publisher: puppetlabs.com
100
+ Version: 3.0.0 (3.0.0-rc6)
101
+ Build Release: 5.11
102
+ Branch: 6.170
103
+ Packaging Date: September 14, 2012 06:11:05 PM
104
+ Size: 2.43 MB
105
+ FMRI: pkg://puppetlabs.com/system/management/puppet@3.0.0,5.11-6.170:20120914T181105Z
106
+
107
+ - Check license
108
+
109
+ | pkg info -r --license puppet
110
+ Puppet - Automating Configuration Management.
111
+
112
+ Copyright (C) 2005-2012 Puppet Labs Inc
113
+
114
+
115
+ - Reference
116
+
117
+ http://docs.oracle.com/cd/E19963-01/html/820-6572/managepkgs.html
@@ -107,16 +107,10 @@ end
107
107
 
108
108
  def get_ips_version
109
109
  if File.exists?('.git')
110
- desc = %x{git describe}.chomp
110
+ desc = %x{git describe}.chomp.split(/[.-]/)
111
+ commits = %x{git log --oneline --no-merges | wc -l}.chomp.strip
111
112
  osrelease = %x{uname -r}.chomp
112
- varr = desc.gsub(/[a-zA-Z]+/,' ').split(' ')
113
- ver = varr[0].gsub('-', '')
114
- res = case varr[1]
115
- when /(\d+)-(\d+)/ # rcX-build
116
- "#{ver},#{osrelease}-#{$1}.#{$2}"
117
- else
118
- "#{ver},#{osrelease}"
119
- end
113
+ "%s.%s.%s,#{osrelease}-%s" % [ desc[0],desc[1], desc[2], commits]
120
114
  else
121
115
  get_pwd_version
122
116
  end
@@ -240,3 +234,49 @@ def x(v)
240
234
  print %x[#{v}]
241
235
  end
242
236
 
237
+ def ask_yes_or_no
238
+ answer = STDIN.gets.downcase.chomp
239
+ return TRUE if answer =~ /^y$|^yes$/
240
+ return FALSE if answer =~ /^n$|^no$/
241
+ puts "Nope, try something like yes or no or y or n, etc:"
242
+ ask_yes_or_no
243
+ end
244
+
245
+ def handle_method_failure(method, args)
246
+ STDERR.puts "There was an error running the method #{method} with the arguments:"
247
+ args.each { |param, arg| STDERR.puts "\t#{param} => #{arg}\n" }
248
+ STDERR.puts "The rake session is paused. Would you like to retry #{method} with these args and continue where you left off? [y,n]"
249
+ if ask_yes_or_no
250
+ send(method, args)
251
+ else
252
+ exit 1
253
+ end
254
+ end
255
+
256
+ def invoke_task(task, args=nil)
257
+ Rake::Task[task].reenable
258
+ Rake::Task[task].invoke(args)
259
+ end
260
+
261
+ def confirm_ship(files)
262
+ STDOUT.puts "The following files have been built and are ready to ship:"
263
+ files.each { |file| STDOUT.puts "\t#{file}\n" }
264
+ STDOUT.puts "Ship these files??"
265
+ ask_yes_or_no
266
+ end
267
+
268
+ def boolean_value(var)
269
+ return TRUE if (var == TRUE || ( var.is_a?(String) && var.downcase == 'true' ))
270
+ FALSE
271
+ end
272
+
273
+ def git_tag(version)
274
+ begin
275
+ sh "git tag -s -u #{@gpg_key} -m '#{version}' #{version}"
276
+ rescue Exception => e
277
+ STDERR.puts e
278
+ STDERR.puts "Unable to tag repo at #{version}"
279
+ exit 1
280
+ end
281
+ end
282
+
@@ -25,24 +25,29 @@ rescue
25
25
  end
26
26
 
27
27
  begin
28
- @pkg_defaults ||= YAML.load_file('ext/build_defaults.yaml')
29
- @default_cow = ENV['COW'] || @pkg_defaults['default_cow']
30
- @cows = ENV['COW'] || @pkg_defaults['cows']
31
- @pbuild_conf = ENV['PBUILDCONF'] || @pkg_defaults['pbuild_conf']
32
- @packager = ENV['PACKAGER'] || @pkg_defaults['packager']
33
- @sign_tar = ENV['SIGN_TAR'] || @pkg_defaults['sign_tar']
34
- @final_mocks = ENV['MOCK'] || @pkg_defaults['final_mocks']
35
- @rc_mocks = ENV['MOCK'] || @pkg_defaults['rc_mocks']
36
- @gpg_name = ENV['GPG_NAME'] || @pkg_defaults['gpg_name']
37
- @gpg_key = ENV['GPG_KEY'] || @pkg_defaults['gpg_key']
38
- @build_gem = ENV['GEM'] || @pkg_defaults['build_gem']
39
- @build_dmg = ENV['DMG'] || @pkg_defaults['build_dmg']
40
- @yum_host = @pkg_defaults['yum_host']
41
- @yum_repo_path = @pkg_defaults['yum_repo_path']
42
- @apt_host = @pkg_defaults['apt_host']
43
- @apt_repo_url = @pkg_defaults['apt_repo_url']
44
- @apt_repo_path = @pkg_defaults['apt_repo_path']
45
- @ips_repo = @pkg_defaults['ips_repo']
28
+ @pkg_defaults ||= YAML.load_file('ext/build_defaults.yaml')
29
+ @sign_tar = boolean_value( ENV['SIGN_TAR'] || @pkg_defaults['sign_tar'] )
30
+ @build_gem = boolean_value( ENV['GEM'] || @pkg_defaults['build_gem'] )
31
+ @build_dmg = boolean_value( ENV['DMG'] || @pkg_defaults['build_dmg'] )
32
+ @build_ips = boolean_value( ENV['IPS'] || @pkg_defaults['build_ips'] )
33
+ @default_cow = ENV['COW'] || @pkg_defaults['default_cow']
34
+ @cows = ENV['COW'] || @pkg_defaults['cows']
35
+ @pbuild_conf = ENV['PBUILDCONF'] || @pkg_defaults['pbuild_conf']
36
+ @packager = ENV['PACKAGER'] || @pkg_defaults['packager']
37
+ @final_mocks = ENV['MOCK'] || @pkg_defaults['final_mocks']
38
+ @rc_mocks = ENV['MOCK'] || @pkg_defaults['rc_mocks']
39
+ @gpg_name = ENV['GPG_NAME'] || @pkg_defaults['gpg_name']
40
+ @gpg_key = ENV['GPG_KEY'] || @pkg_defaults['gpg_key']
41
+ @certificate_pem = ENV['CERT_PEM'] || @pkg_defaults['certificate_pem']
42
+ @privatekey_pem = ENV['PRIVATE_PEM'] || @pkg_defaults['privatekey_pem']
43
+ @yum_host = @pkg_defaults['yum_host']
44
+ @yum_repo_path = @pkg_defaults['yum_repo_path']
45
+ @apt_host = @pkg_defaults['apt_host']
46
+ @apt_repo_url = @pkg_defaults['apt_repo_url']
47
+ @apt_repo_path = @pkg_defaults['apt_repo_path']
48
+ @ips_repo = @pkg_defaults['ips_repo']
49
+ @ips_store = @pkg_defaults['ips_store']
50
+ @ips_host = @pkg_defaults['ips_host']
46
51
  rescue
47
52
  STDERR.puts "There was an error loading the packaging defaults from the 'ext/build_defaults.yaml' file."
48
53
  exit 1
@@ -32,7 +32,7 @@ task :setup do
32
32
  @package_minor_version = @version.split('.')[1] +
33
33
  @version.split('.')[2].split('-')[0].split('rc')[0]
34
34
  @pm_restart = 'None'
35
- @build_date = timestamp
35
+ @build_date = Time.new.strftime("%Y-%m-%dT%H:%M:%SZ")
36
36
  @apple_bindir = '/usr/bin'
37
37
  @apple_sbindir = '/usr/sbin'
38
38
  @apple_libdir = '/usr/lib/ruby/site_ruby/1.8'
@@ -81,7 +81,7 @@ def build_dmg
81
81
  dmg_file = "#{@title}.dmg"
82
82
  package_file = "#{@title}.pkg"
83
83
  pm_extra_args = '--verbose --no-recommend --no-relocate'
84
- package_target_os = '10.5'
84
+ package_target_os = '10.4'
85
85
 
86
86
  # Build .pkg file
87
87
  system("sudo #{PACKAGEMAKER} --root #{@working_tree['working']} \
@@ -182,7 +182,7 @@ def pack_source
182
182
  end
183
183
  end
184
184
 
185
- if @build_dmg or @build_dmg == 'TRUE' or @build_dmg == 'true'
185
+ if @build_dmg
186
186
  namespace :package do
187
187
  desc "Task for building an Apple Package"
188
188
  task :apple => [:setup] do
@@ -5,17 +5,18 @@ def pdebuild args
5
5
  set_cow_envs(cow)
6
6
  begin
7
7
  sh "pdebuild --configfile #{@pbuild_conf} --buildresult #{results_dir} --pbuilder cowbuilder -- --override-config --othermirror=\"deb #{@apt_repo_url} #{ENV['DIST']} main dependencies #{devel_repo}\" --basepath /var/cache/pbuilder/#{cow}/"
8
- rescue
9
- STDERR.puts "Something went wrong. Hopefully the backscroll or #{results_dir}/#{@name}_#{@debversion}.build file has a clue."
10
- exit 1
8
+ rescue Exception => e
9
+ puts e
10
+ handle_method_failure('pdebuild', args)
11
11
  end
12
12
  end
13
13
 
14
14
  def update_cow(cow, is_rc = nil)
15
15
  ENV['FOSS_DEVEL'] = is_rc
16
+ ENV['PATH'] = "/usr/sbin:#{ENV['PATH']}"
16
17
  set_cow_envs(cow)
17
18
  begin
18
- sh "sudo cowbuilder --update --override-config --configfile #{@pbuild_conf} --basepath /var/cache/pbuilder/#{cow} --distribution #{ENV['DIST']} --architecture #{ENV['ARCH']}"
19
+ sh "sudo -E /usr/sbin/cowbuilder --update --override-config --configfile #{@pbuild_conf} --basepath /var/cache/pbuilder/#{cow} --distribution #{ENV['DIST']} --architecture #{ENV['ARCH']}"
19
20
  rescue
20
21
  STDERR.puts "Couldn't update the cow #{cow}. Perhaps you don't have sudo?"
21
22
  exit 1
@@ -49,19 +50,16 @@ task :build_deb, :deb_command, :cow, :devel do |t,args|
49
50
  work_dir = get_temp
50
51
  dest_dir = "#{@build_root}/pkg/deb/#{cow.split('-')[1] unless cow.nil?}"
51
52
  check_tool(deb_build)
53
+ update_cow(cow)
52
54
  mkdir_p dest_dir
53
55
  deb_args = { :work_dir => work_dir, :cow => cow, :devel => devel}
54
56
  Rake::Task[:prep_deb_tars].reenable
55
57
  Rake::Task[:prep_deb_tars].invoke(work_dir)
56
58
  cd "#{work_dir}/#{@name}-#{@debversion}" do
57
59
  mv 'ext/debian', '.'
58
- begin
59
- send(deb_build, deb_args)
60
- cp FileList["#{work_dir}/*.deb", "#{work_dir}/*.dsc", "#{work_dir}/*.changes", "#{work_dir}/*.debian.tar.gz", "#{work_dir}/*.orig.tar.gz"], dest_dir
61
- rm_rf "#{work_dir}/#{@name}-#{@debversion}"
62
- rescue
63
- STDERR.puts "Something went wrong. Hopefully the backscroll or #{work_dir}/#{@name}_#{@debversion}.build file has a clue."
64
- end
60
+ send(deb_build, deb_args)
61
+ cp FileList["#{work_dir}/*.deb", "#{work_dir}/*.dsc", "#{work_dir}/*.changes", "#{work_dir}/*.debian.tar.gz", "#{work_dir}/*.orig.tar.gz"], dest_dir
62
+ rm_rf "#{work_dir}/#{@name}-#{@debversion}"
65
63
  rm_rf work_dir
66
64
  end
67
65
  end