@@ -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)
@@ -120,13 +116,17 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
120116    if  (Data.starts_with (" Fedora release"  ))
121117      return  Distro::Fedora;
122118    if  (Data.starts_with (" Red Hat Enterprise Linux"  ) ||
123-         Data.starts_with (" CentOS"  ) || Data.starts_with (" Scientific Linux"  )) {
119+         Data.starts_with (" CentOS"  ) || Data.starts_with (" AlmaLinux"  ) ||
120+         Data.starts_with (" Rocky Linux"  ) ||
121+         Data.starts_with (" Scientific Linux"  )) {
122+       if  (Data.contains (" release 10"  ))
123+         return  Distro::RHEL10;
124+       if  (Data.contains (" release 9"  ))
125+         return  Distro::RHEL9;
126+       if  (Data.contains (" release 8"  ))
127+         return  Distro::RHEL8;
124128      if  (Data.contains (" release 7"  ))
125129        return  Distro::RHEL7;
126-       else  if  (Data.contains (" release 6"  ))
127-         return  Distro::RHEL6;
128-       else  if  (Data.contains (" release 5"  ))
129-         return  Distro::RHEL5;
130130    }
131131    return  Distro::UnknownDistro;
132132  }
@@ -139,12 +139,6 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
139139    int  MajorVersion;
140140    if  (!Data.split (' .'  ).first .getAsInteger (10 , MajorVersion)) {
141141      switch  (MajorVersion) {
142-       case  5 :
143-         return  Distro::DebianLenny;
144-       case  6 :
145-         return  Distro::DebianSqueeze;
146-       case  7 :
147-         return  Distro::DebianWheezy;
148142      case  8 :
149143        return  Distro::DebianJessie;
150144      case  9 :
@@ -166,8 +160,6 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
166160      }
167161    }
168162    return  llvm::StringSwitch<Distro::DistroType>(Data.split (" \n "  ).first )
169-         .Case (" squeeze/sid"  , Distro::DebianSqueeze)
170-         .Case (" wheezy/sid"  , Distro::DebianWheezy)
171163        .Case (" jessie/sid"  , Distro::DebianJessie)
172164        .Case (" stretch/sid"  , Distro::DebianStretch)
173165        .Case (" buster/sid"  , Distro::DebianBuster)
0 commit comments