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

Guess the right template from /etc/os-release #108

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dcermak
Copy link
Contributor

@dcermak dcermak commented Aug 12, 2021

This PR adds a few patches from openSUSE's fork to support guessing the correct template from /etc/os-release

bin/gem2rpm Outdated Show resolved Hide resolved
bin/gem2rpm Outdated Show resolved Hide resolved
bin/gem2rpm Outdated Show resolved Hide resolved
@dcermak dcermak force-pushed the templates-from-os-release branch from 1595078 to 4530ef8 Compare July 7, 2022 10:44
Copy link
Contributor

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

This reads well to me, but I'd feel better if #112 was merged and this rebased so CI could agree.

@ekohl
Copy link
Contributor

ekohl commented Jul 20, 2022

#112 was merged. Would you mind rebasing?

@voxik
Copy link
Member

voxik commented Jul 20, 2022

Not objecting the intent of this PR, but I'd be a bit happier, if the functionality lived somewhere outside of the executable. This way, it would be better testable. Of course if there was test case attached, it would be even better.

@voxik
Copy link
Member

voxik commented Aug 5, 2022

Hmm, looking on the PR in more detail, I am confused what is the purpose. We are already querying /etc/os-release:

def self.release_files
@release_files ||=
Dir.glob('/etc/{os-release,*{_version,-release}}*').uniq.select { |e| File.file? e }
end

and

# Try os-release first.
if (os_release_files = grouped_release_files['os-release'])
content = File.open(os_release_files.first, Gem2Rpm::OPEN_MODE, &:read)
begin
os_release.os = content[/^ID=['"]?(.*?)['"]?$/, 1].to_sym
os_release.version = content[/^VERSION_ID=['"]?(.*?)['"]?$/, 1]
rescue
end
end

So this would be step backward.

@dcermak dcermak force-pushed the templates-from-os-release branch from 4530ef8 to e6acc87 Compare June 20, 2023 08:11
dcermak and others added 4 commits June 20, 2023 10:14
(cherry picked from commit 91bc63e)

Co-authored-by: Ewoud Kohl van Wijngaarden <[email protected]>
Co-authored-by: Dan Čermák <[email protected]>
…ontains ID="opensuse-tumbleweed"

(cherry picked from commit 7fa4f56)
At the moment you have to manually specify the template file name on Leap, as
gem2rpm tries to use the opensuse-leap template on Leap, which does not
exist. Therefore we fallback to the opensuse template instead.

(cherry picked from commit 2f34876)
@dcermak dcermak force-pushed the templates-from-os-release branch from e6acc87 to e23d592 Compare June 20, 2023 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants