Sysinfo reports incorrect Gnome version on Ubuntu 11.10

Bug #896512 reported by Chris McIntosh
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
sysinfo (Ubuntu)
Fix Released
Low
Iain Lane

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.

Sam_ (and-sam)
Changed in sysinfo (Ubuntu):
status: New → Confirmed
Revision history for this message
Chris McIntosh (gnu-know-who) wrote :

The problem lies in the gnome-desktop-data package. sysinfo gets its info from /usr/share/gnome-about/gnome-version.xml. This file actually comes from the gnome-desktop-data package.

There is a second package, gnome-desktop3-data, which also contains a gnome-version.xml file (in /usr/share/gnome/ directory). Indeed both gnome-desktop-data and gnome-desktop3-data each refer to itself as "gnome-desktop" in its corresponding README file contained in /usr/share/doc/gnome-desktop-data and /usr/share/doc/gnome-desktop3-data respectively.

As a temporary (and local) fix, I tried replacing the gnome-version.xml file in the /usr/share/gnome-about/ directory with the one from /usr/share/gnome/. However, this did not work... apparently because the latter file does not contain the <description> section. So, I resolved to simply update the <platform>, <minor>, <micro>, <distributor>, and <date> sections of the former with the values from the latter.

This fixed the problem.

Revision history for this message
Chris McIntosh (gnu-know-who) wrote :

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 ); }
  }

tags: added: 12.04
Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

This issue also happens on Ubuntu 12.04.
I have made a patch for this.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Hey Iain, is there any way you could get that fix in Debian so we stay in sync?

Changed in sysinfo (Ubuntu):
assignee: nobody → Iain Lane (laney)
importance: Undecided → Low
Revision history for this message
Iain Lane (laney) wrote :

Yes, uploaded to Debian. I'll sync when it becomes available soon. Thanks for the patch!

Changed in sysinfo (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sysinfo - 0.7-9

---------------
sysinfo (0.7-9) experimental; urgency=low

  * [924c8ab] Add new patch to look in the new path for GNOME version.
    Thanks to Shih-Yuan Lee (FourDollars) <email address hidden> (LP: #896512)

 -- Iain Lane <email address hidden> Fri, 06 Jul 2012 11:49:56 +0100

Changed in sysinfo (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.