-
Notifications
You must be signed in to change notification settings - Fork 24
Masquerade PopOS as Ubuntu #279
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
base: main
Are you sure you want to change the base?
Conversation
Issue: r-lib#277 PopOS is not supported by api.r-hub.io yet but PopOS is essentially just Ubuntu (in the context of installing R) so we masquerade it as that.
@@ -742,6 +731,29 @@ pub fn detect_linux() -> Result<OsVersion, Box<dyn Error>> { | |||
}) | |||
} | |||
|
|||
fn determine_id_from_os_release_contents(lines: &[String]) -> Result<String, Box<dyn Error>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I extracted this pretty much as it was just to demonstrate extraction of the PopOS distro name / ID from /etc/os-release
contents.
@gaborcsardi I don't have permissions to add you as a reviewer so commenting instead. The redhat build checks seem to be failing but this looks like some kind of OS registration issue. If you like this PR (in principle at least) let me know if there's anything else you'd like added (e2e testing etc). |
Thanks! It would be nice to have a generic mechanism for this. PopOS has this, for 22.04 at least:
So maybe we could parse the The difficulty is that we would first try |
Oh I like the idea of using
That seems to fit the bill 👍🏻
What if we just encode the list of officially supported distros as a constant and if we get an |
Issue: #277
Changes
PopOS is not supported by
api.r-hub.io
yet but it should essentially be the same as Ubuntu (in the context of installing R) so I'm masquerading it as that here.Related
There's a workaround discussed here where you set the
RIG_PLATFORM
environment variable.Before I came across that I was looking through the code and saw a tweak for
opensuse-leap
that seemed like precedent for adding some tweaks to actual vs extracted/determined distro. I've added amatch
and a simple test for this where you could add any number of other 'masquerade as' default rules to save people having to discover/setRIG_PLATFORM
.