diff options
author | J Shane Culpepper <pepper@eazel.com> | 2000-12-22 00:32:03 +0000 |
---|---|---|
committer | J Shane Culpepper <pepper@src.gnome.org> | 2000-12-22 00:32:03 +0000 |
commit | ce4b8d117e04368436812b584d6da79b0bc13c88 (patch) | |
tree | 7f16a472a100f5aa25e35a1edd0d194799b7b78c | |
parent | 9087030940609da15d687c0e60360aab8afcb695 (diff) | |
download | nautilus-ce4b8d117e04368436812b584d6da79b0bc13c88.tar.gz |
reviewed by: Gene Z. Ragan <gzr@eazel.com>
2000-12-21 J Shane Culpepper <pepper@eazel.com>
reviewed by: Gene Z. Ragan <gzr@eazel.com>
* components/services/install/lib/eazel-inventory-utils.c:
(add_package_info), (add_hardware_info), (add_software_info),
(eazel_create_configuration_metafile):
Added the SOFTWARE node to the xml generation. Added
bogomips, flags, and distribution to information gathered.
There are very few things missing from the collection engine
now.
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | components/services/install/lib/eazel-inventory-utils.c | 39 | ||||
-rw-r--r-- | components/services/inventory/eazel-inventory-utils.c | 39 |
3 files changed, 83 insertions, 8 deletions
@@ -1,3 +1,16 @@ +2000-12-21 J Shane Culpepper <pepper@eazel.com> + + reviewed by: Gene Z. Ragan <gzr@eazel.com> + + * components/services/install/lib/eazel-inventory-utils.c: + (add_package_info), (add_hardware_info), (add_software_info), + (eazel_create_configuration_metafile): + + Added the SOFTWARE node to the xml generation. Added + bogomips, flags, and distribution to information gathered. + There are very few things missing from the collection engine + now. + 2000-12-21 Gene Z. Ragan <gzr@eazel.com> Fixed bug 5218, The desktop is missing devices. (cdrom & vfat volume) diff --git a/components/services/install/lib/eazel-inventory-utils.c b/components/services/install/lib/eazel-inventory-utils.c index d76613647..e539be589 100644 --- a/components/services/install/lib/eazel-inventory-utils.c +++ b/components/services/install/lib/eazel-inventory-utils.c @@ -40,6 +40,7 @@ #include <gconf/gconf-engine.h> #include <libtrilobite/trilobite-md5-tools.h> +#include <libtrilobite/trilobite-core-distribution.h> #define notDEBUG_pepper 1 @@ -93,7 +94,7 @@ get_package_list (EazelPackageSystem *package_system) /* add package data from the package database to the passed in xml document */ static void -add_package_info (xmlDocPtr configuration_metafile) +add_package_info (xmlDocPtr configuration_metafile, xmlNodePtr node) { char package_count_str[32]; @@ -117,7 +118,7 @@ add_package_info (xmlDocPtr configuration_metafile) packages = get_package_list (package_system); /* add the PACKAGES node */ - packages_node = xmlNewChild (configuration_metafile->root, NULL, "PACKAGES", NULL); + packages_node = xmlNewChild (node, NULL, "PACKAGES", NULL); /* iterate through all of the installed packages */ @@ -281,6 +282,8 @@ add_hardware_info (xmlDocPtr configuration_metafile) add_info (cpu_node, temp_string, "STEPPING", "stepping"); add_info (cpu_node, temp_string, "SPEED", "cpu MHz"); add_info (cpu_node, temp_string, "CACHE", "cache size"); + add_info (cpu_node, temp_string, "BOGOMIPS", "bogomips"); + add_info (cpu_node, temp_string, "FLAGS", "flags"); g_free (temp_string); /* now handle IO port info */ @@ -290,6 +293,34 @@ add_hardware_info (xmlDocPtr configuration_metafile) g_free (temp_string); } +/* add hardware info from the /proc directory to the passed in xml document */ +static void +add_software_info (xmlDocPtr configuration_metafile) +{ + + xmlNodePtr distribution_node; + xmlNodePtr software_node; + DistributionInfo distro; + char *distro_string; + + /* add the SOFTWARE node */ + software_node = xmlNewChild (configuration_metafile->root, NULL, "SOFTWARE", NULL); + + /* add the distribution string */ + distro = trilobite_get_distribution (); + distro_string = trilobite_get_distribution_name (distro, TRUE, FALSE); + distribution_node = xmlNewChild (software_node, NULL, "DISTRIBUTION", NULL); + if (!distro_string) { + distro_string = g_strdup_printf ("Unknown Distribution"); + } + xmlNodeSetContent (distribution_node, distro_string); + + /* add the package info */ + add_package_info (configuration_metafile, software_node); + + g_free (distro_string); +} + /* create the configuration metafile and add package and hardware configuration info to it */ static xmlDocPtr eazel_create_configuration_metafile (void) @@ -315,8 +346,8 @@ eazel_create_configuration_metafile (void) /* xmlSetProp (container_node, "date", time_string); */ g_free (time_string); - /* add the package info */ - add_package_info (configuration_metafile); + /* add the software info */ + add_software_info (configuration_metafile); /* add the hardware info */ add_hardware_info (configuration_metafile); diff --git a/components/services/inventory/eazel-inventory-utils.c b/components/services/inventory/eazel-inventory-utils.c index d76613647..e539be589 100644 --- a/components/services/inventory/eazel-inventory-utils.c +++ b/components/services/inventory/eazel-inventory-utils.c @@ -40,6 +40,7 @@ #include <gconf/gconf-engine.h> #include <libtrilobite/trilobite-md5-tools.h> +#include <libtrilobite/trilobite-core-distribution.h> #define notDEBUG_pepper 1 @@ -93,7 +94,7 @@ get_package_list (EazelPackageSystem *package_system) /* add package data from the package database to the passed in xml document */ static void -add_package_info (xmlDocPtr configuration_metafile) +add_package_info (xmlDocPtr configuration_metafile, xmlNodePtr node) { char package_count_str[32]; @@ -117,7 +118,7 @@ add_package_info (xmlDocPtr configuration_metafile) packages = get_package_list (package_system); /* add the PACKAGES node */ - packages_node = xmlNewChild (configuration_metafile->root, NULL, "PACKAGES", NULL); + packages_node = xmlNewChild (node, NULL, "PACKAGES", NULL); /* iterate through all of the installed packages */ @@ -281,6 +282,8 @@ add_hardware_info (xmlDocPtr configuration_metafile) add_info (cpu_node, temp_string, "STEPPING", "stepping"); add_info (cpu_node, temp_string, "SPEED", "cpu MHz"); add_info (cpu_node, temp_string, "CACHE", "cache size"); + add_info (cpu_node, temp_string, "BOGOMIPS", "bogomips"); + add_info (cpu_node, temp_string, "FLAGS", "flags"); g_free (temp_string); /* now handle IO port info */ @@ -290,6 +293,34 @@ add_hardware_info (xmlDocPtr configuration_metafile) g_free (temp_string); } +/* add hardware info from the /proc directory to the passed in xml document */ +static void +add_software_info (xmlDocPtr configuration_metafile) +{ + + xmlNodePtr distribution_node; + xmlNodePtr software_node; + DistributionInfo distro; + char *distro_string; + + /* add the SOFTWARE node */ + software_node = xmlNewChild (configuration_metafile->root, NULL, "SOFTWARE", NULL); + + /* add the distribution string */ + distro = trilobite_get_distribution (); + distro_string = trilobite_get_distribution_name (distro, TRUE, FALSE); + distribution_node = xmlNewChild (software_node, NULL, "DISTRIBUTION", NULL); + if (!distro_string) { + distro_string = g_strdup_printf ("Unknown Distribution"); + } + xmlNodeSetContent (distribution_node, distro_string); + + /* add the package info */ + add_package_info (configuration_metafile, software_node); + + g_free (distro_string); +} + /* create the configuration metafile and add package and hardware configuration info to it */ static xmlDocPtr eazel_create_configuration_metafile (void) @@ -315,8 +346,8 @@ eazel_create_configuration_metafile (void) /* xmlSetProp (container_node, "date", time_string); */ g_free (time_string); - /* add the package info */ - add_package_info (configuration_metafile); + /* add the software info */ + add_software_info (configuration_metafile); /* add the hardware info */ add_hardware_info (configuration_metafile); |