From 69b3a88fa325a58dcea860fe92fa3910c8609a0c Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 5 Apr 2022 21:45:45 -0400 Subject: Bugfix: CVS fetching (#29793) #27021 broke fetching for CVS-based packages because: - The mirror logic was using URL parsing to extract a path from the CVS repository location - #27021 added sanity checks to enforce that strings passed to the URL parser were actually URLs This replaces the call to "url_util.parse" with logic that is customized for CVS. This implies that VCSFetchStrategy should rename the "url_attr" attribute to something more generic, but that should be handled separately. --- lib/spack/spack/fetch_strategy.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index 44933f62a2..834a408443 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -1104,8 +1104,13 @@ class CvsFetchStrategy(VCSFetchStrategy): if not (self.branch or self.date): # We need a branch or a date to make a checkout reproducible return None - repo_path = url_util.parse(self.url).path - result = os.path.sep.join(['cvs', repo_path]) + # Special-case handling because this is not actually a URL + elements = self.url.split(':') + final = elements[-1] + elements = final.split('/') + # Everything before the first slash is a port number + elements = elements[1:] + result = os.path.sep.join(['cvs'] + elements) if self.branch: result += '%branch=' + self.branch if self.date: -- cgit v1.2.3-60-g2f50