<pre style='margin:0'>
Herby Gillot (herbygillot) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/2fd952b7b7bdd912b0cfa75a6b302b61eccc4ed6">https://github.com/macports/macports-ports/commit/2fd952b7b7bdd912b0cfa75a6b302b61eccc4ed6</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 2fd952b7b7b stripe-cli: disable telemetry
</span>2fd952b7b7b is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 2fd952b7b7bdd912b0cfa75a6b302b61eccc4ed6
</span>Author: Julien Rabinow <randprefix.github@fastmail.com>
AuthorDate: Tue Sep 26 20:51:20 2023 -0700
<span style='display:block; white-space:pre;color:#404040;'> stripe-cli: disable telemetry
</span>---
devel/stripe-cli/Portfile | 5 ++-
.../stripe-cli/files/patch-disable-telemetry.diff | 36 ++++++++++++++++++++++
2 files changed, 40 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/stripe-cli/Portfile b/devel/stripe-cli/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index f6da5b74f16..ac52a7e1822 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/stripe-cli/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/stripe-cli/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -6,7 +6,7 @@ PortGroup golang 1.0
</span> go.setup github.com/stripe/stripe-cli 1.17.2 v
go.offline_build no
github.tarball_from archive
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 1
</span>
homepage https://stripe.com/docs/stripe-cli
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -29,6 +29,9 @@ checksums rmd160 ce2336624b5c86be0e45de04c613286f6fad12c3 \
</span> sha256 dd21c4df533faa4c2006c508992ff5a44be3ee42b3f2f242e469fef131a21c6f \
size 1488303
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# disable stripe telemetry which is otherwise enabled by default
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles patch-disable-telemetry.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> build.cmd make
build.target build
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/stripe-cli/files/patch-disable-telemetry.diff b/devel/stripe-cli/files/patch-disable-telemetry.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..fe0fdbcfd9a
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/stripe-cli/files/patch-disable-telemetry.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,36 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- cmd/stripe/main.go
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ cmd/stripe/main.go
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2,31 +2,13 @@ package main
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ import (
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "context"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "net/http"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "os"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "time"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "github.com/stripe/stripe-cli/pkg/cmd"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "github.com/stripe/stripe-cli/pkg/stripe"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ func main() {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ctx := context.Background()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if stripe.TelemetryOptedOut(os.Getenv("STRIPE_CLI_TELEMETRY_OPTOUT")) || stripe.TelemetryOptedOut(os.Getenv("DO_NOT_TRACK")) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Proceed without the telemetry client if client opted out.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cmd.Execute(ctx)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Set up the telemetry client and add it to the context
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- httpClient := &http.Client{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Timeout: time.Second * 3,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- telemetryClient := &stripe.AnalyticsTelemetryClient{HTTPClient: httpClient}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- contextWithTelemetry := stripe.WithTelemetryClient(ctx, telemetryClient)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cmd.Execute(contextWithTelemetry)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Wait for all telemetry calls to finish before existing the process
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- telemetryClient.Wait()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // always proceed without the telemetry client
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cmd.Execute(ctx)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span></pre><pre style='margin:0'>
</pre>