From 5e02df826dc8e1f2a1d687f2cc4e55daba4c5452 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 18 Feb 2010 11:22:26 +0100 Subject: 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) --- apt-pkg/contrib/strutl.cc | 12 ++++++++++++ apt-pkg/contrib/strutl.h | 1 + 2 files changed, 13 insertions(+) (limited to 'apt-pkg/contrib') 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) {}; -- cgit v1.2.3