From a5b913a83db94380fc91d15571f55cbf7b5c741b Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Mon, 12 Nov 2012 15:58:27 +0000 Subject: Avoid caching repos that are on the local machine anyway Currently the message is still displayed "Updating xxx" but no update is actually done. --- morphlib/localrepocache.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'morphlib/localrepocache.py') diff --git a/morphlib/localrepocache.py b/morphlib/localrepocache.py index ae5fa655..465e9f03 100644 --- a/morphlib/localrepocache.py +++ b/morphlib/localrepocache.py @@ -193,9 +193,13 @@ class LocalRepoCache(object): return quote_url(url) def _cache_name(self, url): - basename = self._escape(url) - path = os.path.join(self._cachedir, basename) - return path + scheme, netloc, path, query, fragment = urlparse.urlsplit(url) + if scheme == 'file': + return path + else: + basename = self._escape(url) + path = os.path.join(self._cachedir, basename) + return path def has_repo(self, reponame): '''Have we already got a cache of a given repo?''' -- cgit v1.2.1