Hello community,
here is the log from the commit of package libzypp-zmd-backend
checked in at Mon Apr 24 21:10:13 CEST 2006.
--------
--- libzypp-zmd-backend/libzypp-zmd-backend.changes 2006-04-23 22:41:58.000000000 +0200
+++ STABLE/libzypp-zmd-backend/libzypp-zmd-backend.changes 2006-04-24 19:50:46.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Apr 24 19:50:16 CEST 2006 - kkaempf@suse.de
+
+- get source syncing right (#167958, #168051, #168652)
+- rev 3211
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libzypp-zmd-backend.spec ++++++
--- /var/tmp/diff_new_pack.XL2tUF/_old 2006-04-24 21:09:46.000000000 +0200
+++ /var/tmp/diff_new_pack.XL2tUF/_new 2006-04-24 21:09:46.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: 24
+Release: 26
Source: zmd-backend-%{version}.tar.bz2
Prefix: /usr
@@ -68,6 +68,9 @@
/etc/logrotate.d/zmd-backend
%changelog -n libzypp-zmd-backend
+* Mon Apr 24 2006 - kkaempf@suse.de
+- get source syncing right (#167958, #168051, #168652)
+- rev 3211
* Sun Apr 23 2006 - kkaempf@suse.de
- sync Message and Script objects to zmd database (#168607)
- rev 3183
++++++ 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/Makefile.am new/zmd-backend-7.1.1.0/src/Makefile.am
--- old/zmd-backend-7.1.1.0/src/Makefile.am 2006-04-13 12:46:25.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/Makefile.am 2006-04-24 16:42:40.000000000 +0200
@@ -13,6 +13,9 @@
bindir = $(libdir)/zmd
+noinst_PROGRAMS = \
+ zypp-sources
+
bin_PROGRAMS = \
query-pool \
query-system \
@@ -25,6 +28,7 @@
update-status \
transact
+zypp_sources_SOURCES = zypp-sources.cc zmd-backend.cc
service_delete_SOURCES = service-delete.cc zmd-backend.cc
query_pool_SOURCES = query-pool.cc zmd-backend.cc
query_system_SOURCES = query-system.cc zmd-backend.cc
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1.0/src/Makefile.in new/zmd-backend-7.1.1.0/src/Makefile.in
--- old/zmd-backend-7.1.1.0/src/Makefile.in 2006-04-13 12:46:34.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/Makefile.in 2006-04-24 16:42:45.000000000 +0200
@@ -38,6 +38,7 @@
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
+noinst_PROGRAMS = zypp-sources$(EXEEXT)
bin_PROGRAMS = query-pool$(EXEEXT) query-system$(EXEEXT) \
query-files$(EXEEXT) resolve-dependencies$(EXEEXT) \
service-delete$(EXEEXT) package-files$(EXEEXT) \
@@ -55,7 +56,7 @@
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(bin_PROGRAMS)
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
am_find_file_OBJECTS = find-file.$(OBJEXT) zmd-backend.$(OBJEXT)
find_file_OBJECTS = $(am_find_file_OBJECTS)
find_file_LDADD = $(LDADD)
@@ -114,6 +115,11 @@
update_status_LDADD = $(LDADD)
update_status_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2)
+am_zypp_sources_OBJECTS = zypp-sources.$(OBJEXT) zmd-backend.$(OBJEXT)
+zypp_sources_OBJECTS = $(am_zypp_sources_OBJECTS)
+zypp_sources_LDADD = $(LDADD)
+zypp_sources_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -137,12 +143,14 @@
$(parse_metadata_SOURCES) $(query_files_SOURCES) \
$(query_pool_SOURCES) $(query_system_SOURCES) \
$(resolve_dependencies_SOURCES) $(service_delete_SOURCES) \
- $(transact_SOURCES) $(update_status_SOURCES)
+ $(transact_SOURCES) $(update_status_SOURCES) \
+ $(zypp_sources_SOURCES)
DIST_SOURCES = $(find_file_SOURCES) $(package_files_SOURCES) \
$(parse_metadata_SOURCES) $(query_files_SOURCES) \
$(query_pool_SOURCES) $(query_system_SOURCES) \
$(resolve_dependencies_SOURCES) $(service_delete_SOURCES) \
- $(transact_SOURCES) $(update_status_SOURCES)
+ $(transact_SOURCES) $(update_status_SOURCES) \
+ $(zypp_sources_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
@@ -307,6 +315,7 @@
AM_CXXFLAGS = $(PKG_MANAGEMENT_CFLAGS) $(SQLITE_CFLAGS) $(ZYPP_CFLAGS)
LDADD = $(PKG_MANAGEMENT_LIBS) $(SQLITE_LIBS) $(ZYPP_LIBS)
noinst_HEADERS = zmd-backend.h
+zypp_sources_SOURCES = zypp-sources.cc zmd-backend.cc
service_delete_SOURCES = service-delete.cc zmd-backend.cc
query_pool_SOURCES = query-pool.cc zmd-backend.cc
query_system_SOURCES = query-system.cc zmd-backend.cc
@@ -378,6 +387,13 @@
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
find-file$(EXEEXT): $(find_file_OBJECTS) $(find_file_DEPENDENCIES)
@rm -f find-file$(EXEEXT)
$(CXXLINK) $(find_file_LDFLAGS) $(find_file_OBJECTS) $(find_file_LDADD) $(LIBS)
@@ -408,6 +424,9 @@
update-status$(EXEEXT): $(update_status_OBJECTS) $(update_status_DEPENDENCIES)
@rm -f update-status$(EXEEXT)
$(CXXLINK) $(update_status_LDFLAGS) $(update_status_OBJECTS) $(update_status_LDADD) $(LIBS)
+zypp-sources$(EXEEXT): $(zypp_sources_OBJECTS) $(zypp_sources_DEPENDENCIES)
+ @rm -f zypp-sources$(EXEEXT)
+ $(CXXLINK) $(zypp_sources_LDFLAGS) $(zypp_sources_OBJECTS) $(zypp_sources_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -427,6 +446,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transactions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/update-status.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zmd-backend.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zypp-sources.Po@am__quote@
.cc.o:
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@@ -667,7 +687,8 @@
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool \
+ clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-recursive
-rm -rf ./$(DEPDIR)
@@ -719,14 +740,14 @@
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
clean clean-binPROGRAMS clean-generic clean-libtool \
- clean-recursive ctags ctags-recursive distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-recursive distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-binPROGRAMS \
- install-data install-data-am install-exec install-exec-am \
- install-info install-info-am install-man install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-generic \
+ clean-noinstPROGRAMS clean-recursive ctags ctags-recursive \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-recursive distclean-tags distdir \
+ dvi dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
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-04-20 18:48:38.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/parse-metadata.cc 2006-04-24 19:10:48.000000000 +0200
@@ -51,7 +51,6 @@
//----------------------------------------------------------------------------
static SourceManager_Ptr manager;
// manager->store may be expensive
-static bool store_needed = false;
static bool
restore_sources ()
@@ -67,61 +66,6 @@
return true;
}
-static bool
-store_sources ()
-{
- if (store_needed) {
- try {
- manager->store ("/", true /*metadata_cache*/);
- }
- catch (Exception & excpt_r) {
- ZYPP_CAUGHT (excpt_r);
- ERR << "Couldn't store sources" << endl;
- return false;
- }
- }
- return true;
-}
-
-static void
-add_source_if_new (const Source_Ref & source, const string & alias)
-{
- // only add if it is not there already.
- // findSource throws if the source is not there
- try {
- manager->findSource( alias );
- }
- catch( const Exception & excpt_r ) {
- manager->addSource( source );
- store_needed = true;
- }
-}
-
-//----------------------------------------------------------------------------
-//Tell yast that we are done storing the updated source. This is
-//necessary because when "rug sa" is called by yast, it calls us
-//asyncronously
-
-static void
-tell_yast()
-{
- // yast will delete the file before and afterwards.
- // the name must be synchronized with inst_you.ycp
- // and inst_suse_register.ycp
- const char * flag_file = "/var/lib/zypp/zmd_updated_the_sources";
- int err;
- int fd = creat( flag_file, 0666 );
- if ( fd == -1 ) {
- err = errno;
- ERR << "creating " << flag_file << ": " << strerror( err ) << endl;
- }
- else {
- if ( close( fd ) == -1) {
- err = errno;
- ERR << "closing " << flag_file << ": " << strerror( err ) << endl;
- }
- }
-}
//----------------------------------------------------------------------------
// upload all zypp sources as catalogs to the database
@@ -147,17 +91,15 @@
//----------------------------------------------------------------------------
-// metadata types
+// metadata owners
#define ZYPP "zypp"
-#define YUM "yum"
+#define ZMD "yum" // zmd claims "yum" for itself
int
main (int argc, char **argv)
{
- atexit (tell_yast);
-
if (argc < 5) {
- cerr << "usage: " << argv[0] << " <database> <type> <uri> <catalog id>" << endl;
+ cerr << "3|usage: " << argv[0] << " <database> <type> <uri> <catalog id>" << endl;
return 1;
}
@@ -168,9 +110,23 @@
zypp::base::LogControl::instance().logfile( ZMD_BACKEND_LOG );
MIL << "-------------------------------------" << endl;
- // database type uri path catalog
+ // database owner uri path catalog
MIL << "START parse-metadata " << argv[1] << " " << argv[2] << " " << argv[3] << " " << argv[4] << " " << argv[5] << endl;
+ string owner( argv[2] ); // "zypp" or "yum"
+
+ if (owner == ZYPP)
+ {
+ MIL << "Zypp owned" << endl;
+ }
+ else if (owner == ZMD) {
+ MIL << "ZMD owned" << endl;
+ }
+ else {
+ ERR << "Invalid option " << argv[2] << ", expecting '" << ZYPP << "' or '" << ZMD << "'" << endl;
+ return 1;
+ }
+
ZYpp::Ptr God = backend::getZYpp( true );
KeyRingCallbacks keyring_callbacks;
DigestCallbacks digest_callbacks;
@@ -178,10 +134,11 @@
backend::initTarget( God );
manager = SourceManager::sourceManager();
- if (! restore_sources ())
+ if (! restore_sources ()) {
return 1;
+ }
- DbAccess db( argv[1] );
+ DbAccess db( argv[1] ); // the zmd.db
if (!db.openDb( true )) // open for writing
{
@@ -189,9 +146,6 @@
return 1;
}
- string type( argv[2] );
- Pathname path( argv[3] );
-
// check for "...;alias=..." and replace with "...&alias=..." (#168030)
string checkpath ( argv[3] );
string::size_type aliaspos = checkpath.find( ";alias=" );
@@ -205,109 +159,147 @@
checkurl.replace( aliaspos, 1, "&" );
}
+
Url uri;
Url pathurl;
+ url::ParamMap uriparams;
+ string urialias;
+
+ // Url() constructor might throw
try {
uri = Url ( ((checkpath[0] == '/') ? string("file:"):string("")) + checkpath );
+ uriparams = uri.getQueryStringMap(); // extract parameters
+ url::ParamMap::const_iterator it = uriparams.find( "alias" );
+ if (it != uriparams.end()) {
+ urialias = it->second;
+ }
pathurl = Url ( ((checkurl[0] == '/') ? string("file:"):string("")) + checkurl );
}
catch ( const Exception & excpt_r ) {
ZYPP_CAUGHT( excpt_r );
- cerr << excpt_r.asUserString() << endl;
+ cerr << "3|" << excpt_r.asUserString() << endl;
return 1;
}
- string catalog( argv[5] );
-
- int result = 0;
+ // If the URL has an alias, it must be ZYPP owned.
- if (type == ZYPP)
+ if (owner == ZMD
+ && !urialias.empty())
{
+ ERR << "Bad paremeters, yum-type url with alias" << endl;
+ cerr << "3|Bad paremeters, yum-type url with alias" << endl;
+ return 1;
+ }
- MIL << "Doing a zypp->zmd sync" << endl;
- // the source already exists in the catalog, no need to add it
+ // the catalog id to use when writing to zmd.db
+ string catalog( argv[5] );
- //
- // find matching source and write its resolvables to the catalog
- //
-
- SourceManager::Source_const_iterator it;
- for (it = manager->Source_begin(); it != manager->Source_end(); ++it) {
- string src_uri = it->url().asString();
- MIL << "Uri '" << src_uri << "'" << endl;
- if (src_uri == uri.asString()) { // check url first
- sync_source( db, *it, catalog, Url(), false );
- break;
- }
- string separator = (src_uri.find('?') != string::npos) ? "&" : "?";
- src_uri += (separator + "alias=" + it->alias());
- MIL << "Uri '" << src_uri << "'" << endl;
- if (src_uri == uri.asString()) { // then check <url>?alias=<alias>
- sync_source( db, *it, catalog, Url(), false );
- break;
- }
- }
- if (it == manager->Source_end()) {
- MIL << "Source not found, adding" << endl;
+ int result = 0;
- Source_Ref source;
- try {
- source = SourceFactory().createFrom( uri, Pathname(), catalog, Pathname() );
- sync_source( db, source, catalog, Url(), false );
- }
- catch( const Exception & excpt_r ) {
- cerr << "3|Can't add repository at " << uri << endl;
- ZYPP_CAUGHT( excpt_r );
- ERR << "Can't add repository at " << uri << endl;
- result = 1;
- }
+ MIL << "Uri '" << uri << "', Alias '" << urialias << "', Path '" << pathurl << "'" << endl;
- if (result == 0) {
- try {
- manager->addSource( source );
- manager->store( "/", true /*metadata_cache*/ );
+ //
+ // find matching source and write its resolvables to the catalog
+ //
+ // consider two cases
+ // 1. source added via YaST
+ // 2. source added via ZMD (rug, zen-installer, ...)
+ //
+ // case 1: YaST calls "rug sa <url>" but adds an alias to the URL
+ // This alias parameter is compared to the alias values of the source
+ // If the correct source cannot be found, we report an error
+ // Else we get the source resolvables and write it to zmd.db (-> sync_source)
+ //
+ // case 2: A source might be owned by zypp or zmd (-> 'owner' parameter, see above)
+ // For zmd owned sources, we first check if the url is already known. This is
+ // safe since the url is unique within zmd.
+ //
+ // If the source is not known within zypp, we add it to zypp so it can be
+ // used by applications linking against zypp.
+ //
+
+ SourceManager::Source_const_iterator it;
+ for (it = manager->Source_begin(); it != manager->Source_end(); ++it) {
+
+ if (urialias.empty()) { // urialias empty -> not coming from yast
+
+ if (uri.asString() == it->url().asString()) { // url already known ?
+
+ if (owner == ZMD) { // and owned by ZMD ?
+ MIL << "Found url, source already known to zypp";
+ sync_source( db, *it, catalog, Url(), owner == ZMD );
+ break;
}
- catch (Exception & excpt_r) {
- cerr << "3|Can't store zypp repository" << endl;
- ZYPP_CAUGHT (excpt_r);
- ERR << "Couldn't store sources" << endl;
- result = 1;
+ else { // --type=zypp used but no alias given
+ ERR << "Duplicate source, url already known" << endl;
+ cerr << "3|Duplicate source, url already known" << endl;
+ break;
}
}
}
+ else if (urialias == it->alias()) { // urialias matches zypp one
+ MIL << "Found alias, source already known to zypp";
+ sync_source( db, *it, catalog, Url(), owner == ZMD );
+ break;
+ }
}
- else if (type == YUM)
- {
- MIL << "Doing a zmd->zypp sync" << endl;
+ // if the source is not known in zypp, add it
- try {
+ if (it == manager->Source_end()) {
+
+ if (!urialias.empty()) { // alias given but not found in zypp -> error
+ cerr << "3|Unknown alias '" << urialias << "' passed." << endl;
+ ERR << "Unknown alias '" << urialias << "' passed." << endl;
+ goto finish;
+ }
- Source_Ref source( SourceFactory().createFrom( pathurl, Pathname(), catalog, Pathname() ) );
-
- sync_source( db, source, catalog, uri, true ); // yum is always zmd_owned
+ MIL << "Source not found, creating" << endl;
+ Source_Ref source;
+ try {
+ if (owner == ZMD) { // use zmd downloaded metadata:
+ source = SourceFactory().createFrom( pathurl, Pathname(), catalog, Pathname() );
+ sync_source( db, source, catalog, uri, owner == ZMD );
+ }
+ else { // let zypp do the download
+ source = SourceFactory().createFrom( uri, Pathname(), catalog, Pathname() );
+ sync_source( db, source, catalog, Url(), owner == ZMD );
+ }
}
- catch( const Exception & excpt_r )
- {
- cerr << "3|Cant access repository data at " << path << endl;
+ catch( const Exception & excpt_r ) {
+ cerr << "3|Can't add repository at " << uri << endl;
ZYPP_CAUGHT( excpt_r );
- ERR << "Can't access repository at " << path << endl;
+ ERR << "Can't add repository at " << uri << endl;
+ goto finish;
+ }
+
+// See bug #168739
+#if 0
+ if (owner == ZMD) {
+ MIL << "Owner is ZMD, *not* adding to zypp" << endl;
+ goto finish;
+ }
+#endif
+
+ MIL << "Source not found, adding" << endl;
+
+ try {
+ manager->addSource( source );
+ manager->store( "/", true /*metadata_cache*/ );
+ }
+ catch (Exception & excpt_r) {
+ cerr << "3|Can't store source to zypp" << endl;
+ ZYPP_CAUGHT (excpt_r);
+ ERR << "Couldn't store source to zypp" << endl;
result = 1;
- };
+ }
}
- else
- {
- ERR << "Invalid option " << argv[2] << ", expecting '" << ZYPP << "' or '" << YUM << "'" << endl;
- result = 1;
- }
+finish:
db.closeDb();
- if (result == 0)
- store_sources (); // no checking, we're finished anyway
-
MIL << "END parse-metadata, result " << result << endl;
return result;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1.0/src/service-delete.cc new/zmd-backend-7.1.1.0/src/service-delete.cc
--- old/zmd-backend-7.1.1.0/src/service-delete.cc 2006-04-20 18:49:49.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/service-delete.cc 2006-04-24 18:42:20.000000000 +0200
@@ -22,11 +22,11 @@
//-----------------------------------------------------------------------------
static int
-service_delete( ZYpp::Ptr Z, const string & uri)
+service_delete( ZYpp::Ptr Z, const string & name)
{
SourceManager_Ptr manager = SourceManager::sourceManager();
- MIL << "service_delete(" << uri << ")" << endl;
+ MIL << "service_delete(" << name << ")" << endl;
try {
manager->restore( "/" );
@@ -37,32 +37,49 @@
return 1;
}
+ Url uri;
+ url::ParamMap uriparams;
+ string urialias;
+
+ // Url() constructor might throw
+ try {
+ uri = Url ( name );
+ uriparams = uri.getQueryStringMap(); // extract parameters
+ url::ParamMap::const_iterator it = uriparams.find( "alias" );
+ if (it != uriparams.end()) {
+ urialias = it->second;
+ }
+ }
+ catch ( const Exception & excpt_r ) {
+ ZYPP_CAUGHT( excpt_r );
+ }
+
SourceManager::Source_const_iterator it;
for (it = manager->Source_begin(); it != manager->Source_end(); ++it) {
- string src_type = it->type(); // #160613
- if (src_type == "YaST")
- src_type = "zypp";
- string src_uri = it->url().asString();
- if (src_type == "zypp")
- {
- string separator = (src_uri.find('?') != string::npos) ? "&" : "?";
- src_uri += (separator + "alias=" + it->alias());
- }
- MIL << "Uri '" << src_uri << "'" << endl;
- if (src_uri == uri) {
- manager->removeSource( it->alias() );
- try {
- manager->store ("/", true /*metadata_cache*/);
- }
- catch (Exception & excpt_r) {
- ZYPP_CAUGHT (excpt_r);
- ERR << "Couldn't update source cache" << endl;
+ if (urialias.empty()) {
+ if (name == it->url().asString()) { // url already known ?
+ break;
}
+ }
+ else if (urialias == it->alias()) { // urialias matches zypp one
break;
}
}
- if (it == manager->Source_end()) {
- WAR << "Source not found" << endl;
+
+ if (it != manager->Source_end()) {
+
+ manager->removeSource( it->alias() );
+ try {
+ manager->store ("/", true /*metadata_cache*/);
+ }
+ catch (Exception & excpt_r) {
+ ZYPP_CAUGHT (excpt_r);
+ ERR << "Couldn't update source cache" << endl;
+ return 1;
+ }
+ }
+ else {
+ WAR << "Source '" << name << "' not found" << endl;
return 1;
}
return 0;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1.0/src/zypp-sources.cc new/zmd-backend-7.1.1.0/src/zypp-sources.cc
--- old/zmd-backend-7.1.1.0/src/zypp-sources.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/zmd-backend-7.1.1.0/src/zypp-sources.cc 2006-04-24 16:45:22.000000000 +0200
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+//
+// zypp-sources.cc
+//
+// debug helper to print all sources known to zypp
+//
+
+#include <iostream>
+#include <cstring>
+#include <list>
+
+#include "zmd-backend.h"
+
+#include