Hello community,
here is the log from the commit of package libzypp for openSUSE:Factory
checked in at Fri May 14 00:24:47 CEST 2010.
--------
--- libzypp/libzypp.changes 2010-05-03 18:45:18.000000000 +0200
+++ /mounts/work_src_done/STABLE/libzypp/libzypp.changes 2010-05-12 19:36:06.000000000 +0200
@@ -1,0 +2,37 @@
+Wed May 12 19:09:54 CEST 2010 - ma@suse.de
+
+- Add methods to evaluate gpg geys expiration dates.
+- Export all rpmDb keys to the zypp trusted keyring in one go.
+- version 7.6.0 (6)
+
+-------------------------------------------------------------------
+Wed May 12 17:35:44 CEST 2010 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun May 9 01:13:45 CEST 2010 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Sat May 8 01:13:43 CEST 2010 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Fri May 7 01:13:55 CEST 2010 - ma@suse.de
+
+- Update zypp-po.tar.bz2 (Revision: 54959)
+
+-------------------------------------------------------------------
+Wed May 5 14:49:39 CEST 2010 - ma@suse.de
+
+- Update zypp-po.tar.bz2 (Revision: 54959)
+
+-------------------------------------------------------------------
+Tue May 4 01:13:43 CEST 2010 - ma@suse.de
+
+- Update translations.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
libzypp-7.5.0.tar.bz2
New:
----
libzypp-7.6.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libzypp.spec ++++++
--- /var/tmp/diff_new_pack.lmv44P/_old 2010-05-14 00:24:17.000000000 +0200
+++ /var/tmp/diff_new_pack.lmv44P/_new 2010-05-14 00:24:17.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package libzypp (Version 7.5.0)
+# spec file for package libzypp (Version 7.6.0)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -24,7 +24,7 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-build
AutoReqProv: on
Summary: Package, Patch, Pattern, and Product Management
-Version: 7.5.0
+Version: 7.6.0
Release: 1
Source: %{name}-%{version}.tar.bz2
Source1: %{name}-rpmlintrc
++++++ libzypp-7.5.0.tar.bz2 -> libzypp-7.6.0.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-7.5.0/VERSION.cmake new/libzypp-7.6.0/VERSION.cmake
--- old/libzypp-7.5.0/VERSION.cmake 2010-05-03 18:22:45.000000000 +0200
+++ new/libzypp-7.6.0/VERSION.cmake 2010-05-12 19:16:41.000000000 +0200
@@ -59,10 +59,10 @@
# changes file. See './mkChangelog -h' for help.
#
SET(LIBZYPP_MAJOR "7")
-SET(LIBZYPP_COMPATMINOR "5")
-SET(LIBZYPP_MINOR "5")
+SET(LIBZYPP_COMPATMINOR "6")
+SET(LIBZYPP_MINOR "6")
SET(LIBZYPP_PATCH "0")
#
-# LAST RELEASED: 7.5.0 (5)
+# LAST RELEASED: 7.6.0 (6)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-7.5.0/package/libzypp.changes new/libzypp-7.6.0/package/libzypp.changes
--- old/libzypp-7.5.0/package/libzypp.changes 2010-05-03 18:22:45.000000000 +0200
+++ new/libzypp-7.6.0/package/libzypp.changes 2010-05-12 19:16:42.000000000 +0200
@@ -1,4 +1,41 @@
-------------------------------------------------------------------
+Wed May 12 19:09:54 CEST 2010 - ma@suse.de
+
+- Add methods to evaluate gpg geys expiration dates.
+- Export all rpmDb keys to the zypp trusted keyring in one go.
+- version 7.6.0 (6)
+
+-------------------------------------------------------------------
+Wed May 12 17:35:44 CEST 2010 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun May 9 01:13:45 CEST 2010 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Sat May 8 01:13:43 CEST 2010 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Fri May 7 01:13:55 CEST 2010 - ma@suse.de
+
+- Update zypp-po.tar.bz2 (Revision: 54959)
+
+-------------------------------------------------------------------
+Wed May 5 14:49:39 CEST 2010 - ma@suse.de
+
+- Update zypp-po.tar.bz2 (Revision: 54959)
+
+-------------------------------------------------------------------
+Tue May 4 01:13:43 CEST 2010 - ma@suse.de
+
+- Update translations.
+
+-------------------------------------------------------------------
Mon May 3 18:12:36 CEST 2010 - ma@suse.de
- Improve solver.cleandepsOnRemove result by evaluating the install
Files old/libzypp-7.5.0/po/zypp-po.tar.bz2 and new/libzypp-7.6.0/po/zypp-po.tar.bz2 differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-7.5.0/tools/CMakeLists.txt new/libzypp-7.6.0/tools/CMakeLists.txt
--- old/libzypp-7.5.0/tools/CMakeLists.txt 2010-05-03 18:22:45.000000000 +0200
+++ new/libzypp-7.6.0/tools/CMakeLists.txt 2010-05-12 19:16:42.000000000 +0200
@@ -13,6 +13,7 @@
)
TARGET_LINK_LIBRARIES( ${loop_var}
zypp
+ boost_program_options-mt
)
ENDFOREACH( loop_var )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-7.5.0/tools/zypp-pubkey.cc new/libzypp-7.6.0/tools/zypp-pubkey.cc
--- old/libzypp-7.5.0/tools/zypp-pubkey.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-7.6.0/tools/zypp-pubkey.cc 2010-05-12 19:16:42.000000000 +0200
@@ -0,0 +1,128 @@
+#define INCLUDE_TESTSETUP_WITHOUT_BOOST
+#include "zypp/../tests/lib/TestSetup.h"
+#undef INCLUDE_TESTSETUP_WITHOUT_BOOST
+#define message cout
+using std::flush;
+
+#include
+namespace opt = boost::program_options;
+
+#include
+
+static std::string appname( "unknown" );
+
+int errexit( const std::string & msg_r = std::string(), int exit_r = 100 )
+{
+ if ( ! msg_r.empty() )
+ {
+ cerr << endl << msg_r << endl << endl;
+ }
+ return exit_r;
+}
+
+bool byTTL( const PublicKey & lhs, const PublicKey & rhs )
+{
+ int cmp = lhs.gpgPubkeyVersion().compare( rhs.gpgPubkeyVersion() );
+ if ( cmp ) return cmp < 0;
+ return lhs.gpgPubkeyRelease() > rhs.gpgPubkeyRelease(); // intentionally reverse cdate
+}
+
+/******************************************************************
+**
+** FUNCTION NAME : main
+** FUNCTION TYPE : int
+*/
+int main( int argc, char * argv[] )
+{
+ appname = Pathname::basename( argv[0] );
+ ///////////////////////////////////////////////////////////////////
+
+ opt::options_description options( "Options" );
+ options.add_options()
+ ( "key-file", opt::valuestd::string >(),
+ "ASCII ascii armored public key file")
+ ( "root", opt::valuestd::string()->default_value( "/" ),
+ "Use the rmp database from system rooted at ARG")
+ ( "help,?", "Produce this help message")
+ ;
+
+ opt::positional_options_description positional;
+ positional.add( "key-file", -1 );
+
+ opt::variables_map vm;
+ opt::store( opt::command_line_parser( argc, argv ).options( options ).positional( positional ).run(), vm );
+ opt::notify( vm );
+
+ if ( vm.count( "help" ) )
+ {
+ cerr << "Usage: " << appname << " [OPTIONS] [key-files...]" << endl;
+ cerr << "If no key files are given, list info about all gpg-pubkeys in the rpm database." << endl;
+ cerr << "Otherwise print info about each key and wheter it is present in the rpm database. " << endl;
+ cerr << options << endl;
+ return 1;
+ }
+ ///////////////////////////////////////////////////////////////////
+
+ if ( ! PathInfo( vm["root"].asstd::string() ).isDir() )
+ return errexit("--root requires a directory");
+
+ target::rpm::RpmDb rpmdb;
+ rpmdb.initDatabase( vm["root"].asstd::string() );
+ std::list<PublicKey> rpmpubkeys( rpmdb.pubkeys() );
+ rpmpubkeys.sort( byTTL );
+
+ if ( ! vm.count( "key-file" ) )
+ {
+ std::string last;
+ for_each_( it, rpmpubkeys )
+ {
+ if ( last == it->gpgPubkeyVersion() )
+ cout << *it << endl;
+ else
+ {
+ cout << dump( *it ) << endl;
+ last = it->gpgPubkeyVersion();
+ }
+ }
+ return 0;
+ }
+
+ ///////////////////////////////////////////////////////////////////
+
+ const std::vectorstd::string & keyFiles( vm["key-file"].as< std::vectorstd::string >() );
+ for_each_( it, vm["key-file"].as< std::vectorstd::string >() )
+ {
+ cout << "=== " << PathInfo(*it) << endl;
+ PublicKey pubkey( *it );
+ cout << dump( pubkey ) << endl;
+
+ std::string pubkeyV( pubkey.gpgPubkeyVersion() );
+ std::string pubkeyR( pubkey.gpgPubkeyRelease() );
+ unsigned count = 0;
+ for_each_( rpmpub, rpmpubkeys )
+ {
+ if ( rpmpub->gpgPubkeyVersion() == pubkeyV )
+ {
+ int cmp = rpmpub->gpgPubkeyRelease().compare( pubkeyR );
+ if ( cmp < 0 )
+ cout << "<<< ";
+ else if ( cmp > 0 )
+ cout << ">>> ";
+ else
+ {
+ ++count;
+ cout << "*** ";
+ }
+ cout << "gpg-pubkey-" << rpmpub->gpgPubkeyVersion() << "-" << rpmpub->gpgPubkeyRelease() << " " << rpmpub->daysToLive() << endl;
+ }
+ }
+ if ( ! count )
+ {
+ cout << "*** Not in rpm database." << endl;
+ }
+ cout << endl;
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-7.5.0/zypp/Callback.h new/libzypp-7.6.0/zypp/Callback.h
--- old/libzypp-7.5.0/zypp/Callback.h 2010-05-03 18:22:45.000000000 +0200
+++ new/libzypp-7.6.0/zypp/Callback.h 2010-05-12 19:16:41.000000000 +0200
@@ -226,6 +226,7 @@
* to the ctor. The ReceiveReport is connected, a previously
* connected ReceiveReport is remembered and re-connected in
* the dtor.
+ * Use the default ctpr to temporarily disconnect any connected report.
* \code
* struct FooReceive : public callback::ReceiveReport<Foo>
* {..};
@@ -250,6 +251,12 @@
typedef ReceiveReport<_Report> Receiver;
typedef DistributeReport<_Report> Distributor;
+ TempConnect()
+ : _oldRec( Distributor::instance().getReceiver() )
+ {
+ Distributor::instance().noReceiver();
+ }
+
TempConnect( Receiver & rec_r )
: _oldRec( Distributor::instance().getReceiver() )
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-7.5.0/zypp/Date.h new/libzypp-7.6.0/zypp/Date.h
--- old/libzypp-7.5.0/zypp/Date.h 2010-05-03 18:22:45.000000000 +0200
+++ new/libzypp-7.6.0/zypp/Date.h 2010-05-12 19:16:41.000000000 +0200
@@ -36,6 +36,19 @@
typedef time_t ValueType;
+ static const ValueType second = 1;
+ static const ValueType minute = 60;
+ static const ValueType hour = 3600;
+ static const ValueType day = 86400;
+ static const ValueType month28 = 2419200;
+ static const ValueType month29 = 2505600;
+ static const ValueType month30 = 2592000;
+ static const ValueType month31 = 2678400;
+ static const ValueType month = month30;
+ static const ValueType year365 = 31536000;
+ static const ValueType year366 = 31622400;
+ static const ValueType year = year365;
+
/** Default ctor: 0 */
Date()
: _date( 0 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-7.5.0/zypp/KeyRing.cc new/libzypp-7.6.0/zypp/KeyRing.cc
--- old/libzypp-7.5.0/zypp/KeyRing.cc 2010-05-03 18:22:45.000000000 +0200
+++ new/libzypp-7.6.0/zypp/KeyRing.cc 2010-05-12 19:16:41.000000000 +0200
@@ -94,6 +94,7 @@
}
void importKey( const PublicKey &key, bool trusted = false);
+ void multiKeyImport( const Pathname & keyfile_r, bool trusted_r = false);
void deleteKey( const string &id, bool trusted );
string readSignatureKeyId( const Pathname &signature );
@@ -177,6 +178,11 @@
}
}
+ void KeyRing::Impl::multiKeyImport( const Pathname & keyfile_r, bool trusted_r )
+ {
+ importKey( keyfile_r, trusted_r ? trustedKeyRing() : generalKeyRing() );
+ }
+
void KeyRing::Impl::deleteKey( const string &id, bool trusted)
{
PublicKey key;
@@ -719,6 +725,11 @@
_pimpl->importKey( key, trusted );
}
+ void KeyRing::multiKeyImport( const Pathname & keyfile_r, bool trusted_r )
+ {
+ _pimpl->multiKeyImport( keyfile_r, trusted_r );
+ }
+
string KeyRing::readSignatureKeyId( const Pathname &signature )
{
return _pimpl->readSignatureKeyId(signature);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-7.5.0/zypp/KeyRing.h new/libzypp-7.6.0/zypp/KeyRing.h
--- old/libzypp-7.5.0/zypp/KeyRing.h 2010-05-03 18:22:45.000000000 +0200
+++ new/libzypp-7.6.0/zypp/KeyRing.h 2010-05-12 19:16:41.000000000 +0200
@@ -170,8 +170,6 @@
public:
/** Default ctor */
KeyRing(const Pathname &baseTmpDir);
- //explicit
- //KeyRing(const Pathname &general_kr, const Pathname &trusted_kr);
/**
* imports a key from a file.
@@ -179,6 +177,9 @@
*/
void importKey( const PublicKey &key, bool trusted = false);
+ /** Initial import from \ref RpmDb. */
+ void multiKeyImport( const Pathname & keyfile_r, bool trusted_r = false );
+
void dumpTrustedPublicKey( const std::string &id, std::ostream &stream )
{ dumpPublicKey(id, true, stream); }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-7.5.0/zypp/PublicKey.cc new/libzypp-7.6.0/zypp/PublicKey.cc
--- old/libzypp-7.5.0/zypp/PublicKey.cc 2010-05-03 18:22:45.000000000 +0200
+++ new/libzypp-7.6.0/zypp/PublicKey.cc 2010-05-12 19:16:41.000000000 +0200
@@ -9,11 +9,14 @@
/** \file zypp/PublicKey.cc
*
*/
+#include <climits>
+
#include <iostream>
#include <vector>
//#include "zypp/base/Logger.h"
+#include "zypp/base/Gettext.h"
#include "zypp/base/String.h"
#include "zypp/base/Regex.h"
#include "zypp/PublicKey.h"
@@ -70,10 +73,13 @@
}
std::string asString() const
- { return "[" + id() + "-" + str::hexstring(created(),8).substr(2) + "] [" + name() + "] [" + fingerprint() + "]"; }
-
- std::string armoredData() const
- { return _data; }
+ {
+ return str::form( "[%s-%s] [%s] [%s] [TTL %d]",
+ id().c_str(), str::hexstring(created(),8).substr(2).c_str(),
+ name().c_str(),
+ fingerprint().c_str(),
+ daysToLive() );
+ }
std::string id() const
{ return _id; }
@@ -84,15 +90,63 @@
std::string fingerprint() const
{ return _fingerprint; }
+ std::string gpgPubkeyVersion() const
+ { return _id.empty() ? _id : str::toLower( _id.substr(8,8) ); }
+
+ std::string gpgPubkeyRelease() const
+ { return _created ? str::hexstring( _created ).substr(2) : std::string(); }
+
Date created() const
{ return _created; }
Date expires() const
{ return _expires; }
+ std::string expiresAsString() const
+ {
+ if ( !_expires )
+ { // translators: an annotation to a gpg keys expiry date
+ return _("(does not expire)");
+ }
+ std::string ret( _expires.asString() );
+ int ttl( daysToLive() );
+ if ( ttl <= 90 )
+ {
+ ret += " ";
+ if ( ttl < 0 )
+ { // translators: an annotation to a gpg keys expiry date
+ ret += _("(EXPIRED)");
+ }
+ else if ( ttl == 0 )
+ { // translators: an annotation to a gpg keys expiry date
+ ret += _("(expires within 24h)");
+ }
+ else
+ { // translators: an annotation to a gpg keys expiry date
+ ret += str::form( _PL("(expires in %d day)", "(expires in %d days)", ttl ), ttl );
+ }
+ }
+ return ret;
+ }
+
Pathname path() const
{ return _data_file.path(); }
+ bool expired() const
+ {
+ Date exp( expires() );
+ return( exp && exp < Date::now() );
+ }
+
+ int daysToLive() const
+ {
+ Date exp( expires() );
+ if ( ! expires() )
+ return INT_MAX;
+ exp -= Date::now();
+ return exp < 0 ? exp / Date::day - 1 : exp / Date::day;
+ }
+
protected:
void readFromFile()
@@ -199,7 +253,6 @@
std::string _id;
std::string _name;
std::string _fingerprint;
- std::string _data;
Date _created;
Date _expires;
@@ -245,9 +298,6 @@
std::string PublicKey::asString() const
{ return _pimpl->asString(); }
- std::string PublicKey::armoredData() const
- { return _pimpl->armoredData(); }
-
std::string PublicKey::id() const
{ return _pimpl->id(); }
@@ -257,12 +307,27 @@
std::string PublicKey::fingerprint() const
{ return _pimpl->fingerprint(); }
+ std::string PublicKey::gpgPubkeyVersion() const
+ { return _pimpl->gpgPubkeyVersion(); }
+
+ std::string PublicKey::gpgPubkeyRelease() const
+ { return _pimpl->gpgPubkeyRelease(); }
+
Date PublicKey::created() const
{ return _pimpl->created(); }
Date PublicKey::expires() const
{ return _pimpl->expires(); }
+ std::string PublicKey::expiresAsString() const
+ { return _pimpl->expiresAsString(); }
+
+ bool PublicKey::expired() const
+ { return _pimpl->expired(); }
+
+ int PublicKey::daysToLive() const
+ { return _pimpl->daysToLive(); }
+
Pathname PublicKey::path() const
{ return _pimpl->path(); }
@@ -284,7 +349,9 @@
str << " fpr " << obj.fingerprint() << endl;
str << " id " << obj.id() << endl;
str << " cre " << obj.created() << endl;
- str << " exp " << obj.expires() << endl;
+ str << " exp " << obj.expiresAsString() << endl;
+ str << " ttl " << obj.daysToLive() << endl;
+ str << " rpm " << obj.gpgPubkeyVersion() << "-" << obj.gpgPubkeyRelease() << endl;
str << "]";
return str;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-7.5.0/zypp/PublicKey.h new/libzypp-7.6.0/zypp/PublicKey.h
--- old/libzypp-7.5.0/zypp/PublicKey.h 2010-05-03 18:22:45.000000000 +0200
+++ new/libzypp-7.6.0/zypp/PublicKey.h 2010-05-12 19:16:41.000000000 +0200
@@ -111,22 +111,73 @@
{ return ( ! id().empty() && ! fingerprint().empty() && !path().empty() ); }
std::string asString() const;
- std::string armoredData() const;
std::string id() const;
std::string name() const;
std::string fingerprint() const;
+ /** Version rpm would assign to this key if imported into the rpm database.
+ * Rpm uses the lowercased trailing 8 byte from \ref id as \c version, and the
+ * creations dates lowercased hexadecimal representation as \c release.
+ * \see \ref gpgPubkeyRelease
+ * \code
+ * [zypp OBS Project ]
+ * fpr 47D7CE1DD600935B3B90365733D38EBC7FB7F464
+ * id 33D38EBC7FB7F464 <-- trailing 8 byte
+ * cre Thu Mar 13 19:15:40 2008 <-- converted to hex
+ * exp Sat May 22 20:15:40 2010
+ * ]
+ *
+ * Converting the creation date to its hexadecimal representation:
+ * $ bc <<<"obase=16;$(date -d 'Thu Mar 13 19:15:40 2008' +%s)"
+ * 47D96F4C
+ *
+ * Rpms name for this key: gpg-pubkey-7fb7f464-47d96f4c
+ * \endcode
+ */
+ std::string gpgPubkeyVersion() const;
+
+ /** Release rpm would assign to this key if imported into the rpm database.
+ * This is the creations dates hexadecimal representation as \c release lowercased.
+ * \see \ref gpgPubkeyVersion
+ */
+ std::string gpgPubkeyRelease() const;
+
/**
- * Date when the key was created (time is 00:00:00)
+ * Date when the key was created.
*/
Date created() const;
/**
- * Date when the key expires (time is 00:00:00)
+ * Date when the key expires.
* If the key never expires the date is Date() (i.e. 0 seconds since the epoch (1.1.1970))
*/
Date expires() const;
+ /**
+ * Expiry info in a human readable form.
+ * The exipry daye plus an annotation if the key has expired, or will
+ * expire within 90 days.
+ * \code
+ * (does not expire)
+ * Tue May 11 13:37:33 CEST 2010
+ * Tue May 11 13:37:33 CEST 2010 (expires in 90 days)
+ * Tue May 11 13:37:33 CEST 2010 (expires in 1 day)
+ * Tue May 11 13:37:33 CEST 2010 (expires within 24h)
+ * Tue May 11 13:37:33 CEST 2010 (EXPIRED)
+ * \endcode
+ */
+ std::string expiresAsString() const;
+
+ /** Whether the key has expired. */
+ bool expired() const;
+
+ /** Number of days (24h) until the key expires (or since it exired).
+ * A value of \c 0 means the key will expire within the next 24h.
+ * Negative values indicate the key has expired less than \c N days ago.
+ * For keys without expiration date \c INT_MAX is returned.
+ */
+ int daysToLive() const;
+
Pathname path() const;
bool operator==( PublicKey b ) const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-7.5.0/zypp/base/Easy.h new/libzypp-7.6.0/zypp/base/Easy.h
--- old/libzypp-7.5.0/zypp/base/Easy.h 2010-05-03 18:22:45.000000000 +0200
+++ new/libzypp-7.6.0/zypp/base/Easy.h 2010-05-12 19:16:41.000000000 +0200
@@ -22,6 +22,7 @@
* \endcode
*/
#define for_(IT,BEG,END) for ( typeof(BEG) IT = BEG, _for_end = END; IT != _for_end; ++IT )
+#define for_each_(IT,CONT) for_( IT, CONT.begin(), CONT.end() )
/** Simple C-array iterator
* \code
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-7.5.0/zypp/base/Gettext.h new/libzypp-7.6.0/zypp/base/Gettext.h
--- old/libzypp-7.5.0/zypp/base/Gettext.h 2010-05-03 18:22:45.000000000 +0200
+++ new/libzypp-7.6.0/zypp/base/Gettext.h 2010-05-12 19:16:41.000000000 +0200
@@ -21,7 +21,7 @@
#define _(MSG) ::zypp::gettext::dgettext( MSG )
/** Return translated text (plural form). */
-#define _PL(MSG1,MSG2,N) ::zypp::gettext::dngettext( MSG1; MSG2, N )
+#define _PL(MSG1,MSG2,N) ::zypp::gettext::dngettext( MSG1, MSG2, N )
///////////////////////////////////////////////////////////////////
namespace zypp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-7.5.0/zypp/target/rpm/RpmDb.cc new/libzypp-7.6.0/zypp/target/rpm/RpmDb.cc
--- old/libzypp-7.5.0/zypp/target/rpm/RpmDb.cc 2010-05-03 18:22:45.000000000 +0200
+++ new/libzypp-7.6.0/zypp/target/rpm/RpmDb.cc 2010-05-12 19:16:41.000000000 +0200
@@ -858,55 +858,45 @@
void RpmDb::exportTrustedKeysInZyppKeyRing()
{
MIL << "Exporting rpm keyring into zypp trusted keyring" <keyRing()->trustedPublicKeys() );
- for_( it, rpm_keys.begin(), rpm_keys.end() )
+ // Temporarily disconnect to prevent the attemt to re-import the exported keys.
+ callback::TempConnect<KeyRingSignals> tempDisconnect;
+
+ TmpFile tmpfile( getZYpp()->tmpPath() );
{
- // search the zypp key into the rpm keys
- // long id is edition version + release
- string id = str::toUpper( (*it).version() + (*it).release());
- list<PublicKey>::iterator ik( find( zypp_keys.begin(), zypp_keys.end(), id) );
- if ( ik != zypp_keys.end() )
- {
- MIL << "Key " << (*it) << " is already in zypp database." << endl;
- }
- else
+ ofstream tmpos( tmpfile.path().c_str() );
+ for_( it, rpm_keys.begin(), rpm_keys.end() )
{
- // we export the rpm key into a file
- RpmHeader::constPtr result( new RpmHeader() );
- getData( string("gpg-pubkey"), *it, result );
- TmpFile file(getZYpp()->tmpPath());
- ofstream os;
- try
- {
- os.open(file.path().asString().c_str());
- // dump rpm key into the tmp file
- os << result->tag_description();
- //MIL << "-----------------------------------------------" << endl;
- //MIL << result->tag_description() <keyRing()->importKey( PublicKey(file), true /*trusted*/);
- MIL << "Trusted key " << (*it) << " imported in zypp keyring." << endl;
+ MIL << "Key " << (*it) << " is already in zypp database." << endl;
}
- catch (Exception &e)
+ else
{
- ERR << "Could not import key " << (*it) << " in zypp keyring" << endl;
+ // we export the rpm key into a file
+ RpmHeader::constPtr result( new RpmHeader() );
+ getData( string("gpg-pubkey"), *it, result );
+ MIL << "Will export trusted key " << (*it) << " to zypp keyring." << endl;
+ tmpos << result->tag_description() << endl;
}
}
}
+ try
+ {
+ getZYpp()->keyRing()->multiKeyImport( tmpfile.path(), true /*trusted*/);
+ }
+ catch (Exception &e)
+ {
+ ERR << "Could not import keys into in zypp keyring" << endl;
+ }
}
///////////////////////////////////////////////////////////////////
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org