Author: mlandres Date: Tue Nov 6 14:46:30 2007 New Revision: 7746 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7746&view=rev Log: Throw an exception when adding a new source with an already existing alias. Modified: branches/SuSE-SLE-10-SP2-Branch/libzypp/VERSION branches/SuSE-SLE-10-SP2-Branch/libzypp/package/libzypp.changes branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/SourceManager.cc Modified: branches/SuSE-SLE-10-SP2-Branch/libzypp/VERSION URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-SLE-10-SP2-Branch/libzypp/VERSION?rev=7746&r1=7745&r2=7746&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP2-Branch/libzypp/VERSION (original) +++ branches/SuSE-SLE-10-SP2-Branch/libzypp/VERSION Tue Nov 6 14:46:30 2007 @@ -49,5 +49,5 @@ m4_define([LIBZYPP_MINOR], [30]) m4_define([LIBZYPP_COMPATMINOR], [30]) dnl ================================================== -m4_define([LIBZYPP_PATCH], [1]) +m4_define([LIBZYPP_PATCH], [2]) dnl ================================================== Modified: branches/SuSE-SLE-10-SP2-Branch/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-SLE-10-SP2-Branch/libzypp/package/libzypp.changes?rev=7746&r1=7745&r2=7746&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP2-Branch/libzypp/package/libzypp.changes (original) +++ branches/SuSE-SLE-10-SP2-Branch/libzypp/package/libzypp.changes Tue Nov 6 14:46:30 2007 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Tue Nov 6 14:43:54 CET 2007 - ma@suse.de + +- Throw an exception when adding a new source with an already + existing alias. (#276546) +- version 2.30.2 +- revision 7746 + +------------------------------------------------------------------- Mon Nov 5 15:22:33 CET 2007 - ma@suse.de - Don't mark failed patch scripts as installed. (#327523) Modified: branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/SourceManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/SourceManager.cc?rev=7746&r1=7745&r2=7746&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/SourceManager.cc (original) +++ branches/SuSE-SLE-10-SP2-Branch/libzypp/zypp/SourceManager.cc Tue Nov 6 14:46:30 2007 @@ -105,8 +105,20 @@ if ( source_r.numericId() ) { MIL << "SourceManager add " << source_r << endl; - _sources[source_r.numericId()] = source_r; - + if ( _sources[source_r.numericId()] != source_r ) + { + // Not yet added: check and throw if alias is already in use. + for ( SourceMap::iterator it = _sources.begin(); it != _sources.end(); ++it ) + { + if ( it->second.alias() == source_r.alias() ) + { + ERR << "Alias '" << source_r.alias() << "' already in use: " << it->second << endl; + ZYPP_THROW( Exception( str::form( _("Source alias '%s' is already in use."), + source_r.alias().c_str() ) ) ); + } + } + _sources[source_r.numericId()] = source_r; + } dumpSourceTableOn( DBG ); } else -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org