puppet 2.7.22 → 2.7.23
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/CHANGELOG +21 -0
- data/Rakefile +0 -2
- data/ext/build_defaults.yaml +1 -1
- data/ext/packaging/README.md +88 -33
- data/ext/packaging/packaging.rake +45 -0
- data/ext/packaging/spec/tasks/build_object_spec.rb +2 -0
- data/ext/packaging/tasks/00_utils.rake +94 -54
- data/ext/packaging/tasks/10_setupvars.rake +40 -28
- data/ext/packaging/tasks/apple.rake +20 -27
- data/ext/packaging/tasks/build.rake +3 -8
- data/ext/packaging/tasks/deb.rake +12 -36
- data/ext/packaging/tasks/deb_repos.rake +28 -36
- data/ext/packaging/tasks/fetch.rake +1 -2
- data/ext/packaging/tasks/jenkins.rake +22 -56
- data/ext/packaging/tasks/jenkins_dynamic.rake +111 -0
- data/ext/packaging/tasks/mock.rake +101 -56
- data/ext/packaging/tasks/pe_deb.rake +5 -7
- data/ext/packaging/tasks/pe_remote.rake +30 -42
- data/ext/packaging/tasks/pe_rpm.rake +3 -11
- data/ext/packaging/tasks/pe_ship.rake +14 -18
- data/ext/packaging/tasks/pe_sign.rake +11 -0
- data/ext/packaging/tasks/pe_tar.rake +1 -1
- data/ext/packaging/tasks/release.rake +0 -6
- data/ext/packaging/tasks/remote_build.rake +1 -13
- data/ext/packaging/tasks/retrieve.rake +1 -1
- data/ext/packaging/tasks/rpm.rake +15 -10
- data/ext/packaging/tasks/rpm_repos.rake +45 -56
- data/ext/packaging/tasks/ship.rake +46 -37
- data/ext/packaging/tasks/sign.rake +22 -14
- data/ext/packaging/tasks/tar.rake +1 -1
- data/ext/packaging/tasks/template.rake +1 -1
- data/ext/packaging/templates/README +1 -0
- data/ext/packaging/templates/downstream.xml.erb +32 -0
- data/ext/packaging/templates/packaging.xml.erb +182 -0
- data/ext/packaging/templates/repo.xml.erb +93 -0
- data/lib/puppet.rb +2 -0
- data/lib/puppet/file_system.rb +3 -0
- data/lib/puppet/file_system/path_pattern.rb +97 -0
- data/lib/puppet/module.rb +25 -4
- data/lib/puppet/module_tool/applications/unpacker.rb +5 -1
- data/lib/puppet/parser/files.rb +20 -15
- data/lib/puppet/parser/parser_support.rb +10 -1
- data/lib/puppet/parser/type_loader.rb +48 -28
- data/lib/puppet/version.rb +1 -1
- data/spec/unit/file_system/path_pattern_spec.rb +139 -0
- data/spec/unit/module_spec.rb +8 -1
- data/spec/unit/module_tool/applications/unpacker_spec.rb +6 -0
- data/spec/unit/parser/files_spec.rb +6 -67
- data/spec/unit/parser/parser_spec.rb +15 -5
- data/spec/unit/parser/type_loader_spec.rb +14 -33
- data/spec/unit/resource/type_collection_spec.rb +39 -55
- metadata +11 -5
- data/Gemfile.lock +0 -44
- data/ext/packaging/tasks/pe_sles.rake +0 -101
- data/ext/packaging/tasks/pre_tasks.rake +0 -0
@@ -32,11 +32,21 @@ describe Puppet::Parser do
|
|
32
32
|
parser.known_resource_types.should equal(rtc)
|
33
33
|
end
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
context "when importing" do
|
36
|
+
it "uses the directory of the currently parsed file" do
|
37
|
+
@parser.lexer.stubs(:file).returns "/tmp/current_file"
|
38
|
+
|
39
|
+
@parser.known_resource_types.loader.expects(:import).with("newfile", "/tmp")
|
40
|
+
|
41
|
+
@parser.import("newfile")
|
42
|
+
end
|
43
|
+
|
44
|
+
it "uses the current working directory, when there is no file being parsed" do
|
45
|
+
@parser.known_resource_types.loader.expects(:import).with('one', Dir.pwd)
|
46
|
+
@parser.known_resource_types.loader.expects(:import).with('two', Dir.pwd)
|
47
|
+
|
48
|
+
@parser.parse("import 'one', 'two'")
|
49
|
+
end
|
40
50
|
end
|
41
51
|
|
42
52
|
describe "when parsing files" do
|
@@ -31,8 +31,8 @@ describe Puppet::Parser::TypeLoader do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
it "should attempt to import each generated name" do
|
34
|
-
@loader.expects(:
|
35
|
-
@loader.expects(:
|
34
|
+
@loader.expects(:import_from_modules).with("foo/bar", anything).returns([])
|
35
|
+
@loader.expects(:import_from_modules).with("foo", anything).returns([])
|
36
36
|
@loader.try_load_fqname(:hostclass, "foo::bar") { |f| false }
|
37
37
|
end
|
38
38
|
end
|
@@ -45,50 +45,30 @@ describe Puppet::Parser::TypeLoader do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
it "should return immediately when imports are being ignored" do
|
48
|
-
Puppet::Parser::Files.expects(:
|
48
|
+
Puppet::Parser::Files.expects(:find_manifests_in_modules).never
|
49
49
|
Puppet[:ignoreimport] = true
|
50
|
-
@loader.import("foo").should be_nil
|
50
|
+
@loader.import("foo", "/path").should be_nil
|
51
51
|
end
|
52
52
|
|
53
53
|
it "should find all manifests matching the file or pattern" do
|
54
|
-
Puppet::Parser::Files.expects(:
|
55
|
-
@loader.import("myfile")
|
56
|
-
end
|
57
|
-
|
58
|
-
it "should use the directory of the current file if one is set" do
|
59
|
-
Puppet::Parser::Files.expects(:find_manifests).with { |pat, opts| opts[:cwd] == make_absolute("/current") }.returns ["modname", %w{one}]
|
60
|
-
@loader.import("myfile", make_absolute("/current/file"))
|
54
|
+
Puppet::Parser::Files.expects(:find_manifests_in_modules).with("myfile", anything).returns ["modname", %w{one}]
|
55
|
+
@loader.import("myfile", "/path")
|
61
56
|
end
|
62
57
|
|
63
58
|
it "should pass the environment when looking for files" do
|
64
|
-
Puppet::Parser::Files.expects(:
|
65
|
-
@loader.import("myfile")
|
59
|
+
Puppet::Parser::Files.expects(:find_manifests_in_modules).with(anything, @loader.environment).returns ["modname", %w{one}]
|
60
|
+
@loader.import("myfile", "/path")
|
66
61
|
end
|
67
62
|
|
68
63
|
it "should fail if no files are found" do
|
69
|
-
Puppet::Parser::Files.expects(:
|
70
|
-
lambda { @loader.import("myfile") }.should raise_error(Puppet::ImportError)
|
64
|
+
Puppet::Parser::Files.expects(:find_manifests_in_modules).returns [nil, []]
|
65
|
+
lambda { @loader.import("myfile", "/path") }.should raise_error(Puppet::ImportError)
|
71
66
|
end
|
72
67
|
|
73
68
|
it "should parse each found file" do
|
74
|
-
Puppet::Parser::Files.expects(:
|
69
|
+
Puppet::Parser::Files.expects(:find_manifests_in_modules).returns ["modname", [make_absolute("/one")]]
|
75
70
|
@loader.expects(:parse_file).with(make_absolute("/one")).returns(Puppet::Parser::AST::Hostclass.new(''))
|
76
|
-
@loader.import("myfile")
|
77
|
-
end
|
78
|
-
|
79
|
-
it "should make each file qualified before attempting to parse it" do
|
80
|
-
Puppet::Parser::Files.expects(:find_manifests).returns ["modname", %w{one}]
|
81
|
-
@loader.expects(:parse_file).with(make_absolute("/current/one")).returns(Puppet::Parser::AST::Hostclass.new(''))
|
82
|
-
@loader.import("myfile", make_absolute("/current/file"))
|
83
|
-
end
|
84
|
-
|
85
|
-
it "should not attempt to import files that have already been imported" do
|
86
|
-
Puppet::Parser::Files.expects(:find_manifests).returns ["modname", %w{/one}]
|
87
|
-
Puppet::Parser::Parser.any_instance.expects(:parse).once.returns(Puppet::Parser::AST::Hostclass.new(''))
|
88
|
-
@loader.import("myfile")
|
89
|
-
|
90
|
-
# This will fail if it tries to reimport the file.
|
91
|
-
@loader.import("myfile")
|
71
|
+
@loader.import("myfile", "/path")
|
92
72
|
end
|
93
73
|
end
|
94
74
|
|
@@ -209,10 +189,11 @@ describe Puppet::Parser::TypeLoader do
|
|
209
189
|
end
|
210
190
|
end
|
211
191
|
|
192
|
+
|
212
193
|
it "should be able to add classes to the current resource type collection" do
|
213
194
|
file = tmpfile("simple_file.pp")
|
214
195
|
File.open(file, "w") { |f| f.puts "class foo {}" }
|
215
|
-
@loader.import(file)
|
196
|
+
@loader.import(File.basename(file), File.dirname(file))
|
216
197
|
|
217
198
|
@loader.known_resource_types.hostclass("foo").should be_instance_of(Puppet::Resource::Type)
|
218
199
|
end
|
@@ -55,6 +55,14 @@ describe Puppet::Resource::TypeCollection do
|
|
55
55
|
@code.node("foo").should equal(node)
|
56
56
|
end
|
57
57
|
|
58
|
+
it "should fail if a duplicate node is added" do
|
59
|
+
@code.add(Puppet::Resource::Type.new(:node, "foo"))
|
60
|
+
|
61
|
+
expect do
|
62
|
+
@code.add(Puppet::Resource::Type.new(:node, "foo"))
|
63
|
+
end.to raise_error(Puppet::ParseError, /cannot redefine/)
|
64
|
+
end
|
65
|
+
|
58
66
|
it "should store hostclasses as hostclasses" do
|
59
67
|
klass = Puppet::Resource::Type.new(:hostclass, "foo")
|
60
68
|
|
@@ -62,6 +70,16 @@ describe Puppet::Resource::TypeCollection do
|
|
62
70
|
@code.hostclass("foo").should equal(klass)
|
63
71
|
end
|
64
72
|
|
73
|
+
it "merge together hostclasses of the same name" do
|
74
|
+
klass1 = Puppet::Resource::Type.new(:hostclass, "foo", :doc => "first")
|
75
|
+
klass2 = Puppet::Resource::Type.new(:hostclass, "foo", :doc => "second")
|
76
|
+
|
77
|
+
@code.add(klass1)
|
78
|
+
@code.add(klass2)
|
79
|
+
|
80
|
+
@code.hostclass("foo").doc.should == "firstsecond"
|
81
|
+
end
|
82
|
+
|
65
83
|
it "should store definitions as definitions" do
|
66
84
|
define = Puppet::Resource::Type.new(:definition, "foo")
|
67
85
|
|
@@ -69,13 +87,12 @@ describe Puppet::Resource::TypeCollection do
|
|
69
87
|
@code.definition("foo").should equal(define)
|
70
88
|
end
|
71
89
|
|
72
|
-
it "should
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
loader.add(second)
|
90
|
+
it "should fail if a duplicate definition is added" do
|
91
|
+
@code.add(Puppet::Resource::Type.new(:definition, "foo"))
|
92
|
+
|
93
|
+
expect do
|
94
|
+
@code.add(Puppet::Resource::Type.new(:definition, "foo"))
|
95
|
+
end.to raise_error(Puppet::ParseError, /cannot be redefined/)
|
79
96
|
end
|
80
97
|
|
81
98
|
it "should remove all nodes, classes, and definitions when cleared" do
|
@@ -170,58 +187,27 @@ describe Puppet::Resource::TypeCollection do
|
|
170
187
|
end
|
171
188
|
|
172
189
|
%w{hostclass node definition}.each do |data|
|
173
|
-
|
174
|
-
@instance = Puppet::Resource::Type.new(data, "foo")
|
175
|
-
end
|
176
|
-
|
177
|
-
it "should have a method for adding a #{data}" do
|
178
|
-
Puppet::Resource::TypeCollection.new("env").should respond_to("add_#{data}")
|
179
|
-
end
|
190
|
+
describe "behavior of add for #{data}" do
|
180
191
|
|
181
|
-
|
182
|
-
loader = Puppet::Resource::TypeCollection.new("env")
|
183
|
-
loader.send("add_#{data}", @instance)
|
184
|
-
loader.send(data, @instance.name).should equal(@instance)
|
185
|
-
end
|
186
|
-
|
187
|
-
unless data == "hostclass"
|
188
|
-
it "should fail to add a #{data} when one already exists" do
|
192
|
+
it "should return the added #{data}" do
|
189
193
|
loader = Puppet::Resource::TypeCollection.new("env")
|
190
|
-
|
191
|
-
lambda { loader.add(@instance) }.should raise_error(Puppet::ParseError)
|
192
|
-
end
|
193
|
-
end
|
194
|
+
instance = Puppet::Resource::Type.new(data, "foo")
|
194
195
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
loader.add(@instance).should equal(@instance)
|
199
|
-
end
|
196
|
+
loader.add(instance).should equal(instance)
|
197
|
+
end
|
200
198
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
loader.add instance
|
205
|
-
loader.send(data, "bar").should equal(instance)
|
206
|
-
end
|
199
|
+
it "should retrieve #{data} insensitive to case" do
|
200
|
+
loader = Puppet::Resource::TypeCollection.new("env")
|
201
|
+
instance = Puppet::Resource::Type.new(data, "Bar")
|
207
202
|
|
208
|
-
|
209
|
-
loader = Puppet::Resource::TypeCollection.new("env")
|
210
|
-
instance = Puppet::Resource::Type.new(data, "Bar")
|
211
|
-
loader.add instance
|
212
|
-
loader.send(data, "bAr").should equal(instance)
|
213
|
-
end
|
203
|
+
loader.add instance
|
214
204
|
|
215
|
-
|
216
|
-
|
217
|
-
end
|
205
|
+
loader.send(data, "bAr").should equal(instance)
|
206
|
+
end
|
218
207
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
instance = Puppet::Resource::Type.new(data, "foo")
|
223
|
-
loader.add instance
|
224
|
-
loader.send(plurals[data]).should == { "foo" => instance }
|
208
|
+
it "should return nil when asked for a #{data} that has not been added" do
|
209
|
+
Puppet::Resource::TypeCollection.new("env").send(data, "foo").should be_nil
|
210
|
+
end
|
225
211
|
end
|
226
212
|
end
|
227
213
|
|
@@ -311,7 +297,7 @@ describe Puppet::Resource::TypeCollection do
|
|
311
297
|
end
|
312
298
|
|
313
299
|
end
|
314
|
-
|
300
|
+
|
315
301
|
it "should not look in the local scope for classes when the name is qualified" do
|
316
302
|
@loader = Puppet::Resource::TypeCollection.new("env")
|
317
303
|
@loader.add Puppet::Resource::Type.new(:hostclass, "foo::bar")
|
@@ -445,7 +431,5 @@ describe Puppet::Resource::TypeCollection do
|
|
445
431
|
|
446
432
|
lambda { @code.version }.should raise_error(Puppet::ParseError)
|
447
433
|
end
|
448
|
-
|
449
434
|
end
|
450
|
-
|
451
435
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.23
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: facter
|
@@ -46,7 +46,6 @@ files:
|
|
46
46
|
- CHANGELOG
|
47
47
|
- CONTRIBUTING.md
|
48
48
|
- Gemfile
|
49
|
-
- Gemfile.lock
|
50
49
|
- LICENSE
|
51
50
|
- README.md
|
52
51
|
- README_DEVELOPER.md
|
@@ -188,6 +187,8 @@ files:
|
|
188
187
|
- lib/puppet/file_serving/mount/plugins.rb
|
189
188
|
- lib/puppet/file_serving/terminus_helper.rb
|
190
189
|
- lib/puppet/file_serving/terminus_selector.rb
|
190
|
+
- lib/puppet/file_system.rb
|
191
|
+
- lib/puppet/file_system/path_pattern.rb
|
191
192
|
- lib/puppet/forge.rb
|
192
193
|
- lib/puppet/forge/cache.rb
|
193
194
|
- lib/puppet/forge/repository.rb
|
@@ -1041,6 +1042,7 @@ files:
|
|
1041
1042
|
- ext/osx/prototype.plist.erb
|
1042
1043
|
- ext/packaging/README-Solaris.md
|
1043
1044
|
- ext/packaging/README.md
|
1045
|
+
- ext/packaging/packaging.rake
|
1044
1046
|
- ext/packaging/spec/spec_helper.rb
|
1045
1047
|
- ext/packaging/spec/tasks/00_utils_spec.rb
|
1046
1048
|
- ext/packaging/spec/tasks/build_object_spec.rb
|
@@ -1058,15 +1060,14 @@ files:
|
|
1058
1060
|
- ext/packaging/tasks/gem.rake
|
1059
1061
|
- ext/packaging/tasks/ips.rake
|
1060
1062
|
- ext/packaging/tasks/jenkins.rake
|
1063
|
+
- ext/packaging/tasks/jenkins_dynamic.rake
|
1061
1064
|
- ext/packaging/tasks/mock.rake
|
1062
1065
|
- ext/packaging/tasks/pe_deb.rake
|
1063
1066
|
- ext/packaging/tasks/pe_remote.rake
|
1064
1067
|
- ext/packaging/tasks/pe_rpm.rake
|
1065
1068
|
- ext/packaging/tasks/pe_ship.rake
|
1066
1069
|
- ext/packaging/tasks/pe_sign.rake
|
1067
|
-
- ext/packaging/tasks/pe_sles.rake
|
1068
1070
|
- ext/packaging/tasks/pe_tar.rake
|
1069
|
-
- ext/packaging/tasks/pre_tasks.rake
|
1070
1071
|
- ext/packaging/tasks/release.rake
|
1071
1072
|
- ext/packaging/tasks/remote_build.rake
|
1072
1073
|
- ext/packaging/tasks/retrieve.rake
|
@@ -1081,6 +1082,10 @@ files:
|
|
1081
1082
|
- ext/packaging/tasks/vendor_gems.rake
|
1082
1083
|
- ext/packaging/tasks/version.rake
|
1083
1084
|
- ext/packaging/tasks/z_data_dump.rake
|
1085
|
+
- ext/packaging/templates/README
|
1086
|
+
- ext/packaging/templates/downstream.xml.erb
|
1087
|
+
- ext/packaging/templates/packaging.xml.erb
|
1088
|
+
- ext/packaging/templates/repo.xml.erb
|
1084
1089
|
- ext/project_data.yaml
|
1085
1090
|
- ext/puppet-load.rb
|
1086
1091
|
- ext/puppet-test
|
@@ -1566,6 +1571,7 @@ files:
|
|
1566
1571
|
- spec/unit/file_serving/mount_spec.rb
|
1567
1572
|
- spec/unit/file_serving/terminus_helper_spec.rb
|
1568
1573
|
- spec/unit/file_serving/terminus_selector_spec.rb
|
1574
|
+
- spec/unit/file_system/path_pattern_spec.rb
|
1569
1575
|
- spec/unit/forge/repository_spec.rb
|
1570
1576
|
- spec/unit/forge_spec.rb
|
1571
1577
|
- spec/unit/indirector/active_record_spec.rb
|
data/Gemfile.lock
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
puppet (2.7.19)
|
5
|
-
facter (~> 1.5)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: http://rubygems.org/
|
9
|
-
specs:
|
10
|
-
diff-lcs (1.1.3)
|
11
|
-
facter (1.6.18)
|
12
|
-
metaclass (0.0.1)
|
13
|
-
mocha (0.10.5)
|
14
|
-
metaclass (~> 0.0.1)
|
15
|
-
rack (1.4.5)
|
16
|
-
rspec (2.10.0)
|
17
|
-
rspec-core (~> 2.10.0)
|
18
|
-
rspec-expectations (~> 2.10.0)
|
19
|
-
rspec-mocks (~> 2.10.0)
|
20
|
-
rspec-core (2.10.1)
|
21
|
-
rspec-expectations (2.10.0)
|
22
|
-
diff-lcs (~> 1.1.3)
|
23
|
-
rspec-mocks (2.10.1)
|
24
|
-
|
25
|
-
PLATFORMS
|
26
|
-
ruby
|
27
|
-
|
28
|
-
DEPENDENCIES
|
29
|
-
facter (~> 1.6.4)
|
30
|
-
mocha (~> 0.10.5)
|
31
|
-
puppet!
|
32
|
-
rack (~> 1.4.1)
|
33
|
-
rspec (~> 2.10.0)
|
34
|
-
sys-admin (~> 1.5.6)
|
35
|
-
win32-api (~> 1.4.8)
|
36
|
-
win32-dir (~> 0.3.7)
|
37
|
-
win32-eventlog (~> 0.5.3)
|
38
|
-
win32-process (~> 0.6.5)
|
39
|
-
win32-security (~> 0.1.4)
|
40
|
-
win32-service (~> 0.7.2)
|
41
|
-
win32-taskscheduler (~> 0.2.2)
|
42
|
-
win32console (~> 1.3.2)
|
43
|
-
windows-api (~> 0.4.1)
|
44
|
-
windows-pr (~> 1.2.1)
|
@@ -1,101 +0,0 @@
|
|
1
|
-
# tasks for sles building
|
2
|
-
|
3
|
-
# take a tarball and stage it in a temp dir with appropriate
|
4
|
-
# directories/files set up for building an rpm.
|
5
|
-
# return the directory
|
6
|
-
|
7
|
-
if @build.build_pe
|
8
|
-
def prep_sles_dir
|
9
|
-
temp = get_temp
|
10
|
-
check_file("pkg/#{@build.project}-#{@build.version}.tar.gz")
|
11
|
-
mkdir_pr temp, "#{temp}/SOURCES", "#{temp}/SPECS"
|
12
|
-
if @build.sign_tar
|
13
|
-
Rake::Task["pl:sign_tar"].invoke
|
14
|
-
cp_p "pkg/#{@build.project}-#{@build.version}.tar.gz.asc", "#{temp}/SOURCES"
|
15
|
-
end
|
16
|
-
cp_p "pkg/#{@build.project}-#{@build.version}.tar.gz", "#{temp}/SOURCES"
|
17
|
-
erb "ext/redhat/#{@build.project}.spec.erb", "#{temp}/SPECS/#{@build.project}.spec"
|
18
|
-
temp
|
19
|
-
end
|
20
|
-
|
21
|
-
namespace :pe do
|
22
|
-
# Temporary task to pull down pe dependencies until this is NFS-mounted
|
23
|
-
task :retrieve_sles_deps => 'pl:fetch' do
|
24
|
-
rm_rf FileList["#{ENV['HOME']}/package_repos/*"]
|
25
|
-
rsync_from("#{@build.sles_repo_path}/#{@build.pe_version}/repos/sles-*", @build.sles_repo_host, "#{ENV['HOME']}/package_repos/")
|
26
|
-
FileList["#{ENV['HOME']}/package_repos/*"].each do |f|
|
27
|
-
update_rpm_repo(f) if File.directory?(f)
|
28
|
-
end
|
29
|
-
cd "#{ENV['HOME']}/package_repos" do
|
30
|
-
unless File.symlink?('sles-11-i586')
|
31
|
-
if File.exist?('sles-11-i586')
|
32
|
-
rm_rf 'sles-11-i586'
|
33
|
-
end
|
34
|
-
File.symlink('sles-11-i386', 'sles-11-i586')
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
desc "Build a sles rpm from this repo"
|
40
|
-
task :local_sles => ['package:tar', 'pl:fetch', 'pe:retrieve_sles_deps'] do
|
41
|
-
check_tool('build')
|
42
|
-
check_tool('linux32')
|
43
|
-
check_tool('linux64')
|
44
|
-
build_dest_dir = "usr/src/packages"
|
45
|
-
noarch = FALSE
|
46
|
-
built_arch = ''
|
47
|
-
@build.sles_arch_repos.each do |arch, deps_repo|
|
48
|
-
build_root = get_temp
|
49
|
-
work_dir = prep_sles_dir
|
50
|
-
build_source_dir = "#{work_dir}/SOURCES"
|
51
|
-
build_spec_dir = "#{work_dir}/SPECS"
|
52
|
-
build_spec = "#{build_spec_dir}/#{@build.project}.spec"
|
53
|
-
if noarch == FALSE
|
54
|
-
bench = Benchmark.realtime do
|
55
|
-
linux_cmd = arch == 'i586' ? 'linux32' : 'linux64'
|
56
|
-
sh "yes | sudo #{linux_cmd} build \
|
57
|
-
--rpms #{deps_repo}:#{ENV['HOME']}/package_repos/sles-11-#{arch} \
|
58
|
-
--root #{build_root}/#{arch} \
|
59
|
-
--rsync-src #{build_source_dir} \
|
60
|
-
--rsync-dest /usr/src/packages/SOURCES \
|
61
|
-
--no-checks #{build_spec} \
|
62
|
-
--arch #{arch} || true"
|
63
|
-
rpms = FileList["#{build_root}/#{arch}/#{build_dest_dir}/RPMS/**/*.rpm"]
|
64
|
-
srpms = FileList["#{build_root}/#{arch}/#{build_dest_dir}/SRPMS/**/*.rpm"]
|
65
|
-
if rpms.empty?
|
66
|
-
STDERR.puts "No RPMS were built. Perhaps an error occurred?"
|
67
|
-
exit 1
|
68
|
-
end
|
69
|
-
built_arch = arch
|
70
|
-
%x{mkdir -p pkg/pe/rpm/sles-11-{srpms,#{arch}}}
|
71
|
-
cp(rpms, "pkg/pe/rpm/sles-11-#{arch}")
|
72
|
-
cp(srpms, "pkg/pe/rpm/sles-11-srpms")
|
73
|
-
noarch = rpms.exclude(/noarch/).empty?
|
74
|
-
end
|
75
|
-
# See 30_metrics.rake to see what this is doing
|
76
|
-
add_metrics({ :dist => 'sles', :bench => bench }) if @build.benchmark
|
77
|
-
else
|
78
|
-
arches_to_copy_to = @build.sles_arch_repos.keys - [ built_arch ]
|
79
|
-
arches_to_copy_to.each do |other_arch|
|
80
|
-
%x{mkdir -p pkg/pe/rpm/sles-11-#{other_arch}}
|
81
|
-
cp(FileList["pkg/pe/rpm/sles-11-#{built_arch}/*"], "pkg/pe/rpm/sles-11-#{other_arch}")
|
82
|
-
end
|
83
|
-
end
|
84
|
-
rm_rf build_root
|
85
|
-
rm_rf work_dir
|
86
|
-
end
|
87
|
-
post_metrics if @build.benchmark
|
88
|
-
cd 'pkg/pe/rpm' do
|
89
|
-
if File.exist?('sles-11-i586')
|
90
|
-
mkdir_p 'sles-11-i386'
|
91
|
-
cp FileList["sles-11-i586/*"], 'sles-11-i386'
|
92
|
-
rm_rf 'sles-11-i586'
|
93
|
-
end
|
94
|
-
end
|
95
|
-
if @build.team == 'release'
|
96
|
-
Rake::Task["pe:sign_rpms"].invoke
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|