Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

linux: Fix regex patterns for detecting Fedora in script/linux (#22611)

Hossein Khosravi8c253af451ee
diff --git a/script/linux b/script/linux
index 5336f8f3697..650c1cfbbb4 100755
--- a/script/linux
+++ b/script/linux
@@ -86,7 +86,7 @@ if [[ -n $dnf ]] || [[ -n $yum ]]; then
)
# perl used for building openssl-sys crate. See: https://docs.rs/openssl/latest/openssl/
# openbsd-netcat is unavailable in RHEL8/9 (and nmap-ncat doesn't support sockets)
- if grep -qP '^ID="(fedora)' /etc/os-release; then
+ if grep -qP '^ID="?(fedora)' /etc/os-release; then
deps+=(
perl-FindBin
perl-IPC-Cmd
@@ -95,20 +95,20 @@ if [[ -n $dnf ]] || [[ -n $yum ]]; then
netcat
mold
)
- elif grep -qP '^ID="(rhel|rocky|alma|centos|ol)' /etc/os-release; then
+ elif grep -qP '^ID="?(rhel|rocky|alma|centos|ol)' /etc/os-release; then
deps+=( perl-interpreter )
fi
# gcc-c++ is g++ on RHEL8 and 8.x clones
- if grep -qP '^ID="(rhel|rocky|alma|centos|ol)' /etc/os-release \
- && grep -qP '^VERSION_ID="8' /etc/os-release; then
+ if grep -qP '^ID="?(rhel|rocky|alma|centos|ol)' /etc/os-release \
+ && grep -qP '^VERSION_ID="?(8)' /etc/os-release; then
deps+=( gcc-c++ )
else
deps+=( g++ )
fi
# libxkbcommon-x11-devel is in a non-default repo on RHEL 8.x/9.x (except on AmazonLinux)
- if grep -qP '^VERSION_ID="(8|9)' /etc/os-release && grep -qP '^ID="(rhel|rocky|centos|alma|ol)' /etc/os-release; then
+ if grep -qP '^VERSION_ID="?(8|9)' /etc/os-release && grep -qP '^ID="?(rhel|rocky|centos|alma|ol)' /etc/os-release; then
$maysudo dnf install -y 'dnf-command(config-manager)'
if grep -qP '^PRETTY_NAME="(AlmaLinux 8|Rocky Linux 8)' /etc/os-release; then
$maysudo dnf config-manager --set-enabled powertools