Lines Matching +full:data +full:- +full:lines

1 //===--- Distro.cpp - Linux distribution detection support ------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
25 VFS.getBufferForFile("/etc/os-release"); in DetectOsRelease()
27 File = VFS.getBufferForFile("/usr/lib/os-release"); in DetectOsRelease()
31 SmallVector<StringRef, 16> Lines; in DetectOsRelease() local
32 File.get()->getBuffer().split(Lines, "\n"); in DetectOsRelease()
36 for (StringRef Line : Lines) in DetectOsRelease()
43 // On SLES, /etc/os-release was introduced in SLES 11. in DetectOsRelease()
53 VFS.getBufferForFile("/etc/lsb-release"); in DetectLsbRelease()
57 SmallVector<StringRef, 16> Lines; in DetectLsbRelease() local
58 File.get()->getBuffer().split(Lines, "\n"); in DetectLsbRelease()
61 for (StringRef Line : Lines) in DetectLsbRelease()
106 // Newer freedesktop.org's compilant systemd-based systems in DetectDistro()
107 // should provide /etc/os-release or /usr/lib/os-release. in DetectDistro()
112 // Older systems might provide /etc/lsb-release. in DetectDistro()
117 // Otherwise try some distro-specific quirks for Red Hat... in DetectDistro()
119 VFS.getBufferForFile("/etc/redhat-release"); in DetectDistro()
122 StringRef Data = File.get()->getBuffer(); in DetectDistro() local
123 if (Data.starts_with("Fedora release")) in DetectDistro()
125 if (Data.starts_with("Red Hat Enterprise Linux") || in DetectDistro()
126 Data.starts_with("CentOS") || Data.starts_with("Scientific Linux")) { in DetectDistro()
127 if (Data.contains("release 7")) in DetectDistro()
129 else if (Data.contains("release 6")) in DetectDistro()
131 else if (Data.contains("release 5")) in DetectDistro()
140 StringRef Data = File.get()->getBuffer(); in DetectDistro() local
143 if (!Data.split('.').first.getAsInteger(10, MajorVersion)) { in DetectDistro()
167 return llvm::StringSwitch<Distro::DistroType>(Data.split("\n").first) in DetectDistro()
180 File = VFS.getBufferForFile("/etc/SuSE-release"); in DetectDistro()
182 StringRef Data = File.get()->getBuffer(); in DetectDistro() local
183 SmallVector<StringRef, 8> Lines; in DetectDistro() local
184 Data.split(Lines, "\n"); in DetectDistro()
185 for (const StringRef &Line : Lines) { in DetectDistro()
205 if (VFS.exists("/etc/gentoo-release")) in DetectDistro()
223 // is cross-compiling from BSD or Windows to Linux, and it would be in GetDistro()
224 // meaningless to try to figure out the "distro" of the non-Linux host. in GetDistro()