Hello community, here is the log from the commit of package libzypp-zmd-backend checked in at Sun Apr 2 17:56:56 CEST 2006. -------- --- libzypp-zmd-backend/libzypp-zmd-backend.changes 2006-04-02 12:00:49.000000000 +0200 +++ libzypp-zmd-backend/libzypp-zmd-backend.changes 2006-04-02 17:17:45.000000000 +0200 @@ -1,0 +2,8 @@ +Sun Apr 2 17:15:50 CEST 2006 - kkaempf@suse.de + +- add force_remote flag to handle the case where zmd does the + download, so metadata appears local to zypp, but the real + source is remote (#160402). +- rev 2882 + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzypp-zmd-backend.spec ++++++ --- /var/tmp/diff_new_pack.hOBWc6/_old 2006-04-02 17:56:48.000000000 +0200 +++ /var/tmp/diff_new_pack.hOBWc6/_new 2006-04-02 17:56:48.000000000 +0200 @@ -22,7 +22,7 @@ Obsoletes: zmd-librc-backend Summary: ZMD backend for Package, Patch, Pattern, and Product Management Version: 7.1.1 -Release: 27 +Release: 28 Source: zmd-backend-%{version}.tar.bz2 Prefix: /usr @@ -69,6 +69,11 @@ %changelog -n libzypp-zmd-backend * Sun Apr 02 2006 - kkaempf@suse.de +- add force_remote flag to handle the case where zmd does the + download, so metadata appears local to zypp, but the real + source is remote (#160402). +- rev 2882 +* Sun Apr 02 2006 - kkaempf@suse.de - create dummy source for local packages (#147765) - rev 2881 * Thu Mar 30 2006 - kkaempf@suse.de ++++++ zmd-backend-7.1.1.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/src/dbsource/DbAccess.cc new/zmd-backend-7.1.1/src/dbsource/DbAccess.cc --- old/zmd-backend-7.1.1/src/dbsource/DbAccess.cc 2006-04-02 11:49:08.000000000 +0200 +++ new/zmd-backend-7.1.1/src/dbsource/DbAccess.cc 2006-04-02 14:53:27.000000000 +0200 @@ -554,7 +554,7 @@ // package sqlite_int64 -DbAccess::writePackage( sqlite_int64 id, Package::constPtr pkg ) +DbAccess::writePackage( sqlite_int64 id, Package::constPtr pkg, bool force_remote ) { XXX << "DbAccess::writePackage(" << id << ", " << *pkg << ")" << endl; int rc; @@ -568,7 +568,9 @@ sqlite3_bind_text( handle, 5, src.url().asString().c_str(), -1, SQLITE_STATIC ); // package_url - if (src.remote()) { + if (force_remote + || src.remote()) + { DBG << "Source " << src << " is remote"; sqlite3_bind_text( handle, 6, NULL, -1, SQLITE_STATIC ); // zmd knows how to get the package } @@ -691,7 +693,7 @@ // return == 0 if this kind of resolvable is to be skipped sqlite_int64 -DbAccess::writeResObject (ResObject::constPtr obj, ResStatus status, const char *catalog) +DbAccess::writeResObject( ResObject::constPtr obj, ResStatus status, const char *catalog, bool force_remote ) { XXX << "DbAccess::writeResObject (" << *obj << ", " << status << ")" << endl; @@ -756,7 +758,7 @@ // now write the respective _details table - if (pkg != NULL) writePackage( rowid, pkg ); + if (pkg != NULL) writePackage( rowid, pkg, force_remote ); else if (patch != NULL) writePatch( rowid, patch ); else if (pattern != NULL) writePattern( rowid, pattern ); else if (product != NULL) writeProduct( rowid, product ); @@ -935,7 +937,7 @@ // store void -DbAccess::writeStore( const zypp::ResStore & store, ResStatus status, const char *catalog ) +DbAccess::writeStore( const zypp::ResStore & store, ResStatus status, const char *catalog, bool force_remote ) { XXX << "DbAccess::writeStore()" << endl; @@ -959,7 +961,7 @@ && ( status == ResStatus::installed // installed ones are ok || obj->arch().compatibleWith( sysarch ) ) ) // and so are architecturally compatible ones { - rowid = writeResObject( obj, status, catalog ); + rowid = writeResObject( obj, status, catalog, force_remote ); if (rowid < 0) break; if (rowid > 0) // rowid == 0 means 'skip' diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/src/dbsource/DbAccess.h new/zmd-backend-7.1.1/src/dbsource/DbAccess.h --- old/zmd-backend-7.1.1/src/dbsource/DbAccess.h 2006-03-22 18:37:27.000000000 +0100 +++ new/zmd-backend-7.1.1/src/dbsource/DbAccess.h 2006-04-02 14:52:08.000000000 +0200 @@ -148,9 +148,9 @@ void commit(); - sqlite_int64 writeResObject( zypp::ResObject::constPtr obj, zypp::ResStatus status, const char *catalog = NULL ); + sqlite_int64 writeResObject( zypp::ResObject::constPtr obj, zypp::ResStatus status, const char *catalog = NULL, bool force_remote = false ); - sqlite_int64 writePackage( sqlite_int64 id, zypp::Package::constPtr package ); + sqlite_int64 writePackage( sqlite_int64 id, zypp::Package::constPtr package, bool force_remote = false ); sqlite_int64 writePatch( sqlite_int64 id, zypp::Patch::constPtr patch ); sqlite_int64 writePattern( sqlite_int64 id, zypp::Pattern::constPtr pattern ); sqlite_int64 writeProduct( sqlite_int64 id, zypp::Product::constPtr product ); @@ -185,7 +185,7 @@ bool updateCatalog( const std::string & catalog, const std::string & name, const std::string & alias, const std::string & description ); /** write resolvables from store to db */ - void writeStore( const zypp::ResStore & resolvables, zypp::ResStatus status, const char *catalog = NULL ); + void writeStore( const zypp::ResStore & resolvables, zypp::ResStatus status, const char *catalog = NULL, bool force_remote = false ); /** write resolvables from pool to db */ void writePool( const zypp::ResPool & pool, const char *catalog = NULL ); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/src/parse-metadata.cc new/zmd-backend-7.1.1/src/parse-metadata.cc --- old/zmd-backend-7.1.1/src/parse-metadata.cc 2006-03-31 16:24:41.000000000 +0200 +++ new/zmd-backend-7.1.1/src/parse-metadata.cc 2006-04-02 14:55:33.000000000 +0200 @@ -125,9 +125,9 @@ // upload all zypp sources as catalogs to the database static void -sync_source( DbAccess & db, Source_Ref source, string catalog ) +sync_source( DbAccess & db, Source_Ref source, string catalog, bool is_remote = false ) { - DBG << "sync_source, catalog '" << catalog << "', alias '" << source.alias() << "'" << endl; + DBG << "sync_source, catalog '" << catalog << "', alias '" << source.alias() << "', remote? " << is_remote << endl; #if 0 // ZMD does this if (db.haveCatalog( catalog ) ) { @@ -154,7 +154,7 @@ DBG << "Source provides " << store.size() << " resolvables" << endl; - db.writeStore( store, ResStatus::uninstalled, catalog.c_str() ); // store all resolvables as 'uninstalled' + db.writeStore( store, ResStatus::uninstalled, catalog.c_str(), is_remote ); // store all resolvables as 'uninstalled' #if 0 } #endif @@ -251,23 +251,35 @@ Pathname cache_dir(""); try { + bool is_remote = true; + Source_Ref source( SourceFactory().createFrom(url, p, alias, cache_dir) ); - // try to create a source using the alias, this is typically + // try to create a Url using the alias, this is typically // the original location of the source, not the local cache try { Url url( alias ); - + string scheme = url.getScheme(); + if (scheme != "ftp" + && scheme != "http" + && scheme != "https") + { + is_remote = false; + } +#if 0 // don't re-create real source, this will re-load all metadata (#162735) MIL << "Creating remote source for libzypp" << endl; Source_Ref source_remote( SourceFactory().createFrom(url, p, alias, cache_dir) ); add_source_if_new (source_remote, alias); +#endif } catch ( const Exception & excpt_r ) { ZYPP_CAUGHT( excpt_r ); +#if 0 add_source_if_new (source, alias); +#endif } - sync_source ( db, source, alias ); + sync_source( db, source, alias, is_remote ); } catch( const Exception & excpt_r ) { ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...