Author: lslezak
Date: Fri Jan 11 17:20:31 2008
New Revision: 43563
URL: http://svn.opensuse.org/viewcvs/yast?rev=43563&view=rev
Log:
- added support for 'created' and 'expires' dates
Modified:
trunk/pkg-bindings/src/Keyring.cc
Modified: trunk/pkg-bindings/src/Keyring.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Keyring.cc?rev=43563&r1=43562&r2=43563&view=diff
==============================================================================
--- trunk/pkg-bindings/src/Keyring.cc (original)
+++ trunk/pkg-bindings/src/Keyring.cc Fri Jan 11 17:20:31 2008
@@ -29,10 +29,12 @@
#include
#include
#include
+#include
#include
#include
#include
+#include
/****************************************************************************************
* @builtin ImportGPGKey
@@ -79,6 +81,16 @@
// is the key trusted?
gpg_map->add(YCPString("trusted"), YCPBoolean(trusted));
+
+ zypp::Date date(key.created());
+ // %x = date only, see man strftime
+ gpg_map->add(YCPString("created"), YCPString(date.form("%x")));
+ gpg_map->add(YCPString("created_raw"), YCPInteger(zypp::Date::ValueType(date)));
+
+ date = key.expires();
+ std::string expires((date == 0) ? _("Never") : date.form("%x"));
+ gpg_map->add(YCPString("expires"), YCPString(expires));
+ gpg_map->add(YCPString("expires_raw"), YCPInteger(zypp::Date::ValueType(date)));
}
YCPMap getMap() const
@@ -125,7 +137,8 @@
* Read known or trusted keys from the package manager
*
* @param boolean trusted If set to true trusted keys are returned,
- * @return list List of maps $[ "id" : string , "name" : string, "fingerprint" : string, "trusted" : boolean ], nil when an error occurred
+ * @return list List of maps $[ "id" : string , "name" : string, "fingerprint" : string, "trusted" : boolean,
+ * "created" : string, "created_raw" : integer, "expires" : string, "expires_raw" : integer ] or nil when an error occurred
**/
YCPValue PkgFunctions::GPGKeys(const YCPBoolean& trusted)
{
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org