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

Modified the distribution check to accept operating systems like Pop_os that are ubuntu/debian based and mention it differently in the /etc/os-release file #464

Closed
wants to merge 2 commits into from
Closed
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 installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ if grep -q -i wsl /proc/version; then
fi

# distribution check
if ! grep -q "ID_LIKE=debian" /etc/os-release 2>/dev/null ; then
if ! grep -q "ID_LIKE=" /etc/os-release | grep -q "ubuntu\|debian" /etc/os-release 2>/dev/null ; then
Copy link
Member

Choose a reason for hiding this comment

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

is there a copy error? Should this be something like (untested):

if ! grep -q "ID_LIKE=debian\|ID_LIKE=ubuntu" /etc/os-release

Could you provide a /etc/os-release file?

Copy link
Author

Choose a reason for hiding this comment

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

Here is the content of /etc/os-release on my system:
NAME="Pop!_OS"
VERSION="22.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 22.04 LTS"
VERSION_ID="22.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=jammy
UBUNTU_CODENAME=jammy
LOGO=distributor-logo-pop-os

Copy link
Member

@m-1-k-3 m-1-k-3 Jan 28, 2023

Choose a reason for hiding this comment

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

would this regex fit?

grep -E "ID_LIKE=(\")?(ubuntu)?( )?(debian)?"

Looks not too bad in my testset:

image

The first two are os-release files without debian or ubuntu entries. Then we have the popos and finally a ubuntu

Copy link
Author

Choose a reason for hiding this comment

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

Yes, it looks good. I was too lazy to write a regex I guess

echo -e "\\n""$RED""EMBA only supports debian based distributions!""$NC\\n"
print_help
exit 1
Expand Down