simp-rake-helpers 5.11.6 → 5.12.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +49 -0
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +0 -3
- data/README.md +3 -38
- data/Rakefile +2 -3
- data/lib/simp/command_utils.rb +21 -0
- data/lib/simp/local_gpg_signing_key.rb +128 -79
- data/lib/simp/rake/build/auto.rb +4 -2
- data/lib/simp/rake/build/build.rb +5 -4
- data/lib/simp/rake/build/iso.rb +57 -31
- data/lib/simp/rake/build/pkg.rb +118 -56
- data/lib/simp/rake/build/spec.rb +1 -1
- data/lib/simp/rake/build/tar.rb +1 -1
- data/lib/simp/rake/build/unpack.rb +1 -1
- data/lib/simp/rake/build/upload.rb +1 -1
- data/lib/simp/rake/build/vermap.yaml +1 -1
- data/lib/simp/rake/helpers/assets/rpm_spec/simp6.spec +3 -3
- data/lib/simp/rake/helpers/assets/rpm_spec/simpdefault.spec +3 -3
- data/lib/simp/rake/helpers/version.rb +1 -1
- data/lib/simp/rake/helpers.rb +2 -2
- data/lib/simp/rake/pkg.rb +5 -1
- data/lib/simp/rake/pupmod/helpers.rb +2 -0
- data/lib/simp/rake/rubygem.rb +5 -1
- data/lib/simp/rake.rb +3 -17
- data/lib/simp/rpm.rb +10 -127
- data/lib/simp/rpm_signer.rb +321 -0
- data/spec/acceptance/nodesets/default.yml +0 -3
- data/spec/acceptance/{00_pkg_rpm_custom_scriptlets_spec.rb → suites/default/00_pkg_rpm_custom_scriptlets_spec.rb} +21 -22
- data/spec/acceptance/{10_pkg_rpm_spec.rb → suites/default/10_pkg_rpm_spec.rb} +50 -52
- data/spec/acceptance/{30_pkg_misc_spec.rb → suites/default/30_pkg_misc_spec.rb} +1 -1
- data/spec/acceptance/{50_local_gpg_signing_key_spec.rb → suites/default/50_local_gpg_signing_key_spec.rb} +7 -3
- data/spec/acceptance/suites/default/55_build_pkg_signing_spec.rb +391 -0
- data/spec/acceptance/{development → suites/default/development}/docker_env.sh +0 -0
- data/spec/acceptance/{development → suites/default/development}/rerun_acceptance_tests.sh +0 -0
- data/spec/acceptance/{development → suites/default/development}/vagrant_rsync.sh +0 -0
- data/spec/acceptance/{files → suites/default/files}/asset/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/asset/build/asset.spec +0 -0
- data/spec/acceptance/{files → suites/default/files}/asset_with_misordered_entries/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/asset_with_misordered_entries/build/asset_with_misordered_entries.spec +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/RPM-GPG-KEY-SIMP-Dev +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/gengpgkey +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/pubring.gpg +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/random_seed +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/run_gpg_agent +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/secring.gpg +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/trustdb.gpg +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/Puppetfile.tracking +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/README.md +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/src/assets/simp/build/simp.spec +0 -0
- data/spec/acceptance/{files → suites/default/files}/module/CHANGELOG +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-new-package-2.1 → suites/default/files/module}/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/module/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/module_with_misordered_entries/CHANGELOG +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-new-package-3.0 → suites/default/files/module_with_misordered_entries}/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/module_with_misordered_entries/metadata.json +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-new-package-2.1 → suites/default/files/simplib}/CHANGELOG +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-1.0 → suites/default/files/simplib}/Rakefile +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-1.0 → suites/default/files/simplib}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/simplib/metadata.json +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-new-package-3.0 → suites/default/files/testpackage}/CHANGELOG +0 -0
- data/spec/acceptance/suites/default/files/testpackage/README +8 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-2.0 → suites/default/files/testpackage}/Rakefile +0 -0
- data/spec/acceptance/{files/package_upgrades/pupmod-simp-testpackage-1.0 → suites/default/files/testpackage}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage/metadata.json +0 -0
- data/spec/acceptance/suites/default/files/testpackage/spec/classes/init_spec.rb +1 -0
- data/spec/acceptance/suites/default/files/testpackage/spec/files/mock_something.rb +3 -0
- data/spec/acceptance/suites/default/files/testpackage/utils/convert_v1_to_v2.rb +3 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-1.0 → suites/default/files/testpackage_custom_scriptlet}/CHANGELOG +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-2.2 → suites/default/files/testpackage_custom_scriptlet}/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/build/rpm_metadata/custom/overrides +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-2.0 → suites/default/files/testpackage_custom_scriptlet}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/metadata.json +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-2.0 → suites/default/files/testpackage_missing_license}/CHANGELOG +0 -0
- data/spec/acceptance/{files/module → suites/default/files/testpackage_missing_license}/Rakefile +0 -0
- data/spec/acceptance/{files/simplib → suites/default/files/testpackage_missing_license}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_license/metadata.json +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-2.2 → suites/default/files/testpackage_missing_metadata_file}/CHANGELOG +0 -0
- data/spec/acceptance/{files/module_with_misordered_entries → suites/default/files/testpackage_missing_metadata_file}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_custom_scriptlet → suites/default/files/testpackage_missing_metadata_file}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files/simplib → suites/default/files/testpackage_missing_name}/CHANGELOG +0 -0
- data/spec/acceptance/{files/package_upgrades/pupmod-simp-testpackage-1.0 → suites/default/files/testpackage_missing_name}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_missing_license → suites/default/files/testpackage_missing_name}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_name/metadata.json +0 -0
- data/spec/acceptance/{files/testpackage → suites/default/files/testpackage_missing_source}/CHANGELOG +0 -0
- data/spec/acceptance/{files/package_upgrades/pupmod-simp-testpackage-2.0 → suites/default/files/testpackage_missing_source}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_missing_metadata_file → suites/default/files/testpackage_missing_source}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_source/metadata.json +0 -0
- data/spec/acceptance/{files/testpackage_custom_scriptlet → suites/default/files/testpackage_missing_summary}/CHANGELOG +0 -0
- data/spec/acceptance/{files/simplib → suites/default/files/testpackage_missing_summary}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_missing_name → suites/default/files/testpackage_missing_summary}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_summary/metadata.json +0 -0
- data/spec/acceptance/{files/testpackage_missing_license → suites/default/files/testpackage_missing_version}/CHANGELOG +0 -0
- data/spec/acceptance/{files/testpackage → suites/default/files/testpackage_missing_version}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_missing_source → suites/default/files/testpackage_missing_version}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_version/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_bad_changelog_date/CHANGELOG +0 -0
- data/spec/acceptance/{files/testpackage_custom_scriptlet → suites/default/files/testpackage_with_bad_changelog_date}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_missing_summary → suites/default/files/testpackage_with_bad_changelog_date}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_bad_changelog_date/metadata.json +0 -0
- data/spec/acceptance/{files/testpackage_missing_metadata_file → suites/default/files/testpackage_with_release}/CHANGELOG +0 -0
- data/spec/acceptance/{files/testpackage_missing_license → suites/default/files/testpackage_with_release}/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/build/rpm_metadata/release +0 -0
- data/spec/acceptance/{files/testpackage_missing_version → suites/default/files/testpackage_with_release}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/metadata.json +0 -0
- data/spec/acceptance/{files/testpackage_missing_metadata_file → suites/default/files/testpackage_without_changelog}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_with_bad_changelog_date → suites/default/files/testpackage_without_changelog}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_without_changelog/metadata.json +0 -0
- data/spec/acceptance/{support → suites/default/support}/build_project_helpers.rb +33 -9
- data/spec/acceptance/{support → suites/default/support}/build_user_helpers.rb +0 -0
- data/spec/acceptance/{support → suites/default/support}/pkg_rpm_helpers.rb +0 -0
- data/spec/lib/simp/command_utils_spec.rb +29 -0
- data/spec/lib/simp/local_gpg_signing_key_spec.rb.beaker-only +115 -18
- data/spec/lib/simp/rake/pupmod/fixtures/simpmod/README.md +2 -2
- data/spec/lib/simp/rpm_signer_spec.rb +98 -0
- data/spec/lib/simp/rpm_spec.rb +0 -6
- data/spec/spec_helper_acceptance.rb +4 -0
- metadata +92 -149
- data/.travis.yml +0 -41
- data/lib/simp/rake/helpers/assets/rpm_spec/simp4.spec +0 -388
- data/lib/simp/rake/helpers/assets/rpm_spec/simp5.spec +0 -388
- data/spec/acceptance/20_pkg_rpm_upgrade_spec.rb +0 -236
- data/spec/acceptance/55_build_pkg_signing_spec.rb +0 -140
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-2.1/build/rpm_metadata/custom/overrides +0 -14
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-2.1/build/rpm_metadata/requires +0 -1
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-2.1/metadata.json +0 -33
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-3.0/build/rpm_metadata/custom/overrides +0 -14
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-3.0/build/rpm_metadata/requires +0 -1
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-3.0/metadata.json +0 -33
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-1.0/metadata.json +0 -33
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-2.0/metadata.json +0 -33
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-2.2/build/rpm_metadata/custom/overrides +0 -14
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-2.2/build/rpm_metadata/requires +0 -1
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-2.2/metadata.json +0 -33
- data/spec/acceptance/files/mock_packages/pupmod-puppetlabs-stdlib.spec +0 -32
- data/spec/acceptance/files/mock_packages/pupmod-simp-foo.spec +0 -32
- data/spec/acceptance/files/mock_packages/pupmod-simp-simplib.spec +0 -32
- data/spec/acceptance/files/mock_packages/rpmbuild.sh +0 -25
- data/spec/acceptance/files/mock_packages/simp-adapter/etc/simp/adapter_config.yaml +0 -3
- data/spec/acceptance/files/mock_packages/simp-adapter/usr/local/sbin/simp_rpm_helper +0 -495
- data/spec/acceptance/files/mock_packages/simp-adapter.spec +0 -43
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/CHANGELOG +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/data/os/CentOS.yaml +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/data/os/RedHat.yaml +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/hiera.yaml +0 -14
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/manifests/init.pp +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/metadata.json +0 -37
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/CHANGELOG +0 -5
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/build/rpm_metadata/requires +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/data/os/CentOS.yaml +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/data/os/RedHat.yaml +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/hiera.yaml +0 -14
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/manifests/init.pp +0 -3
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/metadata.json +0 -37
- data/spec/acceptance/files/testpackage/build/rpm_metadata/requires +0 -2
- data/spec/acceptance/files/testpackage_missing_name/CHANGELOG +0 -2
- data/spec/acceptance/files/testpackage_missing_name/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_missing_source/CHANGELOG +0 -2
- data/spec/acceptance/files/testpackage_missing_source/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_missing_summary/CHANGELOG +0 -2
- data/spec/acceptance/files/testpackage_missing_summary/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_missing_version/CHANGELOG +0 -2
- data/spec/acceptance/files/testpackage_missing_version/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_with_bad_changelog_date/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_with_release/CHANGELOG +0 -2
- data/spec/acceptance/files/testpackage_with_release/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_with_release/build/rpm_metadata/requires +0 -1
- data/spec/acceptance/files/testpackage_without_changelog/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_without_changelog/build/rpm_metadata/requires +0 -1
- data/spec/lib/simp/ci/files/job_broken_link_nodeset/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/job_invalid_nodeset/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/job_invalid_suite/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/job_missing_nodeset/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/job_missing_suite_and_nodeset/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/no_gitlab_config_with_tests/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/no_gitlab_config_without_tests/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/suite_skeleton_only/spec/acceptance/nodesets/default.yml +0 -1
- data/spec/lib/simp/ci/files/suite_skeleton_only/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/valid_job_nodeset_dir_link/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/valid_job_nodeset_link/spec/acceptance/suites/default/nodesets/default.yml +0 -1
- data/spec/lib/simp/files/build/testpackage.spec +0 -1
- data/spec/lib/simp/rake/pupmod/fixtures/simpmod/spec/acceptance/nodesets/default.yml +0 -1
- data/spec/lib/simp/rake/pupmod/fixtures/simpmod/spec/acceptance/suites/default/nodesets +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33beb8e656840401f0fb3a07f7aee982fe3931d53b2e233f2e0024398fd03d6c
|
4
|
+
data.tar.gz: 81111ce62e4e8b3ca03a478d765e3944ee8b297af7b2ee1ef5e182e8bacf36f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9589c0d228dc77b2e75a641f158ca878c56498566696039c71eca0c414078299c2a7c4951cf48d45e0388b9cb72a1615321381084a11837fbbc42259a65ea880
|
7
|
+
data.tar.gz: 4267702fa365999433e673f26ff0896ad9a088ea7ce7ae26fff38bbc4d9c37b1c6239956bc016644ea8b2aa3b10925989f44fbb178a3d611380eb79db4b5cc6e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,52 @@
|
|
1
|
+
### 5.12.3 / 2021-09-15
|
2
|
+
- Handle multiple options for required applications in build:auto
|
3
|
+
- Allow users to populate a `reposync` directory in the YUM build space that
|
4
|
+
will overwrite any target directories on the ISO.
|
5
|
+
- The SIMP tarball is unpacked after the copy so you always get the latest
|
6
|
+
built artifacts.
|
7
|
+
- Pruning will not occur if this technique is used since it is presumed that
|
8
|
+
you are overwriting the data with authoritative content.
|
9
|
+
- Added a helpful tip about updating vermap.yaml
|
10
|
+
- Fixed the call to repoclosure if on a system with DNF
|
11
|
+
- Added support for EL8 to vermap.yaml
|
12
|
+
|
13
|
+
### 5.12.2 / 2021-06-22
|
14
|
+
- Change to '-1' from '-0' as the default RPM release
|
15
|
+
|
16
|
+
### 5.12.1 / 2021-05-27
|
17
|
+
- Default `@build_dir` to `@distro_build_dir` in build tasks
|
18
|
+
- Use `file --keep-going` in the **unpack** task's ISO validation check. This
|
19
|
+
allows the check to work from EL8-based systems, where `ISO 9660 CD-ROM
|
20
|
+
filesystem data` is not the first match.
|
21
|
+
|
22
|
+
### 5.12.0 / 2021-02-16
|
23
|
+
- Ensure that pkg:install_gem uses the correct documentation options for the
|
24
|
+
version of Ruby in use.
|
25
|
+
- Disable brp-mangle-shebangs when building RPMs.
|
26
|
+
- Mitigated problem where gpg-agent daemon fails to start because
|
27
|
+
its socket path is longer than 108 characters.
|
28
|
+
- Changed the default location of the GPG keys directory used in the
|
29
|
+
pkg:key_prep and pkg:signrpms Rake tasks to <base_dir>/.dev_gpgkeys.
|
30
|
+
- Added a SIMP_PKG_build_keys_dir environment variable that overrides
|
31
|
+
the default location of the GPG keys directory used in the
|
32
|
+
pkg:key_prep and pkg:signrpms Rake tasks.
|
33
|
+
- Added SIMP_PKG_rpmsign_timeout environment variable that overrides
|
34
|
+
default timeout in seconds to wait for an individual RPM signing
|
35
|
+
operation to complete.
|
36
|
+
- Default timeout is 30 seconds.
|
37
|
+
- Most relevant when signing on RPMs on EL8 and the gpg-agent
|
38
|
+
started by rpmsign fails to start, but rpmsign does not detect
|
39
|
+
the failure and hangs.
|
40
|
+
- Improved pkg:signrpms error handling and reporting.
|
41
|
+
- Fixed bug in GPG handling for GPG 2.1+ in which an existing
|
42
|
+
GPG key that was not cached internally was not detected.
|
43
|
+
- Fixed bug where pkg:signrpms failed to sign RPMs on EL8.
|
44
|
+
- Fixed bug where pkg:checksig reported failure on EL8, even when
|
45
|
+
the signatures were valid.
|
46
|
+
- Deprecated the following top-level Rake tasks for Puppet modules:
|
47
|
+
- compare_latest_tag: use pkg:compare_latest_tag instead
|
48
|
+
- changelog_annotation: use pkg:create_tag_changelog instead
|
49
|
+
|
1
50
|
### 5.11.6 / 2021-02-03
|
2
51
|
* Fix GPG handling for GPG 2.1+
|
3
52
|
|
data/CONTRIBUTING.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
## Contributing
|
2
2
|
|
3
|
-
Please refer to the main [SIMP Project Contributing Guide](https://
|
3
|
+
Please refer to the main [SIMP Project Contributing Guide](https://simp-doc.readthedocs.io/en/stable/contributors_guide/index.html)
|
4
4
|
for details on contributing to this project.
|
data/Gemfile
CHANGED
@@ -13,9 +13,6 @@ gem 'simp-build-helpers'
|
|
13
13
|
gem 'simp-beaker-helpers'
|
14
14
|
gem 'beaker-puppet_install_helper'
|
15
15
|
gem 'rake', '>= 12.3.3'
|
16
|
-
# You'll need the following if using podman until they are released upstream
|
17
|
-
#gem 'beaker-docker', :git => 'https://github.com/trevor-vaughan/beaker-docker', :branch => 'support_rootless_podman'
|
18
|
-
#gem 'docker-api', :git => 'https://github.com/trevor-vaughan/docker-api', :branch => 'podman-compat'
|
19
16
|
gem 'beaker-docker'
|
20
17
|
|
21
18
|
if puppetversion
|
data/README.md
CHANGED
@@ -26,7 +26,6 @@
|
|
26
26
|
* [`rake pkg:rpm`](#rake-pkgrpm)
|
27
27
|
* [`rake pkg:tar`](#rake-pkgtar)
|
28
28
|
* [Limitations](#limitations)
|
29
|
-
* [Some versions of bundler fail on FIPS-enabled Systems](#some-versions-of-bundler-fail-on-fips-enabled-systems)
|
30
29
|
* [Development](#development)
|
31
30
|
* [License](#license)
|
32
31
|
* [History](#history)
|
@@ -39,7 +38,7 @@ The `simp-rake-helpers` gem provides common Rake tasks to support the SIMP build
|
|
39
38
|
|
40
39
|
### This gem is part of SIMP
|
41
40
|
|
42
|
-
This gem is part of (the build tooling for) the [System Integrity Management Platform](https://
|
41
|
+
This gem is part of (the build tooling for) the [System Integrity Management Platform](https://simp-project.com), a compliance-management framework built on [Puppet](https://puppetlabs.com/).
|
43
42
|
|
44
43
|
|
45
44
|
### Features
|
@@ -66,25 +65,6 @@ group :test do
|
|
66
65
|
gem 'puppet', puppetversion
|
67
66
|
gem 'beaker-rspec'
|
68
67
|
gem 'vagrant-wrapper'
|
69
|
-
|
70
|
-
# Puppet 4+ has issues with Hiera 3.1+
|
71
|
-
if puppetversion.to_s =~ />(\d+)/
|
72
|
-
pversion = $1
|
73
|
-
else
|
74
|
-
pversion = puppetversion
|
75
|
-
end
|
76
|
-
|
77
|
-
if Gem::Dependency.new('puppet', '~> 4.0').match?('puppet', pversion)
|
78
|
-
gem 'hiera', '~> 3.0.0'
|
79
|
-
end
|
80
|
-
|
81
|
-
# simp-rake-helpers does not suport puppet 2.7.X
|
82
|
-
if "#{ENV['PUPPET_VERSION']}".scan(/\d+/).first != '2' &&
|
83
|
-
# simp-rake-helpers and ruby 1.8.7 bomb Travis tests
|
84
|
-
# TODO: fix upstream deps (parallel in simp-rake-helpers)
|
85
|
-
RUBY_VERSION.sub(/\.\d+$/,'') != '1.8'
|
86
|
-
gem 'simp-rake-helpers'
|
87
|
-
end
|
88
68
|
end
|
89
69
|
```
|
90
70
|
|
@@ -164,7 +144,7 @@ directory . The full list of files considered are:
|
|
164
144
|
├── CHANGELOG # OPTIONAL written in RPM's CHANGELOG format
|
165
145
|
└── build/ # OPTIONAL
|
166
146
|
└── rpm_metadata/ # OPTIONAL
|
167
|
-
├── release # OPTIONAL defines the RPM's "
|
147
|
+
├── release # OPTIONAL defines the RPM's "-<qualifier>" release qualifier
|
168
148
|
├── requires # OPTIONAL supplementary 'Requires','Provides','Obsoletes'
|
169
149
|
└── custom/ # OPTIONAL
|
170
150
|
└── * # OPTIONAL custom snippets in RPM .spec format
|
@@ -187,7 +167,7 @@ level of the project, if it exists.
|
|
187
167
|
|
188
168
|
Example:
|
189
169
|
|
190
|
-
* Mon Nov 06 2017 Tom Smith <tom.smith@simp.com> - 3.8.0
|
170
|
+
* Mon Nov 06 2017 Tom Smith <tom.smith@simp.com> - 3.8.0
|
191
171
|
- Add feature x
|
192
172
|
|
193
173
|
**Important:** Note the leading zero in "`Nov 05`". It is a convention
|
@@ -227,21 +207,6 @@ Build the tar package for the current SIMP project
|
|
227
207
|
|
228
208
|
## Limitations
|
229
209
|
|
230
|
-
### Some versions of bundler fail on FIPS-enabled Systems
|
231
|
-
|
232
|
-
This is a limitation of Bundler, not the gem.
|
233
|
-
|
234
|
-
If you are running on a FIPS-enabled system, you will need to use
|
235
|
-
`bundler '~> 1.14.0'` or `bundler '~> 1.16'`
|
236
|
-
|
237
|
-
If you are using RVM, the appropriate steps are as follows:
|
238
|
-
|
239
|
-
```shell
|
240
|
-
rm Gemfile.lock ||:
|
241
|
-
rvm @global do gem uninstall bundler -a -x
|
242
|
-
rvm @global do gem install bundler -v '~> 1.14.0'
|
243
|
-
```
|
244
|
-
|
245
210
|
## Development
|
246
211
|
|
247
212
|
Please see the [SIMP Contribution Guidelines](https://simp-project.atlassian.net/wiki/display/SD/Contributing+to+SIMP).
|
data/Rakefile
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
|
3
1
|
require "rubygems"
|
4
2
|
require 'rake/clean'
|
5
3
|
require 'find'
|
@@ -12,5 +10,6 @@ require 'rspec/core/rake_task'
|
|
12
10
|
require 'simp/rake/rubygem'
|
13
11
|
Simp::Rake::Rubygem.new(@package, @rakefile_dir)
|
14
12
|
|
13
|
+
require 'simp/rake/beaker'
|
15
14
|
|
16
|
-
|
15
|
+
Simp::Rake::Beaker.new(Dir.pwd)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Simp; end
|
2
|
+
module Simp::CommandUtils
|
3
|
+
require 'facter'
|
4
|
+
|
5
|
+
def which(cmd, fail=false)
|
6
|
+
@which_cache ||= {}
|
7
|
+
|
8
|
+
if @which_cache.has_key?(cmd)
|
9
|
+
command = @which_cache[cmd]
|
10
|
+
else
|
11
|
+
command = Facter::Core::Execution.which(cmd)
|
12
|
+
@which_cache[cmd] = command
|
13
|
+
end
|
14
|
+
|
15
|
+
msg = "Warning: Command #{cmd} not found on the system."
|
16
|
+
|
17
|
+
( fail ? raise(msg) : warn(msg) ) unless command
|
18
|
+
|
19
|
+
command
|
20
|
+
end
|
21
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'securerandom'
|
2
2
|
require 'rake'
|
3
|
+
require 'simp/command_utils'
|
3
4
|
|
4
5
|
module Simp
|
5
6
|
# Ensure that a valid GPG signing key exists in a local directory
|
@@ -14,49 +15,52 @@ module Simp
|
|
14
15
|
# - New keys are generated using a temporary GPG agent with its own
|
15
16
|
# settings and socket.
|
16
17
|
#
|
17
|
-
# The local signing key's directory
|
18
|
+
# The local signing key's directory includes the following:
|
19
|
+
# gpg < 2.1.0 (EL7):
|
18
20
|
#
|
19
21
|
# ```
|
20
22
|
# #{key_name}/ # key directory
|
21
23
|
# +-- RPM-GPG-KEY-SIMP-#{key_name} # key file
|
22
24
|
# +-- gengpgkey # --gen-key params file **
|
25
|
+
# +-- gpg-agent-info.env # Lists location of gpg-agent socket + pid
|
26
|
+
# +-- run_gpg_agnet # Script used to start gpg-agent
|
23
27
|
# +-- pubring.gpg
|
24
28
|
# +-- secring.gpg
|
25
|
-
# +--
|
29
|
+
# +-- trustdb.gpg
|
26
30
|
# ```
|
27
31
|
#
|
28
|
-
#
|
32
|
+
# gpg >= 2.1.0 (EL8):
|
33
|
+
# ```
|
34
|
+
# #{key_name}/ # key directory
|
35
|
+
# +-- RPM-GPG-KEY-SIMP-#{key_name} # key file
|
36
|
+
# +-- gengpgkey # --gen-key params file **
|
37
|
+
# +-- openpgp-revocs.d/<fingerprint id>.rev
|
38
|
+
# +-- private-keys-v1.d/<user id>.key
|
39
|
+
# +-- pubring.kbx
|
40
|
+
# +-- trustdb.gpg
|
41
|
+
# ```
|
42
|
+
#
|
43
|
+
# `**` = `SIMP::RpmSigner.sign_rpms` will use the values in the `gengpgkey` file
|
29
44
|
# for the GPG signing key's email and passphrase
|
30
45
|
#
|
31
46
|
# If a new key is required, a project-only `gpg-agent` daemon is momentarily
|
32
47
|
# created to generate it, and destroyed after this is done. The daemon does
|
33
|
-
# not interact with any other `gpg-agent` daemons on the system
|
34
|
-
# launched on
|
35
|
-
# #{key_name/} directory.
|
36
|
-
#
|
37
|
-
# When instantiated, the daemon writes an "env-file" to the #{key_name}
|
38
|
-
# directory. This file specifies the location of the daemon's socket and
|
39
|
-
# pid.
|
40
|
-
#
|
41
|
-
# A typical env-file looks like:
|
42
|
-
#
|
43
|
-
# ```sh
|
44
|
-
# GPG_AGENT_INFO=/tmp/gpg-4yhfOB/S.gpg-agent:15495:1
|
45
|
-
# ```
|
48
|
+
# not interact with any other `gpg-agent` daemons on the system. It is
|
49
|
+
# launched on random socket(s) whose socket file(s) can be found as follows:
|
46
50
|
#
|
47
|
-
#
|
48
|
-
#
|
51
|
+
# Location Environment
|
52
|
+
# #{key_name} dir Docker container for EL8
|
53
|
+
# temp dir in /run/user/<uid>/gnupg EL8
|
54
|
+
# temp dir in /tmp EL7
|
49
55
|
#
|
50
|
-
# ```sh
|
51
|
-
# GPG_AGENT_INFO=/tmp/gpg-4yhfOB/S.gpg-agent:15495:1; export GPG_AGENT_INFO;\n"
|
52
|
-
# ```
|
53
56
|
class LocalGpgSigningKey
|
54
57
|
include FileUtils
|
58
|
+
include Simp::CommandUtils
|
55
59
|
|
56
|
-
# `SIMP::
|
60
|
+
# `SIMP::RpmSigner.sign_rpms` will look for a 'gengpgkey' file to
|
57
61
|
# non-interactively sign packages.
|
58
62
|
#
|
59
|
-
# @see SIMP::
|
63
|
+
# @see SIMP::RpmSigner.sign_rpms
|
60
64
|
GPG_GENKEY_PARAMS_FILENAME = 'gengpgkey'.freeze
|
61
65
|
|
62
66
|
# @param dir [String] path to gpg-agent / key directory
|
@@ -74,11 +78,12 @@ module Simp
|
|
74
78
|
@key_file = opts[:file] || "RPM-GPG-KEY-SIMP-#{@label.capitalize}"
|
75
79
|
@verbose = opts[:verbose] || false
|
76
80
|
|
81
|
+
# for EL7 only
|
77
82
|
@gpg_agent_env_file = 'gpg-agent-info.env'
|
78
83
|
@gpg_agent_script = 'run_gpg_agent'
|
79
84
|
end
|
80
85
|
|
81
|
-
# Return the version of GPG
|
86
|
+
# Return the version of GPG installed on the system
|
82
87
|
#
|
83
88
|
# @return [Gem::Version]
|
84
89
|
def gpg_version
|
@@ -111,17 +116,45 @@ module Simp
|
|
111
116
|
info
|
112
117
|
end
|
113
118
|
|
114
|
-
# Return the number of days left before the GPG signing key expires
|
119
|
+
# Return the number of days left before the GPG signing key expires or
|
120
|
+
# 0 if the key does not exist or the key is missing an expiration date.
|
115
121
|
def dev_key_days_left
|
122
|
+
which('gpg', true)
|
116
123
|
ensure_gpg_directory
|
117
|
-
days_left = 0
|
118
124
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
125
|
+
days_left = 0
|
126
|
+
cmd = "gpg --with-colons --homedir=#{@dir} --list-keys '<#{@key_email}>' 2>&1"
|
127
|
+
puts "Executing: #{cmd}" if @verbose
|
128
|
+
%x(#{cmd}).each_line do |line|
|
129
|
+
# See https://github.com/CSNW/gnupg/blob/master/doc/DETAILS
|
130
|
+
# Index Content
|
131
|
+
# 0 record type
|
132
|
+
# 6 expiration date
|
133
|
+
#
|
134
|
+
# If expiration date contains a 'T', it is in an ISO 8601 format
|
135
|
+
# (e.g., 20210223T091500). Otherwise it is seconds since the epoch.
|
136
|
+
#
|
137
|
+
fields = line.split(':')
|
138
|
+
if fields[0] && (fields[0] == 'pub')
|
139
|
+
raw_exp_date = fields[6]
|
140
|
+
unless raw_exp_date.nil? || raw_exp_date.strip.empty?
|
141
|
+
require 'date'
|
142
|
+
|
143
|
+
exp_date = nil
|
144
|
+
if raw_exp_date.include?('T')
|
145
|
+
exp_date = DateTime.parse(raw_exp_date).to_date
|
146
|
+
else
|
147
|
+
exp_date = Time.at(raw_exp_date.to_i).to_date
|
148
|
+
end
|
149
|
+
|
150
|
+
days_left = (exp_date - Date.today).to_i
|
151
|
+
days_left = 0 if days_left < 0
|
152
|
+
end
|
153
|
+
|
154
|
+
break
|
155
|
+
end
|
124
156
|
end
|
157
|
+
|
125
158
|
days_left
|
126
159
|
end
|
127
160
|
|
@@ -153,55 +186,16 @@ module Simp
|
|
153
186
|
|
154
187
|
clean_gpg_agent_directory
|
155
188
|
write_genkey_parameter_file
|
156
|
-
write_gpg_agent_startup_script
|
157
189
|
|
190
|
+
agent_info = nil
|
158
191
|
begin
|
159
192
|
if gpg_version < Gem::Version.new('2.1')
|
160
|
-
|
161
|
-
gpg_agent_output = %x(./#{@gpg_agent_script}).strip
|
162
|
-
|
163
|
-
# Provide a local socket (needed by the `gpg` command when
|
164
|
-
local_socket = File.join(Dir.pwd, 'S.gpg-agent')
|
165
|
-
|
166
|
-
# This condition was handled differently in previous logic.
|
167
|
-
#
|
168
|
-
# a.) As the surrounding logic works now, it will _always_ be a new
|
169
|
-
# agent by this point, because the directory is cleaned out
|
170
|
-
# b.) The agent's information will be read from the env-file it
|
171
|
-
# writes at startup
|
172
|
-
# c.) The old command `gpg-agent --homedir=#{Dir.pwd} /get serverpid`
|
173
|
-
# did not work on EL6 or EL7.
|
174
|
-
#
|
175
|
-
warn(empty_gpg_agent_message) if gpg_agent_output.empty?
|
176
|
-
|
177
|
-
agent_info = gpg_agent_info
|
178
|
-
|
179
|
-
# The socket is useful to get back info on the command line.
|
180
|
-
unless File.exist?(File.join(Dir.pwd, File.basename(agent_info[:socket])))
|
181
|
-
ln_s(agent_info[:socket], local_socket, :verbose => @verbose)
|
182
|
-
end
|
183
|
-
|
184
|
-
generate_key(agent_info[:info])
|
193
|
+
agent_info = start_gpg_agent_old
|
185
194
|
else
|
186
|
-
|
187
|
-
which('gpg-agent', true)
|
188
|
-
which('gpg-connect-agent', true)
|
189
|
-
|
190
|
-
# Start the GPG agent
|
191
|
-
%x{gpg-agent --homedir=#{Dir.pwd} >&/dev/null || gpg-agent --homedir=#{Dir.pwd} --daemon >&/dev/null}
|
192
|
-
|
193
|
-
agent_info = {}
|
194
|
-
|
195
|
-
# Provide a local socket (needed by the `gpg` command when
|
196
|
-
agent_info[:socket] = %x{echo 'GETINFO socket_name' | gpg-connect-agent --homedir=#{Dir.pwd}}.lines.first[1..-1].strip
|
197
|
-
|
198
|
-
# Get the pid
|
199
|
-
agent_info[:pid] = %x{echo 'GETINFO pid' | gpg-connect-agent --homedir=#{Dir.pwd}}.lines.first[1..-1].strip.to_i
|
200
|
-
|
201
|
-
generate_key(%{#{agent_info[:socket]}:#{agent_info[:pid]}:1})
|
195
|
+
agent_info = start_gpg_agent
|
202
196
|
end
|
203
197
|
ensure
|
204
|
-
kill_agent(agent_info[:pid])
|
198
|
+
kill_agent(agent_info[:pid]) if agent_info
|
205
199
|
end
|
206
200
|
|
207
201
|
agent_info
|
@@ -213,7 +207,7 @@ module Simp
|
|
213
207
|
#
|
214
208
|
# @return [String] Warning message
|
215
209
|
def empty_gpg_agent_message
|
216
|
-
|
210
|
+
<<~WARNING
|
217
211
|
WARNING: Tried to start an project-only gpg-agent daemon on a random socket by
|
218
212
|
running the script:
|
219
213
|
|
@@ -234,7 +228,6 @@ module Simp
|
|
234
228
|
#
|
235
229
|
# @param pid [String] The GPG Agent PID to kill
|
236
230
|
def kill_agent(pid)
|
237
|
-
rm('S.gpg-agent') if File.symlink?('S.gpg-agent')
|
238
231
|
if pid
|
239
232
|
Process.kill(0, pid)
|
240
233
|
Process.kill(15, pid)
|
@@ -254,8 +247,8 @@ module Simp
|
|
254
247
|
gpg_cmd = %(GPG_AGENT_INFO=#{gpg_agent_info_str} gpg --homedir="#{@dir}")
|
255
248
|
|
256
249
|
pipe = @verbose ? '| tee' : '>'
|
257
|
-
|
258
|
-
|
250
|
+
%x(#{gpg_cmd} --batch --gen-key #{GPG_GENKEY_PARAMS_FILENAME})
|
251
|
+
%x(#{gpg_cmd} --armor --export '<#{@key_email}>' #{pipe} "#{@key_file}")
|
259
252
|
|
260
253
|
if File.stat(@key_file).size == 0
|
261
254
|
fail "Error: Something went wrong generating #{@key_file}"
|
@@ -271,6 +264,62 @@ module Simp
|
|
271
264
|
{ info: info.strip, socket: matches[:socket], pid: matches[:pid].to_i }
|
272
265
|
end
|
273
266
|
|
267
|
+
# Start the gpg-agent
|
268
|
+
# @return Hash of agent info
|
269
|
+
# @raise if gpg-agent fails to start
|
270
|
+
def start_gpg_agent
|
271
|
+
which('gpg', true)
|
272
|
+
which('gpg-agent', true)
|
273
|
+
which('gpg-connect-agent', true)
|
274
|
+
|
275
|
+
# Start the GPG agent, if it is not already running
|
276
|
+
check_agent = "gpg-agent -q --homedir=#{Dir.pwd} >&/dev/null"
|
277
|
+
start_agent = "gpg-agent --homedir=#{Dir.pwd} --daemon >&/dev/null"
|
278
|
+
cmd = "#{check_agent} || #{start_agent}"
|
279
|
+
puts "Executing: #{cmd}" if @verbose
|
280
|
+
%x(#{cmd})
|
281
|
+
if $? && ($?.exitstatus != 0)
|
282
|
+
err_msg = [
|
283
|
+
'Failed to start gpg-agent during key creation.',
|
284
|
+
" Execute '#{start_agent.gsub(' >&/dev/null','')}' to debug."
|
285
|
+
].join("\n")
|
286
|
+
raise(err_msg)
|
287
|
+
end
|
288
|
+
|
289
|
+
agent_info = {}
|
290
|
+
|
291
|
+
# Provide a local socket (needed by the `gpg` command when
|
292
|
+
agent_info[:socket] = %x{echo 'GETINFO socket_name' | gpg-connect-agent --homedir=#{Dir.pwd}}.lines.first[1..-1].strip
|
293
|
+
|
294
|
+
# Get the pid
|
295
|
+
agent_info[:pid] = %x{echo 'GETINFO pid' | gpg-connect-agent --homedir=#{Dir.pwd}}.lines.first[1..-1].strip.to_i
|
296
|
+
|
297
|
+
generate_key(%{#{agent_info[:socket]}:#{agent_info[:pid]}:1})
|
298
|
+
|
299
|
+
agent_info
|
300
|
+
end
|
301
|
+
|
302
|
+
# Start the gpg-agent with options suitable for gpg version < 2.1
|
303
|
+
# @return Hash of agent info
|
304
|
+
def start_gpg_agent_old
|
305
|
+
write_gpg_agent_startup_script
|
306
|
+
gpg_agent_output = %x(./#{@gpg_agent_script}).strip
|
307
|
+
|
308
|
+
# By the time we get here, we can be assured we will be starting a
|
309
|
+
# new agent, because the directory is cleaned out.
|
310
|
+
#
|
311
|
+
# Follow-on gpg actions will read the agent's information from
|
312
|
+
# the env-file the agent writes at startup.
|
313
|
+
|
314
|
+
# We're using the --sh option which will spew out the agent config
|
315
|
+
# when the agent starts. If it is empty, this is a problem.
|
316
|
+
warn(empty_gpg_agent_message) if gpg_agent_output.empty?
|
317
|
+
|
318
|
+
agent_info = gpg_agent_info
|
319
|
+
generate_key(agent_info[:info])
|
320
|
+
agent_info
|
321
|
+
end
|
322
|
+
|
274
323
|
# Write the `gpg --genkey --batch` control parameter file
|
275
324
|
#
|
276
325
|
# @see "Unattended key generation" in /usr/share/doc/gnupg2-*/DETAILS for
|
@@ -311,7 +360,7 @@ module Simp
|
|
311
360
|
which('gpg-agent', true)
|
312
361
|
pinentry_cmd = which('pinentry-curses', true)
|
313
362
|
|
314
|
-
gpg_agent_script =
|
363
|
+
gpg_agent_script = <<~AGENT_SCRIPT
|
315
364
|
#!/bin/sh
|
316
365
|
|
317
366
|
gpg-agent --homedir=#{Dir.pwd} --daemon \
|
data/lib/simp/rake/build/auto.rb
CHANGED
@@ -18,6 +18,8 @@ module Simp::Rake::Build
|
|
18
18
|
class Auto < ::Rake::TaskLib
|
19
19
|
|
20
20
|
# Commands that are required by some part of the rake stack
|
21
|
+
#
|
22
|
+
# Use an array for commands that may have multiple valid options
|
21
23
|
BUILD_REQUIRED_COMMANDS = [
|
22
24
|
'basename',
|
23
25
|
'cat',
|
@@ -42,7 +44,7 @@ module Simp::Rake::Build
|
|
42
44
|
'make',
|
43
45
|
'mkdir',
|
44
46
|
'mktemp',
|
45
|
-
'python',
|
47
|
+
['python','python2','python3'],
|
46
48
|
'readlink',
|
47
49
|
'repoclosure',
|
48
50
|
'rm',
|
@@ -62,7 +64,7 @@ module Simp::Rake::Build
|
|
62
64
|
'wc',
|
63
65
|
'which',
|
64
66
|
'xargs',
|
65
|
-
'yum',
|
67
|
+
['dnf','yum'],
|
66
68
|
'yumdownloader'
|
67
69
|
]
|
68
70
|
|
@@ -25,7 +25,7 @@ module Simp::Rake::Build
|
|
25
25
|
namespace :build do
|
26
26
|
task :prep do
|
27
27
|
if $simp6
|
28
|
-
@build_dir = $simp6_build_dir
|
28
|
+
@build_dir = $simp6_build_dir || @distro_build_dir
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -96,7 +96,7 @@ module Simp::Rake::Build
|
|
96
96
|
task :prep do
|
97
97
|
if $simp6
|
98
98
|
# `$simp6_build_dir` is set by the build:auto task
|
99
|
-
@build_dir = $simp6_build_dir
|
99
|
+
@build_dir = $simp6_build_dir || @distro_build_dir
|
100
100
|
|
101
101
|
unless @build_dir
|
102
102
|
if ENV['SIMP_BUILD_yum_dir'] && File.exist?(File.join(ENV['SIMP_BUILD_yum_dir'], 'yum_data'))
|
@@ -204,7 +204,8 @@ module Simp::Rake::Build
|
|
204
204
|
|
205
205
|
Dir.chdir(target_dir) do
|
206
206
|
if File.exist?('packages.yaml')
|
207
|
-
|
207
|
+
# The empty YAML file returns 'false'
|
208
|
+
known_package_hash = YAML::load_file('packages.yaml') || {}
|
208
209
|
end
|
209
210
|
end
|
210
211
|
|
@@ -276,7 +277,7 @@ module Simp::Rake::Build
|
|
276
277
|
pkg = downloaded_package_hash[pkg][:rpm_name]
|
277
278
|
}.compact
|
278
279
|
|
279
|
-
if known_packages.empty? && downloaded_packages.empty?
|
280
|
+
if known_packages.empty? && downloaded_packages.empty? && Dir.glob('reposync/**/repomd.xml').empty?
|
280
281
|
fail <<-EOM
|
281
282
|
Error: Could not find anything to do!
|
282
283
|
|