@@ -61,10 +61,6 @@ static Distro::DistroType DetectLsbRelease(llvm::vfs::FileSystem &VFS) {
6161 if (Version == Distro::UnknownDistro &&
6262 Line.starts_with (" DISTRIB_CODENAME=" ))
6363 Version = llvm::StringSwitch<Distro::DistroType>(Line.substr (17 ))
64- .Case (" maverick" , Distro::UbuntuMaverick)
65- .Case (" natty" , Distro::UbuntuNatty)
66- .Case (" oneiric" , Distro::UbuntuOneiric)
67- .Case (" precise" , Distro::UbuntuPrecise)
6864 .Case (" quantal" , Distro::UbuntuQuantal)
6965 .Case (" raring" , Distro::UbuntuRaring)
7066 .Case (" saucy" , Distro::UbuntuSaucy)
@@ -119,13 +115,17 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
119115 if (Data.starts_with (" Fedora release" ))
120116 return Distro::Fedora;
121117 if (Data.starts_with (" Red Hat Enterprise Linux" ) ||
122- Data.starts_with (" CentOS" ) || Data.starts_with (" Scientific Linux" )) {
118+ Data.starts_with (" CentOS" ) || Data.starts_with (" Alma Linux" ) ||
119+ Data.starts_with (" Rocky Linux" ) ||
120+ Data.starts_with (" Scientific Linux" )) {
121+ if (Data.contains (" release 10" ))
122+ return Distro::RHEL10;
123+ if (Data.contains (" release 9" ))
124+ return Distro::RHEL9;
125+ if (Data.contains (" release 8" ))
126+ return Distro::RHEL8;
123127 if (Data.contains (" release 7" ))
124128 return Distro::RHEL7;
125- else if (Data.contains (" release 6" ))
126- return Distro::RHEL6;
127- else if (Data.contains (" release 5" ))
128- return Distro::RHEL5;
129129 }
130130 return Distro::UnknownDistro;
131131 }
@@ -138,12 +138,6 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
138138 int MajorVersion;
139139 if (!Data.split (' .' ).first .getAsInteger (10 , MajorVersion)) {
140140 switch (MajorVersion) {
141- case 5 :
142- return Distro::DebianLenny;
143- case 6 :
144- return Distro::DebianSqueeze;
145- case 7 :
146- return Distro::DebianWheezy;
147141 case 8 :
148142 return Distro::DebianJessie;
149143 case 9 :
@@ -165,8 +159,6 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
165159 }
166160 }
167161 return llvm::StringSwitch<Distro::DistroType>(Data.split (" \n " ).first )
168- .Case (" squeeze/sid" , Distro::DebianSqueeze)
169- .Case (" wheezy/sid" , Distro::DebianWheezy)
170162 .Case (" jessie/sid" , Distro::DebianJessie)
171163 .Case (" stretch/sid" , Distro::DebianStretch)
172164 .Case (" buster/sid" , Distro::DebianBuster)
0 commit comments