Skip to content

Commit

Permalink
Restore Linux build number parsing (oshi#1076)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbwiddis authored Jan 1, 2020
1 parent 3866581 commit 556bd9e
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,18 @@ public String queryManufacturer() {
@Override
public FamilyVersionInfo queryFamilyVersionInfo() {
String family = queryFamilyFromReleaseFiles();
OSVersionInfo versionInfo = new OSVersionInfo(this.versionId, this.codeName, null);
String buildNumber = null;
List<String> procVersion = FileUtil.readFile("/proc/version");
if (!procVersion.isEmpty()) {
String[] split = ParseUtil.whitespaces.split(procVersion.get(0));
for (String s : split) {
if (!"Linux".equals(s) && !"version".equals(s)) {
buildNumber = s;
break;
}
}
}
OSVersionInfo versionInfo = new OSVersionInfo(this.versionId, this.codeName, buildNumber);
return new FamilyVersionInfo(family, versionInfo);
}

Expand Down

0 comments on commit 556bd9e

Please sign in to comment.