summaryrefslogtreecommitdiff
path: root/sdk-telemetry-optout.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-01 16:05:09 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-01 16:05:09 +0000
commit9a52b2875a2d814a19ffcee56bd6b962b994dfcb (patch)
tree551246daead1fa0c2e4a17a7e22208b13be88bbb /sdk-telemetry-optout.patch
parentaf7c3c9716770d937544687b482bf62e866193de (diff)
automatic import of dotnet6.0openeuler24.03_LTSopeneuler23.09
Diffstat (limited to 'sdk-telemetry-optout.patch')
-rw-r--r--sdk-telemetry-optout.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/sdk-telemetry-optout.patch b/sdk-telemetry-optout.patch
new file mode 100644
index 0000000..d6e6464
--- /dev/null
+++ b/sdk-telemetry-optout.patch
@@ -0,0 +1,18 @@
+diff --git a/src/Cli/dotnet/Program.cs b/src/Cli/dotnet/Program.cs
+index de1ebb9e6..6bbf479de 100644
+--- a/src/Cli/dotnet/Program.cs
++++ b/src/Cli/dotnet/Program.cs
+@@ -28,6 +28,13 @@ public class Program
+
+ public static int Main(string[] args)
+ {
++ // opt out of telemetry by default if the env var is unset
++ string telemetryValue = Environment.GetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT");
++ if (String.IsNullOrEmpty(telemetryValue))
++ {
++ Environment.SetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
++ }
++
+ DebugHelper.HandleDebugSwitch(ref args);
+
+ // Capture the current timestamp to calculate the host overhead.