Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change rhel_alts to use RHEL facts and remove discontinued OS #303

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Create i386 facts from x86_64's ones
```
for file in facts/*/*-x86_64.facts; do cat $file | sed -e 's/x86_64/i386/' -e 's/amd64/i386/' > $(echo $file | sed 's/x86_64/i386/'); done
```
Create RedHat, Scientific, OracleLinux facts from CentOS's ones
Create OracleLinux facts from RedHat's ones

```
$ bundle exec rake rhel_alts
Expand Down
19 changes: 5 additions & 14 deletions rakelib/rhel_alts.rake
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
desc 'Create RHEL/OracleLinux/Scientific factsets from CentOS factsets'
desc 'Create OracleLinux factsets from RHEL factsets'
task :rhel_alts do
Dir[File.join(__dir__, '..', 'facts', '*', 'centos-*-x86_64.facts')].each do |f|
centos_factset = File.read(f)
Dir[File.join(__dir__, '..', 'facts', '*', 'rhel-*-x86_64.facts')].each do |f|
rhel_factset = File.read(f)

rhel_path = f.gsub('centos-', 'redhat-')
File.write(rhel_path, centos_factset.gsub('CentOS', 'RedHat'))

oracle_path = f.gsub('centos-', 'oraclelinux-')
File.write(oracle_path, centos_factset.gsub('CentOS', 'OracleLinux'))

# Scientific isn't going to be updated to 8
next unless File.basename(f)[/-(\d+)-/, 1].to_i <= 7

scientific_path = f.gsub('centos-', 'scientific-')
File.write(scientific_path, centos_factset.gsub('CentOS', 'Scientific'))
oracle_path = f.gsub('rhel-', 'oraclelinux-')
File.write(oracle_path, rhel_factset.gsub('RedHat', 'OracleLinux'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't this also change the OS family fact?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be an issue - I will revisit.

end
end