Mailinglist Archive: yast-commit (687 mails)

< Previous Next >
[yast-commit] r43563 - /trunk/pkg-bindings/src/Keyring.cc
  • From: lslezak@xxxxxxxxxxxxxxxx
  • Date: Fri, 11 Jan 2008 16:20:32 -0000
  • Message-id: <20080111162032.544D531B10@xxxxxxxxxxxxxxxx>
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 <ycp/YCPString.h>
#include <ycp/YCPList.h>
#include <ycp/YCPMap.h>
+#include <ycp/YCPInteger.h>

#include <zypp/KeyRing.h>
#include <zypp/PublicKey.h>
#include <zypp/Pathname.h>
+#include <zypp/Date.h>


/****************************************************************************************
* @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@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages