cargo: Use the new suffix parameter to translate_url

Depending on the case, we might be unable to know whether the url provided
has a trailing slash or not (e.g. if it is an alias). To work around that,
we try to append a trailing slash to the specified URL if necessary, without
breaking cache keys.

This behaviour can be incompatible with 2.0 in some cases, but is the
behaviour requested in https://github.com/apache/buildstream-plugins/pull/52

To keep the compatibility with older buildstream versions, we check the
version and only use suffix with buildstream >= 2.2.

Co-authored by: Jürg Billeter <j@bitron.ch>
1 file changed