Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/rust Provide a new show-cargo-depends script whic...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/870ef8be1fa6
branches:  trunk
changeset: 433913:870ef8be1fa6
user:      he <he%pkgsrc.org@localhost>
date:      Mon Jun 08 17:13:39 2020 +0000

description:
Provide a new show-cargo-depends script which works with the coming
version of www/zola where the Cargo.lock file has no [metadata] section.

diffstat:

 lang/rust/cargo.mk |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r 518fc3d1baef -r 870ef8be1fa6 lang/rust/cargo.mk
--- a/lang/rust/cargo.mk        Mon Jun 08 16:10:10 2020 +0000
+++ b/lang/rust/cargo.mk        Mon Jun 08 17:13:39 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cargo.mk,v 1.13 2020/05/21 21:03:44 nia Exp $
+# $NetBSD: cargo.mk,v 1.14 2020/06/08 17:13:39 he Exp $
 #
 # Common logic that can be used by packages that depend on cargo crates
 # from crates.io. This lets existing pkgsrc infrastructure fetch and verify
@@ -62,4 +62,8 @@
 
 .PHONY: show-cargo-depends
 show-cargo-depends:
-       ${RUN}${AWK} '/^\"checksum/ { print "CARGO_CRATE_DEPENDS+=\t" $$2 "-" $$3""; next } ' ${WRKSRC}/Cargo.lock
+       ${RUN}${AWK} '/^name = / { split($$3, a, "\""); name=a[2]; } \
+               /^version = / { split($$3, a, "\""); vers=a[2]; } \
+               /^checksum = / { \
+                       print "CARGO_CRATE_DEPENDS+=\t" name "-" vers; \
+                       }' ${WRKSRC}/Cargo.lock



Home | Main Index | Thread Index | Old Index