<pre style='margin:0'>
Rainer Müller (raimue) pushed a commit to branch master
in repository macports-ports.

</pre>
<p><a href="https://github.com/macports/macports-ports/commit/491f92065d31f80f744ff2dfbf4d345076e7fadd">https://github.com/macports/macports-ports/commit/491f92065d31f80f744ff2dfbf4d345076e7fadd</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 491f92065d31f80f744ff2dfbf4d345076e7fadd
</span>Author: Rainer Müller <raimue@macports.org>
AuthorDate: Tue Apr 3 21:14:28 2018 +0200

<span style='display:block; white-space:pre;color:#404040;'>    cargo group: Move import to helper function
</span>---
 _resources/port1.0/group/cargo-1.0.tcl | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/cargo-1.0.tcl b/_resources/port1.0/group/cargo-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index bbd2608..05d7faa 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/cargo-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/cargo-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -69,6 +69,21 @@ proc handle_cargo_crates {option action {value ""}} {
</span>     }
 }
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+proc cargo._import_crate {cname cversion chksum cratefile} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    global cargo.home distpath
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    ui_debug "Adding ${cratefile} to cargo home"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    set tar [findBinary tar ${portutil::autoconf::tar_path}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    system -W "${cargo.home}/macports" "$tar -xf ${distpath}/${cratefile}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    # although cargo will never see the .crate, it expects to find the sha256 checksum here
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    set chkfile [open "${cargo.home}/macports/${cname}-${cversion}/.cargo-checksum.json" "w"]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    puts $chkfile "{"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    puts $chkfile "    \"package\": \"${chksum}\","
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    puts $chkfile "    \"files\": {}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    puts $chkfile "}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    close $chkfile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # The distfiles of the main port will also be stored in this directory,
 # but this is the only way to allow reusing the same crates across multiple ports.
 dist_subdir             cargo-crates
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -94,16 +109,7 @@ pre-build {
</span>     # import all crates
     foreach {cname cversion chksum} ${cargo.crates} {
         set cratefile ${cname}-${cversion}.crate
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        ui_debug "Adding ${cratefile} to cargo home"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        set tar [findBinary tar ${portutil::autoconf::tar_path}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        system -W "${cargo.home}/macports" "$tar -xf ${distpath}/${cratefile}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        # although cargo will never see the .crate, it expects to find the sha256 checksum here
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        set chkfile [open "${cargo.home}/macports/${cname}-${cversion}/.cargo-checksum.json" "w"]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        puts $chkfile "{"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        puts $chkfile "    \"package\": \"${chksum}\","
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        puts $chkfile "    \"files\": {}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        puts $chkfile "}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        close $chkfile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        cargo._import_crate ${cname} ${cversion} ${chksum} ${cratefile}
</span>     }
 }
 
</pre><pre style='margin:0'>

</pre>