diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-02-18 11:22:26 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-02-18 11:22:26 +0100 |
commit | 5e02df826dc8e1f2a1d687f2cc4e55daba4c5452 (patch) | |
tree | b3f942c5a30818c387ed80e8d8a914c432511038 /apt-pkg/contrib | |
parent | 937bc486b9ce42e144e00467658bd431ef826664 (diff) |
Change the package index Info methods to allow apt-cache policy to be
useful when using several different archives on the same host.
(Closes: #329814, LP: #22354)
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 12 | ||||
-rw-r--r-- | apt-pkg/contrib/strutl.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 2913fbf44..8e8820949 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1323,3 +1323,15 @@ string URI::SiteOnly(const string &URI) return U; } /*}}}*/ +// URI::NoUserPassword - Return the schema, site and path for the URI /*{{{*/ +// --------------------------------------------------------------------- +/* */ +string URI::NoUserPassword(const string &URI) +{ + ::URI U(URI); + U.User.clear(); + U.Password.clear(); + U.Port = 0; + return U; +} + /*}}}*/ diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index 2b2e147fb..a1e7f3934 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -120,6 +120,7 @@ class URI inline void operator =(const string &From) {CopyFrom(From);}; inline bool empty() {return Access.empty();}; static string SiteOnly(const string &URI); + static string NoUserPassword(const string &URI); URI(string Path) {CopyFrom(Path);}; URI() : Port(0) {}; |