baltix 0.1.1 → 0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +4 -2
- data/README.md +136 -10
- data/Rakefile +8 -3
- data/baltix.gemspec +47 -29
- data/bin/console +4 -3
- data/data/alt-licenses/README.md +26 -0
- data/data/alt-licenses/licenses.json +2991 -0
- data/data/alt-rpm/README.md +21 -0
- data/data/alt-rpm/architectures.json +613 -0
- data/data/spdx/README.md +22 -0
- data/data/spdx/licenses.json +9287 -0
- data/docs/action-flow.md +42 -0
- data/docs/actor-integration.md +71 -0
- data/docs/alt-architectures.md +27 -0
- data/docs/cleanup-actors.md +14 -0
- data/docs/dependency-actions.md +22 -0
- data/docs/installation-actors.md +35 -0
- data/docs/pkglist.md +56 -0
- data/docs/plans/revision-003.md +328 -0
- data/docs/plans/revision-004.md +416 -0
- data/docs/plans/revision-005.md +431 -0
- data/docs/plans/revision-006.md +439 -0
- data/docs/plans/revision-007.md +441 -0
- data/docs/plans/revision-008.md +445 -0
- data/docs/plans/revision-009.md +450 -0
- data/docs/plans/revision-010.md +486 -0
- data/docs/plans/revision-011.md +500 -0
- data/docs/plans/revision-012.md +501 -0
- data/docs/plans/revision-013.md +501 -0
- data/docs/plans/revision-014.md +501 -0
- data/docs/plans/revision-015.md +502 -0
- data/docs/plans/revision-016.md +503 -0
- data/docs/plans/revision-017.md +504 -0
- data/docs/plans/revision-018.md +505 -0
- data/docs/plans/revision-019.md +510 -0
- data/docs/plans/revision-020.md +524 -0
- data/docs/plans/revision-021.md +542 -0
- data/docs/plans/revision-022.md +542 -0
- data/docs/plans/revision-023.md +545 -0
- data/docs/plans/revision-024.md +567 -0
- data/docs/plans/revision-025.md +583 -0
- data/docs/plans/revision-026.md +241 -0
- data/docs/plans/revision-027.md +305 -0
- data/docs/plans/revision-028.md +298 -0
- data/docs/plans/revision-029.md +288 -0
- data/docs/rpm-action-macros.md +52 -0
- data/docs/rpm-parts.md +53 -0
- data/docs/ruby-dependencies.md +217 -0
- data/docs/ruby-policy-2.1.md +28 -0
- data/docs/ruby-versioning.md +61 -0
- data/docs/space-format.md +58 -0
- data/exe/baltix +1 -0
- data/lib/baltix/action_flow/files.rb +49 -0
- data/lib/baltix/action_flow/inputs.rb +60 -0
- data/lib/baltix/action_flow/journal.rb +60 -0
- data/lib/baltix/action_flow/options.rb +60 -0
- data/lib/baltix/action_flow.rb +65 -0
- data/lib/baltix/actor/build/collect.rb +72 -0
- data/lib/baltix/actor/build/compile.rb +25 -0
- data/lib/baltix/actor/build/extconf.rb +14 -0
- data/lib/baltix/actor/build/make.rb +18 -0
- data/lib/baltix/actor/build/postprocess.rb +14 -0
- data/lib/baltix/actor/build/rake.rb +18 -0
- data/lib/baltix/actor/build/ronn.rb +55 -0
- data/lib/baltix/actor/build.rb +87 -0
- data/lib/baltix/actor/clean/remove.rb +45 -0
- data/lib/baltix/actor/clean.rb +37 -0
- data/lib/baltix/actor/config.rb +12 -0
- data/lib/baltix/actor/copy.rb +22 -7
- data/lib/baltix/actor/distclean.rb +20 -0
- data/lib/baltix/actor/doc/collect.rb +39 -0
- data/lib/baltix/actor/doc/generate.rb +47 -0
- data/lib/baltix/actor/doc/inputs.rb +25 -0
- data/lib/baltix/actor/doc.rb +70 -0
- data/lib/baltix/actor/gen.rb +19 -0
- data/lib/baltix/actor/install/data.rb +18 -0
- data/lib/baltix/actor/install/documentation.rb +48 -0
- data/lib/baltix/actor/install/executable.rb +27 -0
- data/lib/baltix/actor/install/extension.rb +44 -0
- data/lib/baltix/actor/install/headers.rb +10 -0
- data/lib/baltix/actor/install/library.rb +13 -0
- data/lib/baltix/actor/install/metadata.rb +21 -0
- data/lib/baltix/actor/install/paths.rb +73 -0
- data/lib/baltix/actor/install/plugin.rb +25 -0
- data/lib/baltix/actor/install/record.rb +48 -0
- data/lib/baltix/actor/install/shebang.rb +29 -0
- data/lib/baltix/actor/install/transfer.rb +64 -0
- data/lib/baltix/actor/install/trees.rb +34 -0
- data/lib/baltix/actor/install.rb +71 -0
- data/lib/baltix/actor/link.rb +15 -6
- data/lib/baltix/actor/make.rb +14 -0
- data/lib/baltix/actor/predeps/write.rb +51 -0
- data/lib/baltix/actor/predeps.rb +41 -0
- data/lib/baltix/actor/provides.rb +12 -0
- data/lib/baltix/actor/requires.rb +12 -0
- data/lib/baltix/actor/show.rb +26 -0
- data/lib/baltix/actor/spec.rb +6 -3
- data/lib/baltix/actor/test/record.rb +8 -0
- data/lib/baltix/actor/test/run.rb +30 -0
- data/lib/baltix/actor/test/select.rb +16 -0
- data/lib/baltix/actor/test.rb +41 -0
- data/lib/baltix/actor/touch.rb +14 -5
- data/lib/baltix/actor.rb +43 -26
- data/lib/baltix/cli/dependency_options.rb +63 -0
- data/lib/baltix/cli/options/action.rb +32 -0
- data/lib/baltix/cli/options.rb +280 -0
- data/lib/baltix/cli/output_options.rb +56 -0
- data/lib/baltix/cli/rake_tasks.rb +59 -0
- data/lib/baltix/cli/source_options.rb +52 -0
- data/lib/baltix/cli.rb +130 -116
- data/lib/baltix/concerns/command.rb +52 -0
- data/lib/baltix/concerns/configuration.rb +39 -0
- data/lib/baltix/concerns/dependency_output.rb +21 -0
- data/lib/baltix/concerns/extension_metadata.rb +44 -0
- data/lib/baltix/concerns/file_destination.rb +14 -0
- data/lib/baltix/concerns/inspection.rb +27 -0
- data/lib/baltix/concerns/parts.rb +16 -0
- data/lib/baltix/concerns/target_paths.rb +57 -0
- data/lib/baltix/concerns.rb +11 -0
- data/lib/baltix/core_extensions/gem_dependency.rb +24 -0
- data/lib/baltix/core_extensions/gem_requirement.rb +45 -0
- data/lib/baltix/core_extensions/open_struct_merge.rb +62 -0
- data/lib/baltix/deps/executables.rb +30 -0
- data/lib/baltix/deps/packages.rb +32 -0
- data/lib/baltix/deps.rb +103 -194
- data/lib/baltix/dsl/dependency_groups.rb +77 -0
- data/lib/baltix/dsl/dependency_sources.rb +100 -0
- data/lib/baltix/dsl/filtering.rb +26 -0
- data/lib/baltix/dsl/loading.rb +72 -0
- data/lib/baltix/dsl/merging.rb +74 -0
- data/lib/baltix/dsl/rendering.rb +54 -0
- data/lib/baltix/dsl/requirements.rb +77 -0
- data/lib/baltix/dsl/temporary_files.rb +36 -0
- data/lib/baltix/dsl.rb +66 -273
- data/lib/baltix/executable_dependencies/features.rb +53 -0
- data/lib/baltix/executable_dependencies/library.rb +21 -0
- data/lib/baltix/executable_dependencies/library_features.rb +34 -0
- data/lib/baltix/executable_dependencies/syntax.rb +102 -0
- data/lib/baltix/executable_dependencies.rb +102 -0
- data/lib/baltix/extensions/bones.rb +173 -0
- data/lib/baltix/extensions/echoe.rb +143 -0
- data/lib/baltix/extensions/hoe/metadata.rb +89 -0
- data/lib/baltix/extensions/hoe/options.rb +84 -0
- data/lib/baltix/extensions/hoe/readme.rb +29 -0
- data/lib/baltix/extensions/hoe.rb +146 -0
- data/lib/baltix/extensions/jeweler.rb +95 -0
- data/lib/baltix/extensions/levitate.rb +74 -0
- data/lib/baltix/extensions/olddoc.rb +42 -0
- data/lib/baltix/extensions.rb +340 -419
- data/lib/baltix/i18n.rb +22 -19
- data/lib/baltix/license/catalog/capture.rb +58 -0
- data/lib/baltix/license/catalog.rb +75 -0
- data/lib/baltix/license.rb +76 -0
- data/lib/baltix/loader/capture.rb +91 -0
- data/lib/baltix/loader/cmake.rb +6 -3
- data/lib/baltix/loader/evaluation.rb +49 -0
- data/lib/baltix/loader/extconf.rb +27 -0
- data/lib/baltix/loader/feature_loading.rb +54 -0
- data/lib/baltix/loader/git-version-gen.rb +36 -21
- data/lib/baltix/loader/mast/properties.rb +58 -0
- data/lib/baltix/loader/mast.rb +97 -109
- data/lib/baltix/loader/object_capture.rb +27 -0
- data/lib/baltix/loader/olddoc.gemspec.erb +31 -0
- data/lib/baltix/loader/pom.rb +36 -16
- data/lib/baltix/loader/rookbook.rb +19 -14
- data/lib/baltix/loader/yaml.rb +9 -5
- data/lib/baltix/loader.rb +85 -132
- data/lib/baltix/log.rb +26 -27
- data/lib/baltix/rake/metadata_adapter.rb +30 -0
- data/lib/baltix/rake/task_context.rb +59 -0
- data/lib/baltix/rake/task_libraries.rb +73 -0
- data/lib/baltix/rake.rb +62 -12
- data/lib/baltix/source/base/dependencies.rb +81 -0
- data/lib/baltix/source/base/file_queries.rb +67 -0
- data/lib/baltix/source/base/file_tree.rb +70 -0
- data/lib/baltix/source/base/metadata.rb +140 -0
- data/lib/baltix/source/base/options.rb +71 -0
- data/lib/baltix/source/base/roots.rb +53 -0
- data/lib/baltix/source/base.rb +95 -377
- data/lib/baltix/source/fake.rb +89 -5
- data/lib/baltix/source/gem/delegation.rb +32 -0
- data/lib/baltix/source/gem/dependencies.rb +69 -0
- data/lib/baltix/source/gem/discovery.rb +72 -0
- data/lib/baltix/source/gem/file_trees.rb +114 -0
- data/lib/baltix/source/gem/forwarding.rb +12 -0
- data/lib/baltix/source/gem/metadata.rb +104 -0
- data/lib/baltix/source/gem/specification.rb +65 -0
- data/lib/baltix/source/gem.rb +65 -312
- data/lib/baltix/source/gemfile.rb +55 -5
- data/lib/baltix/source/rakefile.rb +12 -5
- data/lib/baltix/source.rb +36 -24
- data/lib/baltix/space/configuration.rb +54 -0
- data/lib/baltix/space/data/collections.rb +33 -0
- data/lib/baltix/space/data/gem_metadata.rb +79 -0
- data/lib/baltix/space/data/models.rb +20 -0
- data/lib/baltix/space/data/values.rb +72 -0
- data/lib/baltix/space/data.rb +53 -0
- data/lib/baltix/space/dependencies.rb +53 -0
- data/lib/baltix/space/filters.rb +96 -0
- data/lib/baltix/space/initialization.rb +124 -0
- data/lib/baltix/space/metadata.rb +130 -0
- data/lib/baltix/space/source_order.rb +43 -0
- data/lib/baltix/space/source_selection.rb +136 -0
- data/lib/baltix/space/source_status.rb +114 -0
- data/lib/baltix/space/spec.rb +3 -0
- data/lib/baltix/space.rb +87 -367
- data/lib/baltix/spec/rpm/aliases.rb +79 -0
- data/lib/baltix/spec/rpm/arch.rb +119 -0
- data/lib/baltix/spec/rpm/available_overrides.rb +106 -0
- data/lib/baltix/spec/rpm/build_dependencies.rb +132 -0
- data/lib/baltix/spec/rpm/build_queries.rb +61 -0
- data/lib/baltix/spec/rpm/changelog.rb +115 -0
- data/lib/baltix/spec/rpm/dependency_overrides.rb +83 -0
- data/lib/baltix/spec/rpm/dependency_policy.rb +69 -0
- data/lib/baltix/spec/rpm/deps.rb +113 -0
- data/lib/baltix/spec/rpm/env/requirements.rb +20 -0
- data/lib/baltix/spec/rpm/env.rb +76 -0
- data/lib/baltix/spec/rpm/executable_packages.rb +49 -0
- data/lib/baltix/spec/rpm/file_manifest.rb +72 -0
- data/lib/baltix/spec/rpm/guard_compilation.rb +95 -0
- data/lib/baltix/spec/rpm/imported_secondaries.rb +26 -0
- data/lib/baltix/spec/rpm/layout.rb +14 -0
- data/lib/baltix/spec/rpm/manpages.rb +71 -0
- data/lib/baltix/spec/rpm/metadata.rb +78 -0
- data/lib/baltix/spec/rpm/name/equality.rb +68 -0
- data/lib/baltix/spec/rpm/name/formatting.rb +33 -0
- data/lib/baltix/spec/rpm/name/parsing.rb +58 -0
- data/lib/baltix/spec/rpm/name.rb +77 -108
- data/lib/baltix/spec/rpm/packaged_versions.rb +107 -0
- data/lib/baltix/spec/rpm/parser/comments.rb +35 -0
- data/lib/baltix/spec/rpm/parser/context.rb +50 -0
- data/lib/baltix/spec/rpm/parser/dependencies.rb +91 -0
- data/lib/baltix/spec/rpm/parser/file_sections.rb +68 -0
- data/lib/baltix/spec/rpm/parser/flow.rb +84 -0
- data/lib/baltix/spec/rpm/parser/header_dependencies.rb +36 -0
- data/lib/baltix/spec/rpm/parser/macros.rb +43 -0
- data/lib/baltix/spec/rpm/parser/metadata.rb +106 -0
- data/lib/baltix/spec/rpm/parser/sections.rb +88 -0
- data/lib/baltix/spec/rpm/parser/values.rb +85 -0
- data/lib/baltix/spec/rpm/parser.rb +124 -269
- data/lib/baltix/spec/rpm/part_files.rb +64 -0
- data/lib/baltix/spec/rpm/part_prelude.rb +43 -0
- data/lib/baltix/spec/rpm/part_scripts.rb +52 -0
- data/lib/baltix/spec/rpm/part_switches.rb +65 -0
- data/lib/baltix/spec/rpm/pkglist/header.rb +73 -0
- data/lib/baltix/spec/rpm/pkglist/provides.rb +57 -0
- data/lib/baltix/spec/rpm/pkglist.rb +116 -0
- data/lib/baltix/spec/rpm/preparation.rb +73 -0
- data/lib/baltix/spec/rpm/rendering.rb +66 -0
- data/lib/baltix/spec/rpm/repository_application.rb +33 -0
- data/lib/baltix/spec/rpm/revision.rb +58 -0
- data/lib/baltix/spec/rpm/root_source.rb +48 -0
- data/lib/baltix/spec/rpm/scripts.rb +85 -0
- data/lib/baltix/spec/rpm/secondaries.rb +82 -0
- data/lib/baltix/spec/rpm/secondary.rb +117 -64
- data/lib/baltix/spec/rpm/secondary_parts.rb +84 -0
- data/lib/baltix/spec/rpm/section_document.rb +84 -0
- data/lib/baltix/spec/rpm/section_guards.rb +116 -0
- data/lib/baltix/spec/rpm/source_selection.rb +82 -0
- data/lib/baltix/spec/rpm/spec_core/architecture.rb +28 -0
- data/lib/baltix/spec/rpm/spec_core/attributes.rb +89 -0
- data/lib/baltix/spec/rpm/spec_core/availability.rb +60 -0
- data/lib/baltix/spec/rpm/spec_core/dependency_rendering.rb +83 -0
- data/lib/baltix/spec/rpm/spec_core/descriptions.rb +77 -0
- data/lib/baltix/spec/rpm/spec_core/documentation.rb +48 -0
- data/lib/baltix/spec/rpm/spec_core/executable_names.rb +37 -0
- data/lib/baltix/spec/rpm/spec_core/host_names.rb +60 -0
- data/lib/baltix/spec/rpm/spec_core/interpreters.rb +103 -0
- data/lib/baltix/spec/rpm/spec_core/names.rb +80 -0
- data/lib/baltix/spec/rpm/spec_core/obsoletes.rb +38 -0
- data/lib/baltix/spec/rpm/spec_core/package_dependencies.rb +74 -0
- data/lib/baltix/spec/rpm/spec_core/plain_dependencies.rb +60 -0
- data/lib/baltix/spec/rpm/spec_core/pre_name.rb +23 -0
- data/lib/baltix/spec/rpm/spec_core/provides.rb +104 -0
- data/lib/baltix/spec/rpm/spec_core/readme.rb +78 -0
- data/lib/baltix/spec/rpm/spec_core/registration.rb +18 -0
- data/lib/baltix/spec/rpm/spec_core/runtime_dependencies.rb +81 -0
- data/lib/baltix/spec/rpm/spec_core/summaries.rb +64 -0
- data/lib/baltix/spec/rpm/spec_core/text_wrapping.rb +36 -0
- data/lib/baltix/spec/rpm/spec_core/versioning.rb +75 -0
- data/lib/baltix/spec/rpm/spec_core/versions.rb +94 -0
- data/lib/baltix/spec/rpm/spec_core.rb +75 -527
- data/lib/baltix/spec/{rpm.erb → rpm/template.erb} +131 -31
- data/lib/baltix/spec/rpm.rb +253 -644
- data/lib/baltix/spec.rb +16 -14
- data/lib/baltix/target/gem.rb +61 -0
- data/lib/baltix/target/site.rb +40 -0
- data/lib/baltix/target.rb +16 -0
- data/lib/baltix/version.rb +3 -1
- data/lib/baltix.rb +77 -5
- data/locale/en_US.UTF-8.yaml +4 -1
- data/locale/ru_RU.UTF-8.yaml +7 -1
- data/rpm/baltix.env +4 -0
- data/rpm/baltix.prov +8 -0
- data/rpm/baltix.prov.files +6 -0
- data/rpm/baltix.req +8 -0
- data/rpm/baltix.req.files +6 -0
- data/rpm/macros.baltix +24 -0
- data/utils/rubocop/compact_block_braces.rb +39 -0
- data/utils/rubocop/spacing.rb +96 -0
- data/utils/update_alt_architectures.rb +57 -0
- data/utils/update_alt_licenses.rb +19 -0
- data/utils/update_spdx_licenses.rb +21 -0
- metadata +526 -17
- data/.github/workflows/ci.yml +0 -44
- data/.gitignore +0 -10
- data/TODO +0 -84
data/lib/baltix/actor/link.rb
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'baltix/concerns'
|
|
4
|
+
|
|
5
|
+
# Links selected files into the packaging tree.
|
|
1
6
|
module Baltix::Actor::Link
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class
|
|
7
|
+
extend Baltix::Concerns::FileDestination
|
|
8
|
+
|
|
9
|
+
class NoDestinationDirError < StandardError; end
|
|
10
|
+
class NoSourceDirError < StandardError; end
|
|
11
|
+
class NoFileError < StandardError; end
|
|
5
12
|
|
|
6
13
|
class << self
|
|
7
14
|
def apply context
|
|
@@ -11,10 +18,12 @@ module Baltix::Actor::Link
|
|
|
11
18
|
|
|
12
19
|
target_file = File.join(context['target_prefix'] || '', target_dir, file)
|
|
13
20
|
source_file = File.join(source_dir, file)
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
|
|
22
|
+
prepare_file_destination(target_file)
|
|
23
|
+
FileUtils.rm_f(target_file)
|
|
16
24
|
FileUtils.ln_s(source_file, target_file, force: true)
|
|
17
|
-
|
|
25
|
+
|
|
26
|
+
$stdout.puts(" #{source_file} -> #{target_file}")
|
|
18
27
|
end
|
|
19
28
|
end
|
|
20
29
|
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'baltix/action_flow'
|
|
4
|
+
|
|
5
|
+
# Coordinates config, extension compilation, documentation and dependency files.
|
|
6
|
+
module Baltix::Actor::Make
|
|
7
|
+
def self.context_kind
|
|
8
|
+
Baltix::Space
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.apply_to space
|
|
12
|
+
Baltix::ActionFlow.new(space).run('make')
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'fileutils'
|
|
4
|
+
|
|
5
|
+
# Stores one newline-separated dependency list under each actual RPM name.
|
|
6
|
+
module Baltix::Actor::Predeps::Write
|
|
7
|
+
extend Baltix::Concerns::FileDestination
|
|
8
|
+
|
|
9
|
+
class InvalidPackageNameError < StandardError; end
|
|
10
|
+
|
|
11
|
+
def self.apply root, directory, lists
|
|
12
|
+
path = File.join(root, directory.to_s)
|
|
13
|
+
|
|
14
|
+
FileUtils.mkdir_p(root)
|
|
15
|
+
validate_parent(root, File.join(path, 'dependency-list'))
|
|
16
|
+
FileUtils.mkdir_p(path)
|
|
17
|
+
|
|
18
|
+
lists.map do |name, values|
|
|
19
|
+
raise(InvalidPackageNameError, name) unless name.match?(/\A[[:alnum:]][[:alnum:]_.+-]*\z/)
|
|
20
|
+
|
|
21
|
+
file = File.join(path, name)
|
|
22
|
+
|
|
23
|
+
prepare_file_destination(file)
|
|
24
|
+
|
|
25
|
+
File.write(file, values.map {|value| "#{value}\n" }.join)
|
|
26
|
+
|
|
27
|
+
file
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.validate_parent root, file
|
|
32
|
+
directory = File.dirname(File.expand_path(file))
|
|
33
|
+
|
|
34
|
+
directory = File.dirname(directory) until File.exist?(directory) || File.symlink?(directory)
|
|
35
|
+
|
|
36
|
+
actual = File.realpath(directory)
|
|
37
|
+
boundary = File.realpath(root)
|
|
38
|
+
|
|
39
|
+
raise(Errno::EPERM, file) unless actual == boundary || actual.start_with?(File.join(boundary, ''))
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def self.remove root, files
|
|
43
|
+
files.each do |file|
|
|
44
|
+
next unless File.expand_path(file).start_with?(File.join(root, ''))
|
|
45
|
+
|
|
46
|
+
validate_parent(root, file)
|
|
47
|
+
|
|
48
|
+
FileUtils.rm_f(file) unless File.directory?(file) && !File.symlink?(file)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'baltix/deps'
|
|
4
|
+
require 'baltix/deps/packages'
|
|
5
|
+
|
|
6
|
+
# Writes setup-compatible per-RPM dependency files without changing dependency policy.
|
|
7
|
+
module Baltix::Actor::Predeps
|
|
8
|
+
def self.context_kind
|
|
9
|
+
Baltix::Space
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.apply_to space
|
|
13
|
+
space.prepare
|
|
14
|
+
|
|
15
|
+
view = Baltix::Deps::Packages.new(space)
|
|
16
|
+
root = File.expand_path(space.options.predep_dir || '/var/tmp')
|
|
17
|
+
outputs =
|
|
18
|
+
{ reqs: :requires, provs: :provides }.flat_map do |directory, kind|
|
|
19
|
+
Write.apply(root, directory, view.lists(kind))
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
tracked = reconcile(space, root, outputs)
|
|
23
|
+
|
|
24
|
+
space.state.predep_results = { root: root, outputs: tracked }
|
|
25
|
+
|
|
26
|
+
outputs
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.reconcile space, root, outputs
|
|
30
|
+
previous = space.state.predep_results
|
|
31
|
+
|
|
32
|
+
return outputs unless previous && previous[:root] == root
|
|
33
|
+
return previous[:outputs] | outputs if space.options.package
|
|
34
|
+
|
|
35
|
+
Write.remove(root, previous[:outputs] - outputs)
|
|
36
|
+
|
|
37
|
+
outputs
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
require 'baltix/actor/predeps/write'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'baltix/concerns/dependency_output'
|
|
4
|
+
|
|
5
|
+
# Prints enabled RPM capabilities using the spec's exact provided versions.
|
|
6
|
+
module Baltix::Actor::Provides
|
|
7
|
+
extend Baltix::Concerns::DependencyOutput
|
|
8
|
+
|
|
9
|
+
def self.apply_to space
|
|
10
|
+
dependency_output(space, :provides)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'baltix/concerns/dependency_output'
|
|
4
|
+
|
|
5
|
+
# Prints enabled RPM package requirements using current spec metadata.
|
|
6
|
+
module Baltix::Actor::Requires
|
|
7
|
+
extend Baltix::Concerns::DependencyOutput
|
|
8
|
+
|
|
9
|
+
def self.apply_to space
|
|
10
|
+
dependency_output(space, :requires)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'baltix/concerns/inspection'
|
|
4
|
+
|
|
5
|
+
# Displays prepared configuration and concrete source/target paths without a spec.
|
|
6
|
+
module Baltix::Actor::Show
|
|
7
|
+
extend Baltix::Concerns::Inspection
|
|
8
|
+
|
|
9
|
+
def self.apply_to space
|
|
10
|
+
inspect_space(space) do
|
|
11
|
+
data = { rootdir: space.rootdir, options: space.options.to_h,
|
|
12
|
+
targets: space.targets.map {|target| describe_target(target) }}
|
|
13
|
+
|
|
14
|
+
write_output(space, data.to_yaml)
|
|
15
|
+
|
|
16
|
+
data
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.describe_target target
|
|
21
|
+
{ source: target.source.source_file, name: target.source.name, type: target.source.type,
|
|
22
|
+
paths: %i[chroot libdir datadir exedir public_bindir dldir ridir incdir mandir].to_h do |name|
|
|
23
|
+
[name, target.public_send(name)]
|
|
24
|
+
end }
|
|
25
|
+
end
|
|
26
|
+
end
|
data/lib/baltix/actor/spec.rb
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# vim: noai:ts=3:sts=3:et:sw=3
|
|
2
4
|
# Actor spec
|
|
3
5
|
require 'baltix/spec'
|
|
4
6
|
|
|
7
|
+
# Renders a packaging specification from the project space.
|
|
5
8
|
module Baltix::Actor::Spec
|
|
6
9
|
class << self
|
|
7
10
|
def context_kind
|
|
@@ -11,13 +14,13 @@ module Baltix::Actor::Spec
|
|
|
11
14
|
# +apply_to+ generates spec according to the provided setup
|
|
12
15
|
#
|
|
13
16
|
def apply_to space, template = nil
|
|
17
|
+
space.prepare
|
|
18
|
+
|
|
14
19
|
spec = Baltix::Spec.find(space.spec_type)
|
|
15
20
|
|
|
16
21
|
rendered = spec.render(space, template)
|
|
17
22
|
|
|
18
|
-
if space.options.output_file
|
|
19
|
-
File.open(space.options.output_file, "w") { |f| f.puts(rendered) }
|
|
20
|
-
end
|
|
23
|
+
File.open(space.options.output_file, 'w') {|f| f.puts(rendered) } if space.options.output_file
|
|
21
24
|
|
|
22
25
|
rendered
|
|
23
26
|
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Retains the real process outcome independently of the action's soft true result.
|
|
4
|
+
module Baltix::Actor::Test::Record
|
|
5
|
+
def self.apply space, context, result
|
|
6
|
+
space.state.test_results << result.merge(script: context[:script])
|
|
7
|
+
end
|
|
8
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'bundler'
|
|
4
|
+
|
|
5
|
+
# Runs the selected script, logging command failures without failing the test action.
|
|
6
|
+
module Baltix::Actor::Test::Run
|
|
7
|
+
extend Baltix::Concerns::Command
|
|
8
|
+
|
|
9
|
+
def self.apply context
|
|
10
|
+
Bundler.with_unbundled_env { run_command(context, arguments(context)) }
|
|
11
|
+
rescue Baltix::Concerns::Command::Failure => error
|
|
12
|
+
error(error.message)
|
|
13
|
+
|
|
14
|
+
error.result
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.arguments context
|
|
18
|
+
[*interpreter(context), context[:script]]
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.interpreter context
|
|
22
|
+
options = context[:options]
|
|
23
|
+
|
|
24
|
+
if context[:script].end_with?('.rb')
|
|
25
|
+
command_arguments(options.rubyprog, [RbConfig.ruby])
|
|
26
|
+
else
|
|
27
|
+
command_arguments(options.shellprog, ['bash'])
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Keeps setup's Ruby-before-shell script priority and legacy diagnostic.
|
|
4
|
+
module Baltix::Actor::Test::Select
|
|
5
|
+
extend Baltix::Log
|
|
6
|
+
|
|
7
|
+
def self.apply context
|
|
8
|
+
root = context[:directory]
|
|
9
|
+
|
|
10
|
+
warn('Use .setup/test.rb instead of the deprecated .setup/testrc.rb') if File.exist?(
|
|
11
|
+
File.join(root, '.setup/testrc.rb')
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
%w[.setup/test.rb .setup/test.sh].find {|path| File.file?(File.join(root, path)) }
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'baltix/concerns'
|
|
4
|
+
|
|
5
|
+
# Coordinates real setup-compatible test scripts while retaining their actual outcome.
|
|
6
|
+
module Baltix::Actor::Test
|
|
7
|
+
extend Baltix::Concerns::Parts
|
|
8
|
+
|
|
9
|
+
def self.context_kind
|
|
10
|
+
Baltix::Space
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def self.apply_to space
|
|
14
|
+
space.prepare
|
|
15
|
+
|
|
16
|
+
space.state.test_results = []
|
|
17
|
+
|
|
18
|
+
return true unless part_enabled?(space.options, :check) && !space.options.no_test
|
|
19
|
+
|
|
20
|
+
context = script_context(space)
|
|
21
|
+
|
|
22
|
+
return true unless context[:script]
|
|
23
|
+
|
|
24
|
+
Record.apply(space, context, Run.apply(context))
|
|
25
|
+
|
|
26
|
+
true
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.script_context space
|
|
30
|
+
context = { directory: space.rootdir, options: space.options,
|
|
31
|
+
environment: (space.options.test_environment || {}).to_h, commands: [] }
|
|
32
|
+
|
|
33
|
+
context[:script] = Select.apply(context)
|
|
34
|
+
|
|
35
|
+
context
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
require 'baltix/actor/test/select'
|
|
40
|
+
require 'baltix/actor/test/run'
|
|
41
|
+
require 'baltix/actor/test/record'
|
data/lib/baltix/actor/touch.rb
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'baltix/concerns'
|
|
4
|
+
|
|
5
|
+
# Creates placeholder files requested by the packaging scheme.
|
|
1
6
|
module Baltix::Actor::Touch
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class
|
|
7
|
+
extend Baltix::Concerns::FileDestination
|
|
8
|
+
|
|
9
|
+
class NoDestinationDirError < StandardError; end
|
|
10
|
+
class NoSourceDirError < StandardError; end
|
|
11
|
+
class NoFileError < StandardError; end
|
|
5
12
|
|
|
6
13
|
class << self
|
|
7
14
|
def apply context
|
|
@@ -9,9 +16,11 @@ module Baltix::Actor::Touch
|
|
|
9
16
|
file = context['file'] || raise(NoFileError)
|
|
10
17
|
|
|
11
18
|
target_file = File.join(context['target_prefix'] || '', target_dir, file)
|
|
12
|
-
|
|
19
|
+
|
|
20
|
+
prepare_file_destination(target_file)
|
|
13
21
|
FileUtils.touch(target_file)
|
|
14
|
-
|
|
22
|
+
|
|
23
|
+
$stdout.puts(" >> #{target_file}")
|
|
15
24
|
end
|
|
16
25
|
end
|
|
17
26
|
end
|
data/lib/baltix/actor.rb
CHANGED
|
@@ -1,51 +1,66 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'rubygems'
|
|
2
4
|
|
|
5
|
+
# Discovers and dispatches packaging actions.
|
|
3
6
|
module Baltix::Actor
|
|
4
7
|
class InvalidActorKindError < StandardError; end
|
|
5
8
|
class InvalidContextKindForActorError < StandardError; end
|
|
6
9
|
|
|
7
|
-
Gem.load_yaml
|
|
8
|
-
|
|
9
10
|
AUTOMAP = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
Config: 'baltix/actor/config',
|
|
12
|
+
Spec: 'baltix/actor/spec',
|
|
13
|
+
Build: 'baltix/actor/build',
|
|
14
|
+
Doc: 'baltix/actor/doc',
|
|
15
|
+
Test: 'baltix/actor/test',
|
|
16
|
+
Install: 'baltix/actor/install',
|
|
17
|
+
Gen: 'baltix/actor/gen',
|
|
18
|
+
Show: 'baltix/actor/show',
|
|
19
|
+
Requires: 'baltix/actor/requires',
|
|
20
|
+
Provides: 'baltix/actor/provides',
|
|
21
|
+
Predeps: 'baltix/actor/predeps',
|
|
22
|
+
Clean: 'baltix/actor/clean',
|
|
23
|
+
Distclean: 'baltix/actor/distclean',
|
|
24
|
+
Make: 'baltix/actor/make',
|
|
25
|
+
Link: 'baltix/actor/link',
|
|
26
|
+
Touch: 'baltix/actor/touch',
|
|
27
|
+
Copy: 'baltix/actor/copy'
|
|
28
|
+
}.freeze
|
|
15
29
|
|
|
16
30
|
class << self
|
|
17
31
|
def kinds
|
|
18
|
-
@kinds ||= AUTOMAP.keys.map(&:to_s).map(&:downcase)
|
|
32
|
+
@kinds ||= AUTOMAP.keys.map(&:to_s).map!(&:downcase)
|
|
19
33
|
end
|
|
20
34
|
|
|
21
35
|
def actors
|
|
22
|
-
@actors ||=
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
36
|
+
@actors ||=
|
|
37
|
+
AUTOMAP.keys.to_h do |const|
|
|
38
|
+
require(AUTOMAP[const])
|
|
39
|
+
[const.to_s.downcase, const_get(const)]
|
|
40
|
+
end
|
|
26
41
|
end
|
|
27
42
|
|
|
28
43
|
def scheme
|
|
29
|
-
@scheme ||=
|
|
44
|
+
@scheme ||= Baltix.load(File.read(File.join(File.dirname(__FILE__), 'scheme.erb.yaml')))
|
|
30
45
|
end
|
|
31
46
|
|
|
32
47
|
def config
|
|
33
48
|
@config ||= ObjectSpace.each_object(Baltix::Configuration).first
|
|
34
49
|
end
|
|
35
50
|
|
|
36
|
-
def procline file
|
|
37
|
-
scheme.
|
|
38
|
-
match
|
|
51
|
+
def procline file, &block
|
|
52
|
+
scheme.filter_map do |rule|
|
|
53
|
+
next unless !rule['match'] || /#{rule['match']}$/ =~ file
|
|
39
54
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
rule['proc'].map {|data| process_rule(data, &block) }
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def process_rule data
|
|
60
|
+
context = ERB.new(data['context'].to_yaml)
|
|
61
|
+
result = yield(data['actor'], context)
|
|
62
|
+
|
|
63
|
+
result.merge('$' => actors[data['actor']])
|
|
49
64
|
end
|
|
50
65
|
|
|
51
66
|
def objectize target
|
|
@@ -53,7 +68,7 @@ module Baltix::Actor
|
|
|
53
68
|
h.map do |dir, files|
|
|
54
69
|
files.map do |file|
|
|
55
70
|
procline(file) do |actor, context_in|
|
|
56
|
-
|
|
71
|
+
Baltix.load(context_in.result(binding))
|
|
57
72
|
end
|
|
58
73
|
end
|
|
59
74
|
end
|
|
@@ -62,6 +77,7 @@ module Baltix::Actor
|
|
|
62
77
|
|
|
63
78
|
def for! task, context
|
|
64
79
|
actor = actors[task.to_s] || raise(InvalidActorKindError)
|
|
80
|
+
|
|
65
81
|
actor.context_kind == context.class || raise(InvalidContextKindForActorError)
|
|
66
82
|
|
|
67
83
|
actor
|
|
@@ -70,6 +86,7 @@ module Baltix::Actor
|
|
|
70
86
|
def for task, context
|
|
71
87
|
for!(task, context)
|
|
72
88
|
rescue InvalidActorKindError
|
|
89
|
+
nil # An absent optional metadata value is allowed.
|
|
73
90
|
end
|
|
74
91
|
end
|
|
75
92
|
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Applies dependency options parsed from the command line.
|
|
4
|
+
class Baltix::CLI
|
|
5
|
+
private
|
|
6
|
+
|
|
7
|
+
def option_devel_dep_baltix type
|
|
8
|
+
options.devel_dep_baltix = type
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def option_available_gem_list_file file
|
|
12
|
+
@file_available_gems = Baltix.load(File.read(file)).to_h.transform_keys(&:to_s)
|
|
13
|
+
options.available_gem_list = @file_available_gems.to_os
|
|
14
|
+
|
|
15
|
+
merge_available_indexes if @pkglist_available_gems
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def option_pkglist files
|
|
19
|
+
@initial_available_gems ||= options.available_gem_list.to_h.transform_keys(&:to_s)
|
|
20
|
+
@pkglist_paths = ((@pkglist_paths || []) | files)
|
|
21
|
+
reader = Baltix::Pkglist::Reader.new
|
|
22
|
+
@pkglist_available_gems = reader.read(@pkglist_paths)
|
|
23
|
+
|
|
24
|
+
reader.warnings.each {|message| Kernel.warn(message) }
|
|
25
|
+
|
|
26
|
+
merge_available_indexes
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def option_license_replacement_list file
|
|
30
|
+
options.license_replacement_list = Baltix::License.replacement_map(Baltix.load(File.read(file))).to_os
|
|
31
|
+
rescue ArgumentError, TypeError => error
|
|
32
|
+
raise(OptionParser::InvalidArgument, error.message)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def option_default_license license
|
|
36
|
+
raise(OptionParser::InvalidArgument, 'empty default license') if license.strip.empty?
|
|
37
|
+
|
|
38
|
+
options.default_license = license.strip
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def option_gem_dependency_mode mode
|
|
42
|
+
options.gem_dependency_mode = mode == :all ? :'no-upper' : mode
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def option_use_gem_version gem_version
|
|
46
|
+
hash = gem_version.to_h {|gv| gv.split(':') }
|
|
47
|
+
options.use_gem_version_list = options.use_gem_version_list.merge(hash)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def option_use_gem_obsolete gem_obsolete
|
|
51
|
+
hash =
|
|
52
|
+
gem_obsolete.to_h do |entry|
|
|
53
|
+
name, aliases = entry.split(':')
|
|
54
|
+
|
|
55
|
+
[name, aliases.split(',')]
|
|
56
|
+
end
|
|
57
|
+
options.use_gem_obsolete_list = options.use_gem_obsolete_list.merge(hash)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def option_use_high_default_dependencies_priority d
|
|
61
|
+
options.high_default_dependencies_priority = d
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'baltix/spec'
|
|
4
|
+
|
|
5
|
+
# Assigns explicit action options without a parallel configuration object.
|
|
6
|
+
class Baltix::CLI
|
|
7
|
+
ACTION_OPTIONS = %i[with_parts install_prefix gem_home bindir libexecdir includedir mandir ridir
|
|
8
|
+
shebang rubyprog makeprog makeopt extconfopt rdocopt compress_manpages
|
|
9
|
+
verify_output_checksums].freeze
|
|
10
|
+
|
|
11
|
+
private
|
|
12
|
+
|
|
13
|
+
def option_rpm_env _enabled
|
|
14
|
+
Baltix::Spec::Rpm::Env.new.apply(options) {|handler, value| send(handler, value) }
|
|
15
|
+
|
|
16
|
+
options.rpm_env = true
|
|
17
|
+
rescue ArgumentError => error
|
|
18
|
+
raise(OptionParser::InvalidArgument, error.message)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def load_action_space requested
|
|
22
|
+
root = requested.rootdir || Dir.pwd
|
|
23
|
+
requested.rpm_env = requested.rpm_env == true
|
|
24
|
+
@space = Baltix::Space.load_from(state: File.join(root, '.space'), options: requested)
|
|
25
|
+
|
|
26
|
+
Baltix::Spec::Rpm::Env.restore_package_identity(space.options, requested) if requested.rpm_package_name
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
ACTION_OPTIONS.each do |name|
|
|
30
|
+
define_method("option_#{name}") {|value| options[name] = value }
|
|
31
|
+
end
|
|
32
|
+
end
|