add VendorCodeName, use it for osx description

This commit is contained in:
Doug MacEachern 2005-06-16 22:38:14 +00:00
parent de2812fab3
commit 0faf17d946
2 changed files with 21 additions and 1 deletions

View File

@ -40,6 +40,7 @@ public class OperatingSystem {
private String vendor; private String vendor;
private String vendorVersion; private String vendorVersion;
private String vendorName; private String vendorName;
private String vendorCodeName;
private String dataModel; private String dataModel;
private String cpuEndian; private String cpuEndian;
@ -78,6 +79,12 @@ public class OperatingSystem {
os.vendorVersion = "NT"; os.vendorVersion = "NT";
} }
os.name = "Win32"; os.name = "Win32";
if (os.vendorVersion.equals("XP")) {
os.codeName = "Whistler";
}
else if (os.vendorVersion.equals("2003")) {
os.codeName = "Whistler Server";
}
} }
else if (os.name.equals("SunOS")) { else if (os.name.equals("SunOS")) {
os.type = TYPE_SOLARIS; os.type = TYPE_SOLARIS;
@ -108,6 +115,12 @@ public class OperatingSystem {
os.type = TYPE_MACOSX; os.type = TYPE_MACOSX;
os.name = NAME_MACOSX; os.name = NAME_MACOSX;
os.vendor = "Apple"; os.vendor = "Apple";
if (os.version.equals("10.4")) {
os.vendorCodeName = "Tiger";
}
else if (os.version.equals("10.3")) {
os.vendorCodeName = "Panther";
}
} }
else if (os.name.equals(NAME_FREEBSD)) { else if (os.name.equals(NAME_FREEBSD)) {
os.type = TYPE_FREEBSD; os.type = TYPE_FREEBSD;
@ -140,7 +153,7 @@ public class OperatingSystem {
return this.vendorName + " " + this.vendorVersion; return this.vendorName + " " + this.vendorVersion;
case TYPE_MACOSX: case TYPE_MACOSX:
//"Mac OS X 10.4" //"Mac OS X 10.4"
return this.vendorName + " " + this.version; return this.vendorName + " " + this.vendorCodeName;
case TYPE_WIN32: case TYPE_WIN32:
//"Microsoft Windows 2003" //"Microsoft Windows 2003"
return this.vendor + " Windows " + this.vendorVersion; return this.vendor + " Windows " + this.vendorVersion;
@ -178,6 +191,10 @@ public class OperatingSystem {
return this.vendorName; return this.vendorName;
} }
public String getVendorCodeName() {
return this.vendorCodeName;
}
public String getDataModel() { public String getDataModel() {
return this.dataModel; return this.dataModel;
} }

View File

@ -63,6 +63,9 @@ public class Version extends SigarCommandBase {
os.println("OS patch level......" + sys.getPatchLevel()); os.println("OS patch level......" + sys.getPatchLevel());
os.println("OS vendor..........." + sys.getVendor()); os.println("OS vendor..........." + sys.getVendor());
os.println("OS vendor version..." + sys.getVendorVersion()); os.println("OS vendor version..." + sys.getVendorVersion());
if (sys.getVendorCodeName() != null) {
os.println("OS code name........" + sys.getVendorCodeName());
}
os.println("OS data model......." + sys.getDataModel()); os.println("OS data model......." + sys.getDataModel());
os.println("OS cpu endian......." + sys.getCpuEndian()); os.println("OS cpu endian......." + sys.getCpuEndian());