/soc/2012/sanket/statscollector-2.x.y: 91b7a92fbdc9: Add libpurp...

Sanket Agarwal sanket at soc.pidgin.im
Tue Jul 10 00:36:22 EDT 2012


Changeset: 91b7a92fbdc920cf96c584aaf9104276b680a4db
Author:	 Sanket Agarwal <sanket at soc.pidgin.im>
Date:	 2012-05-14 10:03 +0000
Branch:	 soc.2012.statscollector
URL: http://hg.pidgin.im/soc/2012/sanket/statscollector-2.x.y/rev/91b7a92fbdc9

Description:

Add libpurple information

We now record the major, minor and micro versions of libpurple
as part of ``purple-version'' information.

diffstat:

 pidgin/plugins/statscollector.c |  34 ++++++++++++++++++++++++++++++----
 1 files changed, 30 insertions(+), 4 deletions(-)

diffs (66 lines):

diff --git a/pidgin/plugins/statscollector.c b/pidgin/plugins/statscollector.c
--- a/pidgin/plugins/statscollector.c
+++ b/pidgin/plugins/statscollector.c
@@ -35,6 +35,9 @@
 
   nroot = xmlnode_new("stats");
 
+  /* Load CPUinfo strucutre */
+  xmlnode_insert_child(nroot, cpuinfo_xml);
+
   nacc = xmlnode_new_child(nroot, "accounts");
   nplugins = xmlnode_new_child(nroot, "plugins");
 
@@ -60,9 +63,6 @@
 
   }
 
-  /* Load CPUinfo strucutre */
-  xmlnode_insert_child(nroot, cpuinfo_xml);
-
   data = xmlnode_to_formatted_str(nroot, NULL);
   purple_util_write_data_to_file("stats.xml", data, -1);
 
@@ -86,8 +86,9 @@
 
   /* Obtains a XML node containing the CPU info */
 
-  xmlnode *root, *languages, *hardware, *node;
+  xmlnode *root, *languages, *hardware, *node, *ver, *ver1;
   const char * const * langs;
+  char temp[10];
   int i;
 
   root = xmlnode_new("cpuinfo");
@@ -108,6 +109,31 @@
 
   }
 
+  /* Version information */
+
+  ver = xmlnode_new("purple-version");
+
+  /* Major version */
+  ver1 = xmlnode_new("major");
+  sprintf(temp, "%d", PURPLE_MAJOR_VERSION);
+  xmlnode_insert_data(ver1, temp, -1);
+  xmlnode_insert_child(ver, ver1);
+
+  /* Minor version */
+  ver1 = xmlnode_new("minor");
+  sprintf(temp, "%d", PURPLE_MINOR_VERSION);
+  xmlnode_insert_data(ver1, temp, -1);
+  xmlnode_insert_child(ver, ver1);
+
+  /* Micro version */
+  ver1 = xmlnode_new("micro");
+  sprintf(temp, "%d", PURPLE_MICRO_VERSION);
+  xmlnode_insert_data(ver1, temp, -1);
+  xmlnode_insert_child(ver, ver1);
+
+  /* Add the version information to the root cpuinfo */
+  xmlnode_insert_child(root, ver);
+
   purple_debug_info("STATS", "%s\n", xmlnode_to_formatted_str(root, NULL));
 
   return root;



More information about the Commits mailing list