Author: mlandres
Date: Fri Jun 20 15:38:11 2008
New Revision: 10432
URL: http://svn.opensuse.org/viewcvs/zypp?rev=10432&view=rev
Log:
Fix permanent duplication of gpg keys in the rpm database. (bnc #401259)
Modified:
branches/SuSE-Linux-11_0-Branch/libzypp/VERSION.cmake
branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc
branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes
branches/SuSE-Linux-11_0-Branch/libzypp/tests/zypp/StringUtils_test.cc
branches/SuSE-Linux-11_0-Branch/libzypp/zypp/PublicKey.cc
branches/SuSE-Linux-11_0-Branch/libzypp/zypp/PublicKey.h
Modified: branches/SuSE-Linux-11_0-Branch/libzypp/VERSION.cmake
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/VERSION.cmake?rev=10432&r1=10431&r2=10432&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/libzypp/VERSION.cmake (original)
+++ branches/SuSE-Linux-11_0-Branch/libzypp/VERSION.cmake Fri Jun 20 15:38:11 2008
@@ -47,4 +47,4 @@
SET(LIBZYPP_MAJOR "4")
SET(LIBZYPP_MINOR "26")
SET(LIBZYPP_COMPATMINOR "24")
-SET(LIBZYPP_PATCH "4")
+SET(LIBZYPP_PATCH "5")
Modified: branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc?rev=10432&r1=10431&r2=10432&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc (original)
+++ branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc Fri Jun 20 15:38:11 2008
@@ -470,9 +470,6 @@
#undef OUTS
}
-namespace zypp
-{
-}
/******************************************************************
**
@@ -491,7 +488,7 @@
ResPool pool( ResPool::instance() );
sat::Pool satpool( sat::Pool::instance() );
- if ( 1 )
+ if ( 0 )
{
RepoManager repoManager( makeRepoManager( sysRoot ) );
RepoInfoList repos = repoManager.knownRepositories();
@@ -575,27 +572,15 @@
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
- for_( it, pool.byKindBegin<Patch>(), pool.byKindEnd<Patch>() )
- {
- MIL << *it << endl;
- Patch::constPtr patch( asKind<Patch>(it->resolvable()) );
- if ( ! patch->message().empty() )
- DBG << patch->message() << endl;
- it->status().setTransact( true, ResStatus::USER );
- }
+ KeyRing_Ptr p( getZYpp()->keyRing() );
+ list<PublicKey> publicKeys( p->publicKeys() );
+ list<PublicKey> trustedPublicKeys( p->trustedPublicKeys() );
- PoolItem pix ( getPi<Package>("amarok",Edition("1.4.9.1-4"),Arch("i586")) );
- MIL << pix << endl;
- if ( pix )
+ for_( it, trustedPublicKeys.begin(), trustedPublicKeys.end() )
{
- pix.status().setTransact( true, ResStatus::USER );
+ MIL << dump(*it) << endl;
}
- solve();
- vdumpPoolStats( USR << "Transacting:"<< endl,
- make_filter_beginresfilter::ByTransact(pool),
- make_filter_endresfilter::ByTransact(pool) ) << endl;
- install();
///////////////////////////////////////////////////////////////////
INT << "===[END]============================================" << endl << endl;
Modified: branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes?rev=10432&r1=10431&r2=10432&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes (original)
+++ branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes Fri Jun 20 15:38:11 2008
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Fri Jun 20 15:31:57 CEST 2008 - ma@suse.de
+
+- Fix permanent duplication of gpg keys in the rpm database. Also
+ retrieve correct creation and expire dates. (bnc #401259)
+- version 4.26.5
+- revision 10432
+
+-------------------------------------------------------------------
Thu Jun 19 17:46:04 CEST 2008 - ma@suse.de
- Handle new patch messages and scripts in commit. Provide callbacks
Modified: branches/SuSE-Linux-11_0-Branch/libzypp/tests/zypp/StringUtils_test.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/tests/zypp/StringUtils_test.cc?rev=10432&r1=10431&r2=10432&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/libzypp/tests/zypp/StringUtils_test.cc (original)
+++ branches/SuSE-Linux-11_0-Branch/libzypp/tests/zypp/StringUtils_test.cc Fri Jun 20 15:38:11 2008
@@ -12,6 +12,7 @@
using namespace std;
using namespace zypp;
+#undef DBG
#define DBG cout
void chk_splitFields( const std::string & line, unsigned num )
Modified: branches/SuSE-Linux-11_0-Branch/libzypp/zypp/PublicKey.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/zypp/PublicKey.cc?rev=10432&r1=10431&r2=10432&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/libzypp/zypp/PublicKey.cc (original)
+++ branches/SuSE-Linux-11_0-Branch/libzypp/zypp/PublicKey.cc Fri Jun 20 15:38:11 2008
@@ -30,7 +30,7 @@
///////////////////////////////////////////////////////////////////
namespace zypp
-{ /////////////////////////////////////////////////////////////////
+{ /////////////////////////////////////////////////////////////////
//
// CLASS NAME : PublicKey::Impl
//
@@ -45,7 +45,7 @@
readFromFile(file);
MIL << "Done reading key" << std::endl;
}
-
+
public:
/** Offer default Impl. */
static shared_ptr<Impl> nullimpl()
@@ -54,21 +54,21 @@
return _nullimpl;
}
-
+
std::string asString() const
{
return "[" + id() + "] [" + name() + "] [" + fingerprint() + "]";
}
-
+
std::string armoredData() const
{ return _data; }
-
+
std::string id() const
{ return _id; }
-
+
std::string name() const
{ return _name; }
-
+
std::string fingerprint() const
{ return _fingerprint; }
@@ -77,67 +77,32 @@
Date expires() const
{ return _expires; }
-
+
Pathname path() const
- {
+ {
return _data_file.path();
//return _data_file;
}
-
- protected:
- // create Date from a string in format YYYY-MM-DD
- Date createDate(const std::string &datestr)
- {
- // empty input
- if (datestr.empty())
- {
- return Date();
- }
-
- tm date;
- memset(&date, 0, sizeof(date));
-
- try
- {
- // set the date
- date.tm_year = str::strtonum<int>(std::string(datestr, 0, 4)) - 1900; // years since 1900
- date.tm_mon = str::strtonum<int>(std::string(datestr, 5, 2)) - 1; // months since January
- date.tm_mday = str::strtonum<int>(std::string(datestr, 9, 2)); // day
- }
- catch(...)
- {
- WAR << "Cannot parse date string: " << datestr << std::endl;
- return Date();
- }
-
- time_t time_epoch = ::mktime(&date);
+ protected:
- return Date(time_epoch);
- }
-
void readFromFile( const Pathname &keyfile)
{
PathInfo info(keyfile);
- MIL << "Reading pubkey from " << keyfile << " of size " << info.size() << " and sha1 " << filesystem::checksum(keyfile, "sha1")<< endl;
+ MIL << "Reading pubkey from " << keyfile << " of size " << info.size() << " and sha1 " << filesystem::checksum(keyfile, "sha1")<< endl;
if ( !info.isExist() )
ZYPP_THROW(Exception("Can't read public key from " + keyfile.asString() + ", file not found"));
-
+
if ( copy( keyfile, _data_file.path() ) != 0 )
ZYPP_THROW(Exception("Can't copy public key data from " + keyfile.asString() + " to " + _data_file.path().asString() ));
-
- filesystem::TmpDir dir;
-
const char* argv[] =
{
"gpg",
"-v",
"--no-default-keyring",
"--fixed-list-mode",
- "--homedir",
- dir.path().asString().c_str(),
"--with-fingerprint",
"--with-colons",
"--quiet",
@@ -149,57 +114,77 @@
_data_file.path().asString().c_str(),
NULL
};
-
+
ExternalProgram prog(argv,ExternalProgram::Discard_Stderr, false, -1, true);
-
+
std::string line;
- int count = 0;
- int sig_count = 0;
+ bool sawpub = false;
+ bool sawsig = false;
+
+ // pub:-:1024:17:A84EDAE89C800ACA:971961473:1214043198::-:SuSE Package Signing Key