facter 1.6.13.rc1 → 1.6.13

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.

@@ -1,88 +0,0 @@
1
-
2
- def mock(mock_config, srpm)
3
- check_tool('mock')
4
- sh "mock -r #{mock_config} #{srpm}"
5
- end
6
-
7
- def srpm_file
8
- srpm = Dir["pkg/srpm/*.rpm"][0]
9
- check_file(srpm)
10
- srpm
11
- end
12
-
13
- def mock_el_family(mock_config)
14
- family = mock_config.split('-')[0]
15
- family = 'el' if family == 'pl'
16
- family
17
- end
18
-
19
- def mock_el_ver(mock_config)
20
- version = mock_config.split('-')[1]
21
- version = "f#{version}" if mock_config.split('-')[0] == 'fedora'
22
- version
23
- end
24
-
25
- def build_rpm_with_mock(is_rc, subdir)
26
- if is_rc
27
- mocks = @rc_mocks
28
- else
29
- mocks = @final_mocks
30
- end
31
-
32
- mocks.split(' ').each do |mock_config|
33
- family = mock_el_family(mock_config)
34
- version = mock_el_ver(mock_config)
35
- arch = mock_config.split('-')[2]
36
- result = "/var/lib/mock/#{mock_config}/result/*.rpm"
37
-
38
- mock(mock_config, srpm_file)
39
-
40
- Dir[result].each do |rpm|
41
- rpm.strip!
42
- unless ENV['RC_OVERRIDE'] == '1'
43
- if is_rc == FALSE and rpm =~ /[0-9]+rc[0-9]+\./
44
- puts "It looks like you might be trying to ship an RC to the production repos. Leaving rpm in #{result}. Pass RC_OVERRIDE=1 to override."
45
- next
46
- elsif is_rc and rpm !~ /[0-9]+rc[0-9]+\./
47
- puts "It looks like you might be trying to ship a production release to the development repos. Leaving rpm in #{result}. Pass RC_OVERRIDE=1 to override."
48
- next
49
- end
50
- end
51
-
52
- case File.basename(rpm)
53
- when /debuginfo/
54
- rm_rf(rpm)
55
- when /src\.rpm/
56
- cp_pr(rpm, "pkg/#{family}/#{version}/#{subdir}/SRPMS")
57
- when /i.?86/
58
- cp_pr(rpm, "pkg/#{family}/#{version}/#{subdir}/i386")
59
- when /x86_64/
60
- cp_pr(rpm, "pkg/#{family}/#{version}/#{subdir}/x86_64")
61
- when /noarch/
62
- cp_pr(rpm, "pkg/#{family}/#{version}/#{subdir}/i386")
63
- ln("pkg/#{family}/#{version}/#{subdir}/i386/#{File.basename(rpm)}", "pkg/#{family}/#{version}/#{subdir}/x86_64/")
64
- end
65
- end
66
- end
67
- end
68
-
69
-
70
- namespace :pl do
71
- task :setup_el_dirs do
72
- %x{mkdir -p pkg/el/{5,6}/{products,devel,dependencies}/{SRPMS,i386,x86_64}}
73
- %x{mkdir -p pkg/fedora/{f15,f16,f17}/{products,devel,dependencies}/{SRPMS,i386,x86_64}}
74
- end
75
-
76
- desc "Use specified mocks to make final rpms, keyed to PL infrastructure, pass MOCK to specifiy config"
77
- task :mock_final => [ "package:srpm", "pl:setup_el_dirs" ] do
78
- subdir = ENV['subdir'] || 'products'
79
- build_rpm_with_mock(FALSE, subdir)
80
- end
81
-
82
- desc "Use specified mocks to make RC rpms, keyed to PL infrastructure, pass MOCK to specify config"
83
- task :mock_rc => [ "package:srpm", "pl:setup_el_dirs" ] do
84
- subdir = 'devel'
85
- build_rpm_with_mock(TRUE, subdir)
86
- end
87
- end
88
-
@@ -1,54 +0,0 @@
1
- # These tasks are "release" chains that couple as much of the release process for a package as possible
2
-
3
- namespace :pl do
4
- if @build_gem
5
- desc "Build and ship a gem"
6
- task :release_gem do
7
- invoke_task("package:gem")
8
- if confirm_ship(FileList["pkg/*.gem"])
9
- invoke_task("pl:ship_gem")
10
- end
11
- end
12
- end
13
-
14
- desc "Release deb RCs, e.g. package:tar, pl:{deb_all_rc, sign_deb_changes, ship_debs}"
15
- task :release_deb_rc do
16
- invoke_task("pl:deb_all_rc")
17
- invoke_task("pl:sign_deb_changes")
18
- if confirm_ship(FileList["pkg/deb/**/*"])
19
- invoke_task("pl:ship_debs")
20
- end
21
- end
22
-
23
- desc "Release deb FINALs, e.g. package:tar, pl:{deb_all, sign_deb_changes, ship_debs}"
24
- task :release_deb_final do
25
- invoke_task("pl:deb_all")
26
- invoke_task("pl:sign_deb_changes")
27
- if confirm_ship(FileList["pkg/deb/**/*"])
28
- invoke_task("pl:ship_debs")
29
- end
30
- end
31
-
32
- desc "Release rpm RCs, e.g. package:tar, pl:{mock_rc, sign_rpms, ship_rpms, update_yum_repo}"
33
- task :release_rpm_rc do
34
- invoke_task("pl:mock_rc")
35
- invoke_task("pl:sign_rpms")
36
- if confirm_ship(FileList["pkg/el/**/*", "pkg/fedora/**/*"])
37
- invoke_task("pl:ship_rpms")
38
- invoke_task("pl:update_yum_repo")
39
- end
40
- end
41
-
42
- desc "Release rpm FINALs, e.g. package:tar, pl:{mock_final, sign_rpms, ship_rpms, update_yum_repo}"
43
- task :release_rpm_final do
44
- invoke_task("pl:mock_final")
45
- invoke_task("pl:sign_rpms")
46
- if confirm_ship(FileList["pkg/el/**/*", "pkg/fedora/**/*"])
47
- invoke_task("pl:ship_rpms")
48
- invoke_task("pl:update_yum_repo")
49
- end
50
- end
51
- end
52
-
53
-
54
-
@@ -1,39 +0,0 @@
1
- def build_rpm(buildarg = "-bs")
2
- check_tool('rpmbuild')
3
- temp = get_temp
4
- rpm_define = "--define \"%dist .el5\" --define \"%_topdir #{temp}\" "
5
- rpm_old_version = '--define "_source_filedigest_algorithm 1" --define "_binary_filedigest_algorithm 1" \
6
- --define "_binary_payload w9.gzdio" --define "_source_payload w9.gzdio" \
7
- --define "_default_patch_fuzz 2"'
8
- args = rpm_define + ' ' + rpm_old_version
9
- mkdir_pr temp, 'pkg/rpm', 'pkg/srpm', "#{temp}/SOURCES", "#{temp}/SPECS"
10
- if @sign_tar
11
- Rake::Task["pl:sign_tar"].invoke
12
- cp_p "pkg/#{@name}-#{@version}.tar.gz.asc", "#{temp}/SOURCES"
13
- end
14
- cp_p "pkg/#{@name}-#{@version}.tar.gz", "#{temp}/SOURCES"
15
- erb "ext/redhat/#{@name}.spec.erb", "#{temp}/SPECS/#{@name}.spec"
16
- sh "rpmbuild #{args} #{buildarg} --nodeps #{temp}/SPECS/#{@name}.spec"
17
- mv FileList["#{temp}/SRPMS/*.rpm"], "pkg/srpm"
18
- mv FileList["#{temp}/RPMS/*/*.rpm"], "pkg/rpm"
19
- rm_rf temp
20
- puts
21
- output = FileList['pkg/*/*.rpm']
22
- puts "Wrote:"
23
- output.each do | line |
24
- puts line
25
- end
26
- end
27
-
28
- namespace :package do
29
- desc "Create srpm from this git repository (unsigned)"
30
- task :srpm => :tar do
31
- build_rpm("-bs")
32
- end
33
-
34
- desc "Create .rpm from this git repository (unsigned)"
35
- task :rpm => :tar do
36
- build_rpm("-ba")
37
- end
38
- end
39
-
@@ -1,36 +0,0 @@
1
- namespace :pl do
2
- desc "Ship mocked rpms to #{@yum_host}"
3
- task :ship_rpms do
4
- rsync_to('pkg/el', @yum_host, @yum_repo_path)
5
- rsync_to('pkg/fedora', @yum_host, @yum_repo_path)
6
- end
7
-
8
- desc "Update remote rpm repodata on #{@yum_host}"
9
- task :update_yum_repo do
10
- remote_ssh_cmd(@yum_host, '/var/lib/gems/1.8/gems/rake-0.9.2.2/bin/rake -f /opt/repository/Rakefile mk_repo')
11
- end
12
-
13
- desc "Ship cow-built debs to #{@apt_host}"
14
- task :ship_debs do
15
- rsync_to('pkg/deb/', @apt_host, @apt_repo_path)
16
- end
17
-
18
- if @build_ips
19
- desc "Update remote ips repository on #{@ips_host}"
20
- task :update_ips_repo do
21
- rsync_to('pkg/ips/pkgs', @ips_host, @ips_store)
22
- remote_ssh_cmd(@ips_host, "pkgrecv -s #{@ips_store}/pkgs/#{@name}@#{@ipsversion}.p5p -d #{@ips_repo} \\*")
23
- remote_ssh_cmd(@ips_host, "pkgrepo refresh -s #{@ips_repo}")
24
- remote_ssh_cmd(@ips_host, "/usr/sbin/svcadm restart svc:/application/pkg/server")
25
- end
26
- end
27
-
28
- if @build_gem
29
- desc "Ship built gem to rubygems"
30
- task :ship_gem do
31
- ship_gem("pkg/#{@name}-#{@gemversion}.gem")
32
- end
33
- end
34
- end
35
-
36
-
@@ -1,78 +0,0 @@
1
- def sign_el5(rpm)
2
- %x{rpm --define '%_gpg_name #{@gpg_name}' --define '%__gpg_sign_cmd %{__gpg} gpg --force-v3-sigs --digest-algo=sha1 --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning -u %{_gpg_name} -sbo %{__signature_filename} %{__plaintext_filename}' --addsign #{rpm} > /dev/null}
3
- end
4
-
5
- def sign_modern(rpm)
6
- %x{rpm --define '%_gpg_name #{@gpg_name}' --addsign #{rpm} > /dev/null}
7
- end
8
-
9
- def rpm_has_sig(rpm)
10
- %x{rpm -Kv #{rpm} | grep "#{@gpg_key.downcase}" &> /dev/null}
11
- $?.success?
12
- end
13
-
14
- def sign_deb_changes(file)
15
- %x{debsign --re-sign -k#{@gpg_key} #{file}}
16
- end
17
-
18
- # requires atleast a self signed prvate key and certificate pair
19
- def sign_ips(pkg)
20
- %x{pkgsign -s pkg/ips/repo/ -k #{@privatekey_pem} -c #{@certificate_pem} #{@name}@#{@ipsversion}}
21
- %x{rm -f #{pkg}}
22
- %x{pkgrecv -s pkg/ips/repo -a -d #{pkg} #{@name}@#{@ipsversion}}
23
- end
24
-
25
- namespace :pl do
26
- desc "Sign the tarball, defaults to PL key, pass GPG_KEY to override or edit build_defaults"
27
- task :sign_tar do
28
- unless File.exist? "pkg/#{@name}-#{@version}.tar.gz"
29
- STDERR.puts "No tarball exists. Try rake package:tar?"
30
- exit 1
31
- end
32
- gpg_sign_file "pkg/#{@name}-#{@version}.tar.gz"
33
- end
34
-
35
- desc "Sign mocked rpms, Defaults to PL Key, pass KEY to override"
36
- task :sign_rpms do
37
- el5_rpms = Dir["pkg/el/5/**/*.rpm"].join(' ')
38
- modern_rpms = (Dir["pkg/el/6/**/*.rpm"] + Dir["pkg/fedora/**/*.rpm"]).join(' ')
39
- puts "Signing el5 rpms..."
40
- sign_el5 el5_rpms
41
- puts "Signing el6 and fedora rpms..."
42
- sign_modern modern_rpms
43
- end
44
-
45
- if @build_ips
46
- desc "Sign ips package, Defaults to PL Key, pass KEY to override"
47
- task :sign_ips do
48
- ips_pkgs = Dir["pkg/ips/pkgs/*.p5p"].join(' ')
49
- puts "Signing ips packages..."
50
- sign_ips ips_pkgs
51
- end
52
- end
53
-
54
- desc "Check if all rpms are signed"
55
- task :check_rpm_sigs do
56
- signed = TRUE
57
- rpms = Dir["pkg/el/5/**/*.rpm"] + Dir["pkg/el/6/**/*.rpm"] + Dir["pkg/fedora/**/*.rpm"]
58
- print 'Checking rpm signatures'
59
- rpms.each do |rpm|
60
- if rpm_has_sig rpm
61
- print '.'
62
- else
63
- puts "#{rpm} is unsigned."
64
- signed = FALSE
65
- end
66
- end
67
- exit 1 unless signed
68
- puts "All rpms signed"
69
- end
70
-
71
- desc "Sign generated debian changes files. Defaults to PL Key, pass KEY to override"
72
- task :sign_deb_changes do
73
- restart_keychain
74
- sign_deb_changes("pkg/deb/*/*.changes") unless Dir["pkg/deb/*/*.changes"].empty?
75
- sign_deb_changes("pkg/deb/*.changes") unless Dir["pkg/deb/*.changes"].empty?
76
- end
77
- end
78
-
@@ -1,8 +0,0 @@
1
- namespace 'pl' do
2
- desc "Tag this repository, requires a TAG, e.g. TAG=1.1.1"
3
- task "tag" do
4
- check_var('TAG', ENV['TAG'])
5
- git_tag(ENV['TAG'])
6
- end
7
- end
8
-
@@ -1,20 +0,0 @@
1
- namespace :package do
2
- desc "Create a source tar archive"
3
- task :tar => [ :clean ] do
4
- tar = ENV['TAR'] || 'tar'
5
- workdir = "pkg/#{@name}-#{@version}"
6
- mkdir_p(workdir)
7
- FileList[@files.split(' ')].each do |f|
8
- cp_pr(f, workdir)
9
- end
10
- erb("#{workdir}/ext/redhat/#{@name}.spec.erb", "#{workdir}/ext/redhat/#{@name}.spec")
11
- erb("#{workdir}/ext/debian/changelog.erb", "#{workdir}/ext/debian/changelog")
12
- rm_rf(FileList["#{workdir}/ext/debian/*.erb", "#{workdir}/ext/redhat/*.erb"])
13
- cd "pkg" do
14
- sh "#{tar} --exclude=.gitignore --exclude=ext/#{@packaging_repo} -zcf #{@name}-#{@version}.tar.gz #{@name}-#{@version}"
15
- end
16
- rm_rf(workdir)
17
- puts
18
- puts "Wrote #{`pwd`.strip}/pkg/#{@name}-#{@version}.tar.gz"
19
- end
20
- end
@@ -1,20 +0,0 @@
1
- namespace :package do
2
- desc "Update the version in #{@version_file} to current and commit."
3
- task :versionbump do
4
- old_version = get_version_file_version
5
- contents = IO.read(@version_file)
6
- new_version = '"' + @version.to_s.strip + '"'
7
- if contents.match("VERSION = #{old_version}")
8
- contents.gsub!("VERSION = #{old_version}", "VERSION = #{new_version}")
9
- elsif contents.match("#{@name.upcase}VERSION = #{old_version}")
10
- contents.gsub!("#{@name.upcase}VERSION = #{old_version}", "#{@name.upcase}VERSION = #{new_version}")
11
- else
12
- contents.gsub!(old_version, @version)
13
- end
14
- file = File.open(@version_file, 'w')
15
- file.write contents
16
- file.close
17
- git_commit_file(@version_file)
18
- end
19
- end
20
-