]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/algorithms.cc
Clarify the --help for 'purge' (LP: #243948)
[apt.git] / apt-pkg / algorithms.cc
index 6f30a52da5f2b5213c0f583d5537072b496e3abc..8bd98a6204341487e4a0c3689155e5c3e3fdc74c 100644 (file)
@@ -23,7 +23,6 @@
     
 #include <apti18n.h>
 #include <sys/types.h>
-#include <regex.h>
 #include <cstdlib>
 #include <algorithm>
 #include <iostream>
@@ -1110,8 +1109,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
       return _error->Error(_("Unable to correct problems, you have held broken packages."));
    }
    
-   // set the auto-flags (mvo: I'm not sure if we _really_ need this, but
-   // I didn't managed 
+   // set the auto-flags (mvo: I'm not sure if we _really_ need this)
    pkgCache::PkgIterator I = Cache.PkgBegin();
    for (;I.end() != true; I++) {
       if (Cache[I].NewInstall() && !(Flags[I->ID] & PreInstalled)) {
@@ -1343,22 +1341,10 @@ bool ListUpdate(pkgAcquireStatus &Stat,
 
       (*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;
-         int regMatchResult = regexec(&userPassRegex, descUri.c_str(), 1, &userPassMatch, 0);
-         if (regMatchResult == 0 && 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);
-      }
-      regfree(&userPassRegex);
-
+      ::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());