private IDictionary<FeedUri, Feed> GetFeeds(Requirements requirements)
{
var dictionary = new Dictionary<FeedUri, Feed>();
AddFeedToDict(dictionary, requirements.InterfaceUri, requirements);
foreach (var uri in GetNativeFeedPaths(requirements.InterfaceUri))
AddFeedToDict(dictionary, uri, requirements);
foreach (var uri in GetSitePackagePaths(requirements.InterfaceUri))
AddFeedToDict(dictionary, uri, requirements);
foreach (var reference in _interfacePreferences[requirements.InterfaceUri].Feeds)
{
try
{
AddFeedToDict(dictionary, reference.Source, requirements);
}
#region Error handling
catch (IOException ex)
{
// Wrap exception to add context information
throw new IOException(
string.Format("Failed to load feed {1} manually registered for interface {0}. Try '0install remove-feed {0} {1}'.", requirements.InterfaceUri.ToStringRfc(), reference.Source.ToStringRfc()),
ex);
}
#endregion
}
return dictionary;
}