#include <apti18n.h>
#include <sys/types.h>
-#include <regex.h>
#include <cstdlib>
#include <algorithm>
#include <iostream>
for (pkgCache::DepIterator D = Cache[I].InstVerIter(Cache).DependsList(); D.end() == false; D++)
{
- if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
+ if (D->Type == pkgCache::Dep::Depends ||
+ D->Type == pkgCache::Dep::PreDepends ||
+ D->Type == pkgCache::Dep::Recommends)
Scores[D.TargetPkg()->ID]++;
}
}
{
// Only do it for the install version
if ((pkgCache::Version *)D.ParentVer() != Cache[D.ParentPkg()].InstallVer ||
- (D->Type != pkgCache::Dep::Depends && D->Type != pkgCache::Dep::PreDepends))
+ (D->Type != pkgCache::Dep::Depends &&
+ D->Type != pkgCache::Dep::PreDepends &&
+ D->Type != pkgCache::Dep::Recommends))
continue;
Scores[I->ID] += abs(OldScores[D.ParentPkg()->ID]);
(*I)->Finished();
- // stripping username/password from URI if present
- string descUri = (*I)->DescURI();
- regex_t userPassRegex;
- regcomp(&userPassRegex, "\\://(\\w+)\\:(\\w+)@", REG_EXTENDED);
- regmatch_t userPassMatch;
- regexec(&userPassRegex, descUri.c_str(), 1, &userPassMatch, 0);
- if (userPassMatch.rm_so != -1) // regexp matched
- {
- // really stripping
- size_t stripStart = userPassMatch.rm_so + 3;
- size_t stripEnd = userPassMatch.rm_eo;
- descUri = descUri.substr(0, stripStart) +
- descUri.substr(stripEnd, string::npos);
- }
-
+ ::URI uri((*I)->DescURI());
+ uri.User.clear();
+ uri.Password.clear();
+ string descUri = string(uri);
_error->Warning(_("Failed to fetch %s %s\n"), descUri.c_str(),
(*I)->ErrorText.c_str());