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.
This commit is contained in:
Erik Schnetter
2022-04-05 21:45:45 -04:00
committed by GitHub
parent 6a3c0825e3
commit 69b3a88fa3

View File

@@ -1104,8 +1104,13 @@ def mirror_id(self):
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: