Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Aug 2019 06:43:43 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r508230 - head/Mk/Scripts
Message-ID:  <201908060643.x766hhLw066419@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Tue Aug  6 06:43:43 2019
New Revision: 508230
URL: https://svnweb.freebsd.org/changeset/ports/508230

Log:
  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.

Modified:
  head/Mk/Scripts/cargo-crates.awk

Modified: head/Mk/Scripts/cargo-crates.awk
==============================================================================
--- head/Mk/Scripts/cargo-crates.awk	Tue Aug  6 06:41:51 2019	(r508229)
+++ head/Mk/Scripts/cargo-crates.awk	Tue Aug  6 06:43:43 2019	(r508230)
@@ -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, "/")



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908060643.x766hhLw066419>