Mailinglist Archive: zypp-commit (339 mails)
| < Previous | Next > |
[zypp-commit] r11332 - /trunk/libzypp/zypp/RepoManager.cc
- From: jkupec@xxxxxxxxxxxxxxxx
- Date: Mon, 13 Oct 2008 17:12:03 -0000
- Message-id: <20081013171203.C7BE1F4D23@xxxxxxxxxxxxxxxx>
Author: jkupec
Date: Mon Oct 13 19:12:03 2008
New Revision: 11332
URL: http://svn.opensuse.org/viewcvs/zypp?rev=11332&view=rev
Log:
- repository probing: check for other types of repo even on
MediaException, throw only if all fail (bnc #335906)
Modified:
trunk/libzypp/zypp/RepoManager.cc
Modified: trunk/libzypp/zypp/RepoManager.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=11332&r1=11331&r2=11332&view=diff
==============================================================================
--- trunk/libzypp/zypp/RepoManager.cc (original)
+++ trunk/libzypp/zypp/RepoManager.cc Mon Oct 13 19:12:03 2008
@@ -1072,13 +1072,41 @@
return repo::RepoType::NONE;
}
+ // prepare exception to be thrown if the type could not be determined
+ // due to a media exception. We can't throw right away, because of some
+ // problems with proxy servers returning an incorrect error
+ // on ftp file-not-found(bnc #335906). Instead we'll check another types
+ // before throwing.
+ RepoException enew("Error trying to read from " + url.asString());
+ bool gotMediaException = false;
try
{
MediaSetAccess access(url);
- if ( access.doesFileExist("/repodata/repomd.xml") )
- return repo::RepoType::RPMMD;
- if ( access.doesFileExist("/content") )
- return repo::RepoType::YAST2;
+ try
+ {
+ if ( access.doesFileExist("/repodata/repomd.xml") )
+ return repo::RepoType::RPMMD;
+ }
+ catch ( const media::MediaException &e )
+ {
+ ZYPP_CAUGHT(e);
+ DBG << "problem checking for repodata/repomd.xml file" << endl;
+ enew.remember(e);
+ gotMediaException = true;
+ }
+
+ try
+ {
+ if ( access.doesFileExist("/content") )
+ return repo::RepoType::YAST2;
+ }
+ catch ( const media::MediaException &e )
+ {
+ ZYPP_CAUGHT(e);
+ DBG << "problem checking for content file" << endl;
+ enew.remember(e);
+ gotMediaException = true;
+ }
// if it is a local url of type dir
if ( (! media::MediaManager::downloads(url)) && ( url.getScheme() ==
"dir" ) )
@@ -1091,13 +1119,6 @@
}
}
}
- catch ( const media::MediaException &e )
- {
- ZYPP_CAUGHT(e);
- RepoException enew("Error trying to read from " + url.asString());
- enew.remember(e);
- ZYPP_THROW(enew);
- }
catch ( const Exception &e )
{
ZYPP_CAUGHT(e);
@@ -1106,6 +1127,9 @@
ZYPP_THROW(enew);
}
+ if (gotMediaException)
+ ZYPP_THROW(enew);
+
return repo::RepoType::NONE;
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx
Date: Mon Oct 13 19:12:03 2008
New Revision: 11332
URL: http://svn.opensuse.org/viewcvs/zypp?rev=11332&view=rev
Log:
- repository probing: check for other types of repo even on
MediaException, throw only if all fail (bnc #335906)
Modified:
trunk/libzypp/zypp/RepoManager.cc
Modified: trunk/libzypp/zypp/RepoManager.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=11332&r1=11331&r2=11332&view=diff
==============================================================================
--- trunk/libzypp/zypp/RepoManager.cc (original)
+++ trunk/libzypp/zypp/RepoManager.cc Mon Oct 13 19:12:03 2008
@@ -1072,13 +1072,41 @@
return repo::RepoType::NONE;
}
+ // prepare exception to be thrown if the type could not be determined
+ // due to a media exception. We can't throw right away, because of some
+ // problems with proxy servers returning an incorrect error
+ // on ftp file-not-found(bnc #335906). Instead we'll check another types
+ // before throwing.
+ RepoException enew("Error trying to read from " + url.asString());
+ bool gotMediaException = false;
try
{
MediaSetAccess access(url);
- if ( access.doesFileExist("/repodata/repomd.xml") )
- return repo::RepoType::RPMMD;
- if ( access.doesFileExist("/content") )
- return repo::RepoType::YAST2;
+ try
+ {
+ if ( access.doesFileExist("/repodata/repomd.xml") )
+ return repo::RepoType::RPMMD;
+ }
+ catch ( const media::MediaException &e )
+ {
+ ZYPP_CAUGHT(e);
+ DBG << "problem checking for repodata/repomd.xml file" << endl;
+ enew.remember(e);
+ gotMediaException = true;
+ }
+
+ try
+ {
+ if ( access.doesFileExist("/content") )
+ return repo::RepoType::YAST2;
+ }
+ catch ( const media::MediaException &e )
+ {
+ ZYPP_CAUGHT(e);
+ DBG << "problem checking for content file" << endl;
+ enew.remember(e);
+ gotMediaException = true;
+ }
// if it is a local url of type dir
if ( (! media::MediaManager::downloads(url)) && ( url.getScheme() ==
"dir" ) )
@@ -1091,13 +1119,6 @@
}
}
}
- catch ( const media::MediaException &e )
- {
- ZYPP_CAUGHT(e);
- RepoException enew("Error trying to read from " + url.asString());
- enew.remember(e);
- ZYPP_THROW(enew);
- }
catch ( const Exception &e )
{
ZYPP_CAUGHT(e);
@@ -1106,6 +1127,9 @@
ZYPP_THROW(enew);
}
+ if (gotMediaException)
+ ZYPP_THROW(enew);
+
return repo::RepoType::NONE;
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx
| < Previous | Next > |