ref: refs/heads/SuSE-SLE-10-SP3-Branch
commit e1fd3b9af375d5a7ebb443b7e9812e2a37217de2
Author: Ján Kupec
Date: Tue Jul 7 13:52:34 2009 +0200
Probe for both types before failing (bnc #335906).
- if probing for YUM type fails, don't throw right away, but try
YAST first. If that fails, throw.
---
zypp/SourceFactory.cc | 33 ++++++++++++++++++++-------------
1 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/zypp/SourceFactory.cc b/zypp/SourceFactory.cc
index b038250..651439c 100644
--- a/zypp/SourceFactory.cc
+++ b/zypp/SourceFactory.cc
@@ -226,30 +226,37 @@ namespace zypp
report->start(url_r);
try
{
- if ( (probeYUM = probeSourceyum::YUMSourceImpl( url_r, path_r, id, "YUM", report )) )
- {
- // nothing
+ // probeYUM
+ try {
+ probeYUM = probeSourceyum::YUMSourceImpl( url_r, path_r, id, "YUM", report );
}
- else if ( (probeYaST = probeSourcesusetags::SuseTagsImpl( url_r, path_r, id, "YaST", report )) )
- {
- // nohing
+ catch ( const media::MediaException & e ) {
+ ZYPP_CAUGHT(e); // ignore while probing
}
- report->finish(url_r, ProbeSourceReport::NO_ERROR, "");
-
if ( probeYUM )
{
+ report->finish(url_r, ProbeSourceReport::NO_ERROR, "");
Source_Ref source(createSourceImplWorkflowsource::yum::YUMSourceImpl( id, context ));
return source;
}
- else if ( probeYaST )
+
+ // probeYaST
+ try {
+ probeYaST = probeSourcesusetags::SuseTagsImpl( url_r, path_r, id, "YaST", report );
+ }
+ catch ( const media::MediaException & e ) {
+ ZYPP_CAUGHT(e); // ignore while probing
+ }
+ if ( probeYaST )
{
+ report->finish(url_r, ProbeSourceReport::NO_ERROR, "");
Source_Ref source(createSourceImplWorkflowsusetags::SuseTagsImpl( id, context ));
return source;
}
- else
- {
- ZYPP_THROW( SourceUnknownTypeException("Unknown source type for " + url_r.asString() ) );
- }
+
+ // probing failed:
+ report->finish(url_r, ProbeSourceReport::NO_ERROR, "");
+ ZYPP_THROW( SourceUnknownTypeException("Unknown source type for " + url_r.asString() ) );
}
catch ( const Exception &e )
{
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org