-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not crash when the repository URL is not defined (bsc#1043218) #77
Conversation
@@ -267,8 +267,14 @@ PkgFunctions::SourceLoadImpl(PkgProgress &progress) | |||
// do not autorefresh remote repositories when the network is not running | |||
if (!network_is_running) | |||
{ | |||
zypp::Url url = *((*it)->repoInfo().baseUrlsBegin()); | |||
|
|||
if ((*it)->repoInfo().baseUrlsEmpty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing spaces ? :-)
zypp::Url url = *((*it)->repoInfo().baseUrlsBegin()); | ||
|
||
if ((*it)->repoInfo().baseUrlsEmpty()) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
@@ -286,11 +292,17 @@ PkgFunctions::SourceLoadImpl(PkgProgress &progress) | |||
refresh_started_called = true; | |||
} | |||
|
|||
zypp::RepoManager::RefreshCheckStatus ref_stat = repomanager->checkIfToRefreshMetadata((*it)->repoInfo(), *((*it)->repoInfo().baseUrlsBegin())); | |||
if ((*it)->repoInfo().baseUrlsEmpty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces :-)
|
||
refresh = false; | ||
} | ||
if (repoinfo.baseUrlsEmpty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
(*_repo.baseUrlsBegin()).asString().c_str()); | ||
_maccess = new zypp::MediaSetAccess(_repo.name(), *_repo.baseUrlsBegin()); // FIXME handle multiple baseUrls | ||
_repo.url().asString().c_str()); | ||
_maccess = new zypp::MediaSetAccess(_repo.name(), _repo.url()); // FIXME handle multiple baseUrls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the fixme still needed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um, I do not know so I keep it for now 😉
The indentation issues are caused by mixed spaces and tabs. GitHub does not display it correctly 😟 . In editor it looks OK. And I'd like to avoid complete reformatting the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's fine. LGTM
Note
RepoInfo::url()
is a shortcut forbaseUrlsEmpty() ? Url() : *baseUrlsBegin())
, i.e. returns empty URL if the repo does not define it. This can simplify the code a bit, see the details here.