gtristan commented on code in PR #1997:
URL: https://github.com/apache/buildstream/pull/1997#discussion_r2055260155
##########
src/buildstream/downloadablefilesource.py:
##########
@@ -270,6 +318,21 @@ def fetch(self): # pylint: disable=arguments-differ
"File downloaded from {} has sha256sum '{}', not
'{}'!".format(self.url, sha256, self.ref)
)
+ def collect_source_info(self):
+ version_match = self._guess_pattern.search(self.original_url)
+ if not version_match:
+ version_guess = None
+ elif self._guess_pattern.groups == 0:
+ version_guess = version_match.group(0)
+ else:
+ version_guess = ".".join(version_match.groups())
Review Comment:
I know this guessing is used by collect_manifest also for git plugins, but
I'd rather not extend the API at this point, it's a bit unwieldy as an API and
includes the definition of a default pattern, overridable pattern and some few
lines for the matching - it's a lot of mental gymnastics just to share the few
lines of code which only make up a portion of the functionality.
Maybe later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]