Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65,887 changes: 65,887 additions & 0 deletions component_info.json

Large diffs are not rendered by default.

67 changes: 24 additions & 43 deletions configs/components/augeas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,38 @@
# Component release information: https://github.com/hercules-team/augeas/releases
#####
component 'augeas' do |pkg, settings, platform|
version = settings[:augeas_version] || '1.14.1'
pkg.version version
# Solaris and AIX depend on libedit which breaks augeas compliation starting with 1.13.0.
# Figure out a solution if we ever need to update augeas on those platforms.
pkg.version '1.14.1'
pkg.md5sum 'ac31216268b4b64809afd3a25f2515e5'
pkg.url "https://github.com/hercules-team/augeas/releases/download/release-#{pkg.get_version}/augeas-#{pkg.get_version}.tar.gz"

case version
when '1.14.1'
pkg.md5sum 'ac31216268b4b64809afd3a25f2515e5'
pkg.apply_patch 'resources/patches/augeas/augeas-1.14.1-return_reg_enosys.patch'

pkg.apply_patch 'resources/patches/augeas/augeas-1.14.1-return_reg_enosys.patch'
when '1.12.0'
pkg.md5sum '74f1c7b8550f4e728486091f6b907175'

pkg.apply_patch 'resources/patches/augeas/augeas-1.12.0-allow-ad-groups-in-sudoers.patch'
pkg.apply_patch 'resources/patches/augeas/augeas-1.12.0-allow-hyphen-postgresql-lens.patch'
else
raise "augeas version #{version} has not been configured; Cannot continue."
end

# releases from 1.13.0 onward are only available from github
if Gem::Version.new(pkg.get_version) < Gem::Version.new('1.13.0')
# this url may be removed once 1.12.0 is no longer supported
pkg.url "http://download.augeas.net/augeas-#{pkg.get_version}.tar.gz"
else
pkg.url "https://github.com/hercules-team/augeas/releases/download/release-#{pkg.get_version}/augeas-#{pkg.get_version}.tar.gz"
if platform.is_el? || platform.is_fedora?
# Augeas 1.11.0+ needs a libselinux pkgconfig file on these platforms:
pkg.build_requires 'ruby-selinux'
end

if ['1.12.0', '1.14.1'].include?(version)
if platform.is_el? || platform.is_fedora?
# Augeas 1.11.0 needs a libselinux pkgconfig file on these platforms:
pkg.build_requires 'ruby-selinux'
end

if platform.name =~ /solaris-10-sparc/
# This patch to gnulib fixes a linking error around symbol versioning in pthread.
pkg.add_source "file://resources/patches/augeas/augeas-#{version}-gnulib-pthread-in-use.patch"
pkg.configure do
# gnulib is a submodule, and its files don't exist until after configure,
# so we apply the patch manually here instead of using pkg.apply_patch.
["/usr/bin/gpatch -p0 < ../augeas-#{version}-gnulib-pthread-in-use.patch"]
end
end

if platform.is_macos?
pkg.build_requires 'readline'
pkg.build_requires 'autoconf'
pkg.build_requires 'automake'
pkg.build_requires 'libtool'
if platform.name =~ /solaris-10-sparc/
# This patch to gnulib fixes a linking error around symbol versioning in pthread.
pkg.add_source "file://resources/patches/augeas/augeas-#{version}-gnulib-pthread-in-use.patch"
pkg.configure do
# gnulib is a submodule, and its files don't exist until after configure,
# so we apply the patch manually here instead of using pkg.apply_patch.
["/usr/bin/gpatch -p0 < ../augeas-#{version}-gnulib-pthread-in-use.patch"]
end
end

extra_config_flags = platform.name =~ /solaris-11|aix/ ? ' --disable-dependency-tracking' : ''
if platform.is_macos?
pkg.build_requires 'readline'
pkg.build_requires 'autoconf'
pkg.build_requires 'automake'
pkg.build_requires 'libtool'
end

extra_config_flags = platform.name =~ /solaris-11|aix/ ? ' --disable-dependency-tracking' : ''

pkg.mirror "#{settings[:buildsources_url]}/augeas-#{pkg.get_version}.tar.gz"

pkg.build_requires 'libxml2'
Expand Down
7 changes: 0 additions & 7 deletions configs/projects/agent-runtime-main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
proj.setting :ruby_version, '3.2' # Leave the .Z out for Ruby 3.2
proj.setting :rubygem_highline_version, '3.0.1'

# Solaris and AIX depend on libedit which breaks augeas compliation starting with 1.13.0
if platform.is_solaris?
proj.setting :augeas_version, '1.12.0'
else
proj.setting :augeas_version, '1.14.1'
end

########
# Load shared agent settings
########
Expand Down
1 change: 0 additions & 1 deletion configs/projects/openbolt-runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
proj.setting(:openssl_version, '3.0')
# Legacy algos must be enabled in OpenSSL >= 3.0 for OpenBolt's WinRM transport to work.
proj.setting(:use_legacy_openssl_algos, true)
proj.setting(:augeas_version, '1.14.1')

platform = proj.get_platform

Expand Down

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions resources/patches/augeas/augeas-1.12.0-gnulib-pthread-in-use.patch

This file was deleted.

101 changes: 101 additions & 0 deletions tasks/update_component_info.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
require 'json'

FIRST_TAG = '202501080'.freeze # First tag to include when regenerating
IGNORED_PLATFORMS = %w[aix solaris redhatfips windowsfips el-6 osx sles-11 windows-2012r2 ppc64le armhf i386].freeze
INCLUDED_PROJECTS = %w[agent-runtime openbolt-runtime].freeze

def platforms
# First item will be a `- Platforms` header. Also exclude
# any platforms we don't actually build for or have problems parsing.
`bundle exec vanagon list -l`.split("\n")[1..]
.reject { |p| p =~ /(#{IGNORED_PLATFORMS.join('|')})/ }
end

def projects
# First item will be a `- Projects` header. Also exclude
# any projects prefixed with '_' as these are not real projects and
# are shared between projects. Also ignore any projects we don't care
# about.
`bundle exec vanagon list -r`.split("\n")[1..]
.reject { |p| p.start_with?('_') || p !~ /^(#{INCLUDED_PROJECTS.join('|')})/ }
end

# Sometimes the version is a git ref so extract
# actual version numbers. Fall back to 0 if nothing
# usable is found so everything is comparable.
def parse_version(ver)
Gem::Version.new(ver.to_s[/\d+(?:\.\d+)+/] || 0)
end

def component_info
# Build component list with version/ref for each project
puts `pwd`
project_data = {}
projects.each do |project|
puts "Processing project #{project}"
project_data[project] = {}

platforms.each do |platform|
puts " #{platform}"
platform_data = JSON.parse(`bundle exec vanagon inspect #{project} #{platform}`)
project_data[project][platform] = platform_data.map { |h| [h['name'], h['version'] || h.dig('options', 'ref')] }.to_h
end
end

component_data = project_data.values
.flat_map(&:values).flatten # [{comp1 => ver1}, {comp2 => ver2}, ...]
.flat_map(&:to_a) # [[comp1, ver1], [comp2, ver2], ...]
.group_by(&:first) # { comp1 => [[comp1, ver1], [comp1, ver2], ...], ... }
.transform_values do |pairs| # { comp1 => verN, ... }
pairs.max_by { |_, ver| parse_version(ver) }.last
end

{ 'components' => component_data, 'projects' => project_data }
end

# We use `vanagon inspect` to get components instead of parsing the
# files directly, so that we can populate a list of components per
# platform, as they can differ between platforms.
namespace :vox do
desc 'Update component_info.json file with current component versions'
task :update_component_info, [:tag] do |_, args|
abort 'You must provide the tag that will be used for this release.' if args[:tag].nil? || args[:tag].empty?

File.write('component_info.json', '{}') unless File.exist?('component_info.json')
data = JSON.parse(File.read('component_info.json'))

data[args[:tag]] = component_info

# Put the new data on top
data = data.to_a.rotate(-1).to_h

File.write('component_info.json', JSON.pretty_generate(data))
puts "Updated component_info.json with data for tag #{args[:tag]}"
end

desc 'Regenerate component_info.json with all tags'
task :regenerate_component_info do
# Clone a copy of the repo to avoid messing up the current working dir
`git clone https://github.com/openvoxproject/puppet-runtime puppet-runtime-tmp`
begin
all_data = {}
Dir.chdir('puppet-runtime-tmp') do
`git fetch origin --tags --prune --prune-tags`
`git tag --sort=creatordate | awk '$0=="#{FIRST_TAG}"{seen=1; next} seen'`.split("\n").each do |tag|
puts "Checking out tag #{tag}..."
`git checkout #{tag}`
Bundler.with_unbundled_env do
`BUNDLER_GEMFILE=./Gemfile bundle install --path .bundle`
all_data[tag] = component_info
end
end
end
# Reverse order to latest is on top
all_data = all_data.to_a.reverse.to_h
File.write('component_info.json', JSON.pretty_generate(all_data))
puts 'Regenerated component_info.json with data for all tags.'
ensure
FileUtils.rm_rf('puppet-runtime-tmp')
end
end
end
Loading