Hello community, here is the log from the commit of package libzypp-zmd-backend checked in at Thu May 18 18:59:05 CEST 2006. -------- --- libzypp-zmd-backend/libzypp-zmd-backend.changes 2006-05-17 10:07:46.000000000 +0200 +++ libzypp-zmd-backend/libzypp-zmd-backend.changes 2006-05-18 16:46:53.000000000 +0200 @@ -1,0 +2,12 @@ +Thu May 18 16:45:18 CEST 2006 - kkaempf@suse.de + +- dont keep sources list in query-system, its unused. (#176301) +- rev 3409 + +------------------------------------------------------------------- +Thu May 18 12:08:15 CEST 2006 - kkaempf@suse.de + +- implement key/digest callbacks (#173920) +- rev 3398 + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzypp-zmd-backend.spec ++++++ --- /var/tmp/diff_new_pack.YIyOkz/_old 2006-05-18 18:58:35.000000000 +0200 +++ /var/tmp/diff_new_pack.YIyOkz/_new 2006-05-18 18:58:35.000000000 +0200 @@ -22,7 +22,7 @@ Obsoletes: zmd-librc-backend Summary: ZMD backend for Package, Patch, Pattern, and Product Management Version: 7.1.1.0 -Release: 44 +Release: 45 Source: zmd-backend-%{version}.tar.bz2 Prefix: /usr @@ -68,6 +68,12 @@ /etc/logrotate.d/zmd-backend %changelog -n libzypp-zmd-backend +* Thu May 18 2006 - kkaempf@suse.de +- dont keep sources list in query-system, its unused. (#176301) +- rev 3409 +* Thu May 18 2006 - kkaempf@suse.de +- implement key/digest callbacks (#173920) +- rev 3398 * Wed May 17 2006 - kkaempf@suse.de - adapt to and require libzypp >= 1.0.0 - rev 3391 ++++++ zmd-backend-7.1.1.0.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1.0/src/KeyRingCallbacks.h new/zmd-backend-7.1.1.0/src/KeyRingCallbacks.h --- old/zmd-backend-7.1.1.0/src/KeyRingCallbacks.h 2006-05-12 12:13:26.000000000 +0200 +++ new/zmd-backend-7.1.1.0/src/KeyRingCallbacks.h 2006-05-18 12:07:07.000000000 +0200 @@ -25,6 +25,25 @@ namespace zypp { /////////////////////////////////////////////////////////////////// + + // read callback answer + // can either be '0\n' -> false + // or '1\n' -> true + // reads characters from stdin until newline. Defaults to 'false' + static bool + readCallbackAnswer() + { + char c; + bool result = false; + while (std::cin.get( c )) { + if (c == '\n') + break; + if (c == '1') + result = true; + } + return result; + } + /////////////////////////////////////////////////////////////////// // KeyRingReceive /////////////////////////////////////////////////////////////////// @@ -32,23 +51,27 @@ { virtual bool askUserToAcceptUnsignedFile( const std::string &file ) { - XXX << "(" << file << ")" << std::endl; - return true; + DBG << "1|" << file << std::endl; + std::cout << "1|" << file << std::endl; + return readCallbackAnswer(); } virtual bool askUserToAcceptUnknownKey( const std::string &file, const std::string &keyid, const std::string &keyname, const std::string &fingerprint ) { - XXX << "(" << file << ", " << keyid << ", " << keyname << ", " << fingerprint << ")" << std::endl; - return true; + DBG << "2|" << file << "|" << keyid << "|" << keyname << "|" << fingerprint << std::endl; + std::cout << "2|" << file << "|" << keyid << "|" << keyname << "|" << fingerprint << std::endl; + return readCallbackAnswer(); } virtual bool askUserToTrustKey( const std::string &keyid, const std::string &keyname, const std::string &fingerprint ) { - XXX << "(" << keyid << ", " << keyname << ", " << fingerprint << ")" << std::endl; - return true; + DBG << "3|" << keyid << "|" << keyname << "|" << fingerprint << std::endl; + std::cout << "3|" << keyid << "|" << keyname << "|" << fingerprint << std::endl; + return readCallbackAnswer(); } virtual bool askUserToAcceptVerificationFailed( const std::string &file, const std::string &keyid, const std::string &keyname, const std::string &fingerprint ) { - XXX << "(" << file << ", " << keyid << ", " << keyname << ", " << fingerprint << ")" << std::endl; - return true; + DBG << "4|" << file << "|" << keyid << "|" << keyname << "|" << fingerprint << std::endl; + std::cout << "4|" << file << "|" << keyid << "|" << keyname << "|" << fingerprint << std::endl; + return readCallbackAnswer(); } }; @@ -57,18 +80,21 @@ { virtual bool askUserToAcceptNoDigest( const zypp::Pathname &file ) { - XXX << "(" << file << ")" << std::endl; - return true; + DBG << "5|" << file << std::endl; + std::cout << "5|" << file << std::endl; + return readCallbackAnswer(); } virtual bool askUserToAccepUnknownDigest( const Pathname &file, const std::string &name ) { - XXX << "(" << file << ", " << name << ")" << std::endl; - return true; + DBG << "6|" << file << "|" << name << std::endl; + std::cout << "6|" << file << "|" << name << std::endl; + return readCallbackAnswer(); } virtual bool askUserToAcceptWrongDigest( const Pathname &file, const std::string &requested, const std::string &found ) { - XXX << "(" << file << ", " << requested << ", " << found << ")" << std::endl; - return true; + DBG << "7|" << file << "|" << requested << "|" << found << std::endl; + std::cout << "7|" << file << "|" << requested << "|" << found << std::endl; + return readCallbackAnswer(); } }; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1.0/src/parse-metadata.cc new/zmd-backend-7.1.1.0/src/parse-metadata.cc --- old/zmd-backend-7.1.1.0/src/parse-metadata.cc 2006-05-16 11:23:27.000000000 +0200 +++ new/zmd-backend-7.1.1.0/src/parse-metadata.cc 2006-05-18 12:39:05.000000000 +0200 @@ -111,7 +111,7 @@ main (int argc, char **argv) { if (argc < 5) { - cerr << "3|usage: " << argv[0] << " <database> <type> <uri> <catalog id>" << endl; + cerr << "3|usage: " << argv[0] << " <database> <owner> <uri> <path> <catalog id>" << endl; return 1; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1.0/src/query-system.cc new/zmd-backend-7.1.1.0/src/query-system.cc --- old/zmd-backend-7.1.1.0/src/query-system.cc 2006-05-16 11:24:31.000000000 +0200 +++ new/zmd-backend-7.1.1.0/src/query-system.cc 2006-05-18 12:26:08.000000000 +0200 @@ -22,123 +22,6 @@ //----------------------------------------------------------------------------- -static void -sync_sources( ) -{ - - MIL << "sync_sources" << endl; - - sqlite3 *db; - int rc = sqlite3_open( "/var/lib/zypp/backend.db", &db ); - - if (rc != SQLITE_OK) { - ERR << "Can not open SQL database zsources.db: " << sqlite3_errmsg( db ) << endl; - return; - } - - sqlite3_exec (db, "PRAGMA synchronous = 0", NULL, NULL, NULL); - sqlite3_exec (db, "BEGIN", NULL, NULL, NULL); - - const char *query = - "CREATE TABLE zsources (" - "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " - "zmd_id INTEGER DEFAULT 0, " // reference to catalogs table for zmd, 0 for zypp - "alias VARCHAR, " - "type VARCHAR, " - "url VARCHAR, " - "path VARCHAR " - ")"; - - rc = sqlite3_exec( db, query, NULL, NULL, NULL ); - if (rc != SQLITE_OK) { - ERR << "Can not create 'zsources'[" << rc << "]: " << sqlite3_errmsg( db ) << endl; - ERR << query << endl; -// ignore error, possibly already exists return; - } - - // 1 - query = "SELECT id FROM zsources WHERE zmd_id = 0 AND alias = ?"; - - sqlite3_stmt *select_h = NULL; - rc = sqlite3_prepare( db, query, -1, &select_h, NULL ); - if (rc != SQLITE_OK) { - ERR << "Can not create select query: " << sqlite3_errmsg( db ) << endl; - return; - } - - // 1 2 3 4 - query = "INSERT INTO zsources (alias, type, url, path) VALUES (?, ?, ?, ?)"; - - sqlite3_stmt *insert_h = NULL; - rc = sqlite3_prepare( db, query, -1, &insert_h, NULL ); - if (rc != SQLITE_OK) { - ERR << "Can not create insert query: " << sqlite3_errmsg( db ) << endl; - return; - } - - SourceManager_Ptr manager = SourceManager::sourceManager(); - - try { - manager->restore( "/" ); - } - catch (Exception & excpt_r) { - ZYPP_CAUGHT( excpt_r ); - ERR << "Couldn't restore sources" << endl; - return; - } - - std::list<SourceManager::SourceId> sources = manager->allSources(); - MIL << "Found " << sources.size() << " sources" << endl; - - for (std::list<SourceManager::SourceId>::const_iterator it = sources.begin(); it != sources.end(); ++it) { - Source_Ref source = manager->findSource( *it ); - - if (!source) { - ERR << "SourceManager can't find source " << *it << endl; - continue; - } - - - sqlite3_bind_text( select_h, 1, source.alias().c_str(), -1, SQLITE_STATIC ); - rc = sqlite3_step( select_h ); - - bool found = false; - if (rc == SQLITE_ROW) { - found = true; - DBG << "Source '" << source.alias() << "' already synched" << endl; - } - else if (rc != SQLITE_DONE) { - ERR << "rc " << rc << ": " << sqlite3_errmsg( db ) << endl; - break; - } - sqlite3_reset( select_h ); - - if (!found) { - DBG << "Syncing source '" << source.alias() << "'" << endl; - sqlite3_bind_text( insert_h, 1, source.alias().c_str(), -1, SQLITE_STATIC ); - std::string type = source.type(); - if (type.empty()) type = "YaST"; - sqlite3_bind_text( insert_h, 2, type.c_str(), -1, SQLITE_STATIC ); - sqlite3_bind_text( insert_h, 3, source.url().asString().c_str(), -1, SQLITE_STATIC ); - sqlite3_bind_text( insert_h, 4, source.path().asString().c_str(), -1, SQLITE_STATIC ); - rc = sqlite3_step( insert_h ); - if (rc != SQLITE_DONE) { - ERR << "rc " << rc << ": " << sqlite3_errmsg( db ) << endl; - break; - } - sqlite3_reset( insert_h ); - } - } - - sqlite3_finalize( select_h ); - sqlite3_finalize( insert_h ); - sqlite3_close( db ); - - return; -} - -//----------------------------------------------------------------------------- - int main (int argc, char **argv) { @@ -168,9 +51,6 @@ db.writeStore( God->target()->resolvables(), ResStatus::installed, "@system", ZYPP_OWNED ); - // sync SourceManager with sources table - sync_sources( ); - db.closeDb(); MIL << "END query-system, result 0" << endl; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de