[Oval-commits] r84 - trunk/Interpreters/src/probes/linux

Pavel Vinogradov blaze-guest at alioth.debian.org
Sun Jul 15 10:43:09 UTC 2007


Author: blaze-guest
Date: 2007-07-15 10:43:08 +0000 (Sun, 15 Jul 2007)
New Revision: 84

Modified:
   trunk/Interpreters/src/probes/linux/DPKGInfoProbe.cpp
Log:
Split version to version and release. Use 0 as default epoch.


Modified: trunk/Interpreters/src/probes/linux/DPKGInfoProbe.cpp
===================================================================
--- trunk/Interpreters/src/probes/linux/DPKGInfoProbe.cpp	2007-07-14 08:05:58 UTC (rev 83)
+++ trunk/Interpreters/src/probes/linux/DPKGInfoProbe.cpp	2007-07-15 10:43:08 UTC (rev 84)
@@ -339,12 +339,20 @@
 			  	  installedEpochEvr = installed_epoch;
 			      }
 			*/
-			  	installed_epoch = "(none)";
+			  	//installed_epoch = "(none)";
+				installed_epoch = "0";
 			  	installedEpochEvr = installed_epoch;
 			  /* the remaining arguments are all normal strings */
-			    installed_version = this->readHeaderString(section, "Version");
-			    installed_release = this->readHeaderString(section, "Version");
-			    installed_architecture = this->readHeaderString(section, "Architecture");
+				string version = this->readHeaderString(section, "Version");
+				string::size_type find = version.rfind('-');
+				if (find != string::npos) {
+					installed_version = version.substr(0, find);
+					installed_release = version.substr(find+1, version.length());
+				} else {
+					installed_version = version;
+					installed_release = "0";
+				}
+			    	installed_architecture = this->readHeaderString(section, "Architecture");
 				installed_evr = installedEpochEvr + ":" + installed_version + "-" + installed_release;
 
 			    /* Put the data in a data object. */




More information about the Oval-commits mailing list