From f06ec8723ede8c2027006fc12a00e86cebc58867 Mon Sep 17 00:00:00 2001 From: Tobias Kortkamp Date: Tue, 6 Aug 2019 06:43:43 +0000 Subject: [PATCH] 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. --- Mk/Scripts/cargo-crates.awk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mk/Scripts/cargo-crates.awk b/Mk/Scripts/cargo-crates.awk index 8daaf05065eb..b930dfce00a6 100644 --- a/Mk/Scripts/cargo-crates.awk +++ b/Mk/Scripts/cargo-crates.awk @@ -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, "/")