[ubuntu-mono] [Bug 896512] Re: Sysinfo reports incorrect Gnome version on Ubuntu 11.10
Chris McIntosh
896512 at bugs.launchpad.net
Sun Dec 4 12:15:41 UTC 2011
I thought that I'd file a bug (https://bugs.launchpad.net/ubuntu/+source
/gnome-desktop/+bug/899882) against the source of this error...
But, it occurred to me (while writing that bug report) that the correct solution would be to change sysinfo to behave like this (source code is listed below):
1) Currently, the Gnome() method assigns "/usr/share/gnome-about/gnome-version.xml" to the String variable gnome_about. It then changes the value of the string in case there exists a "gnome-version.xml" file in the "/opt/gnome/share/gnome-about/" directory.
PROPOSAL:
2) A similar change should be made if there exists a "gnome-version.xml" file in the "/usr/share/gnome/" directory. (This file comes from the gnome-desktop3-data package).
Here is the Gnome() method from SystemInfo.cs in the sysinfo package:
//read GNOME version
public void Gnome() {
String temp;
Boolean gnomeB = false;
//Fedora,RedHat,Debian,Ubuntu,...
String gnome_about = "/usr/share/gnome-about/gnome-version.xml";
//SuSE
if (File.Exists("/opt/gnome/share/gnome-about/gnome-version.xml"))
gnome_about = "/opt/gnome/share/gnome-about/gnome-version.xml";
try {
using (TextReader textread = File.OpenText(gnome_about)) {
while ( gnomeB == false ) {
temp = textread.ReadLine();
//get version from xml
if ( temp.EndsWith("platform>")) {
temp = temp.Remove(0, 12);
temp = temp.Remove(temp.IndexOf("</platform>"), 11);
system_gnomev = temp;
}
if ( temp.EndsWith("minor>")) {
temp = temp.Remove(0, 9);
temp = temp.Remove(temp.IndexOf("</minor>"), 8);
system_gnomev = system_gnomev + "." + temp;
}
if ( temp.EndsWith("micro>")) {
temp = temp.Remove(0, 9);
temp = temp.Remove(temp.IndexOf("</micro>"), 8);
system_gnomev = system_gnomev + "." + temp;
}
//get distributor
if ( temp.EndsWith("distributor>")) {
temp = temp.Remove(0, 15);
temp = temp.Remove(temp.IndexOf("</distributor>"), 14);
system_gnomeo = temp;
}
//get build date
if ( temp.EndsWith("date>")) {
temp = temp.Remove(0, 8);
temp = temp.Remove(temp.IndexOf("</date>"), 7);
system_gnomeo = system_gnomeo + " " + temp;
gnomeB = true;
}
}
}
}
catch (FileNotFoundException ex) { Console.WriteLine( ex ); }
catch (DirectoryNotFoundException ex) { Console.WriteLine( ex ); }
}
--
You received this bug notification because you are a member of Ubuntu
CLI/Mono Uploaders, which is subscribed to sysinfo in Ubuntu.
https://bugs.launchpad.net/bugs/896512
Title:
Sysinfo reports incorrect Gnome version on Ubuntu 11.10
Status in “sysinfo” package in Ubuntu:
Confirmed
Bug description:
On Ubuntu 11.10, gnome-system-monitor reports the following:
Ubuntu
Release 11.10 (Oneiric)
Kernel Linux 3.0.0-13-generic
Gnome 3.2.1
and other information.
When running Sysinfo on the same machine (in the same session), it reports:
GNOME: 2.32.1 (Ubuntu 2011-04-14)
Kernel: 3.0.0-13-generic (#22-Ubuntu SMP...)
Clearly the Gnome version is incorrectly reported. I am, indeed,
using Gnome 3.
lsb_release -rd reports:
Description: Ubuntu 11.10
Release: 11.10
Using Sysinfo package (0.7-6)
Hope this helps to improve an otherwise nice tool.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/sysinfo/+bug/896512/+subscriptions
More information about the Ubuntu-mono
mailing list