1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-27 10:03:20 +00:00

Mk/Uses/cargo.mk: Fix cargo-crates to not output identical GH_TUPLE entries

For example, in audio/spotifyd some crates have their sources on
GitHub instead of crates.io and share the same repository and commit
in Cargo.lock like

[[package]]
name = "librespot"
source = "git+https://github.com/librespot-org/librespot.git#4e3576ba7c6146cf68e1953daeec929d619b26b1"

[[package]]
name = "librespot-audio"
source = "git+https://github.com/librespot-org/librespot.git#4e3576ba7c6146cf68e1953daeec929d619b26b1"

Based on this cargo-crates.awk would naively generate multiple
identical entries like

librespot-org:librespot:4e3576ba7c6146cf68e1953daeec929d619b26b1:librespot
librespot-org:librespot:4e3576ba7c6146cf68e1953daeec929d619b26b1:librespotaudio

This adds a lot of extra noise to the port and distinfo and is not
really needed for anything.
This commit is contained in:
Tobias Kortkamp 2019-08-06 06:43:43 +00:00
parent f9acc307cd
commit f06ec8723e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=508230

View File

@ -50,7 +50,8 @@ function split_url(s) {
url["port"] = url_host[2]
}
/^source = "git\+(https|http|git):\/\/github.com\/.*#.*"/ {
!gh_tuple_seen[$0] && /^source = "git\+(https|http|git):\/\/github.com\/.*#.*"/ {
gh_tuple_seen[$0] = 1
split_url(substr($3, 1, length($3) - 1))
split(url["path"], path, "/")