From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 31F4E158015 for ; Sat, 16 Dec 2023 21:45:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 19F2B2BC06E; Sat, 16 Dec 2023 21:45:08 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EAE972BC06E for ; Sat, 16 Dec 2023 21:45:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0E2F5335D63 for ; Sat, 16 Dec 2023 21:45:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 64CAA14C3 for ; Sat, 16 Dec 2023 21:45:03 +0000 (UTC) From: "Maciej Barć" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Maciej Barć" Message-ID: <1702763099.e9606837f04d623e6d5b00d790dcb8e82b1d8e45.xgqt@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-shells/pwsh/files/, app-shells/pwsh/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-shells/pwsh/files/pwsh-7.4.0-disable-telemetry.patch app-shells/pwsh/pwsh-7.4.0.ebuild X-VCS-Directories: app-shells/pwsh/ app-shells/pwsh/files/ X-VCS-Committer: xgqt X-VCS-Committer-Name: Maciej Barć X-VCS-Revision: e9606837f04d623e6d5b00d790dcb8e82b1d8e45 X-VCS-Branch: master Date: Sat, 16 Dec 2023 21:45:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ba91a92c-2281-4c73-8555-571548e34381 X-Archives-Hash: f3cee1457c8ae7471d489836e2935094 commit: e9606837f04d623e6d5b00d790dcb8e82b1d8e45 Author: Maciej Barć gentoo org> AuthorDate: Sat Dec 16 21:40:24 2023 +0000 Commit: Maciej Barć gentoo org> CommitDate: Sat Dec 16 21:44:59 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9606837 app-shells/pwsh: no WarningLevel, switch to en_US, misc tweaks Bug: https://bugs.gentoo.org/914292 Bug: https://github.com/PowerShell/PowerShell/issues/20941 Signed-off-by: Maciej Barć gentoo.org> .../pwsh/files/pwsh-7.4.0-disable-telemetry.patch | 47 ++++++++++++++++++++++ app-shells/pwsh/pwsh-7.4.0.ebuild | 45 ++++++++++----------- 2 files changed, 69 insertions(+), 23 deletions(-) diff --git a/app-shells/pwsh/files/pwsh-7.4.0-disable-telemetry.patch b/app-shells/pwsh/files/pwsh-7.4.0-disable-telemetry.patch new file mode 100644 index 000000000000..49fdc34be8a2 --- /dev/null +++ b/app-shells/pwsh/files/pwsh-7.4.0-disable-telemetry.patch @@ -0,0 +1,47 @@ +--- a/src/System.Management.Automation/utils/Telemetry.cs ++++ b/src/System.Management.Automation/utils/Telemetry.cs +@@ -137,10 +137,10 @@ namespace Microsoft.PowerShell.Telemetry + private static TelemetryClient s_telemetryClient { get; } + + // the unique identifier for the user, when we start we +- private static string s_uniqueUserIdentifier { get; } ++ private static string s_uniqueUserIdentifier { get; } = string.Empty; + + // the session identifier +- private static string s_sessionId { get; } ++ private static string s_sessionId { get; } = string.Empty; + + // private semaphore to determine whether we sent the startup telemetry event + private static int s_startupEventSent = 0; +@@ -149,8 +149,8 @@ namespace Microsoft.PowerShell.Telemetry + /// We send telemetry only a known set of modules and tags. + /// If it's not in the list (initialized in the static constructor), then we report anonymous + /// or don't report anything (in the case of tags). +- private static readonly HashSet s_knownModules; +- private static readonly HashSet s_knownModuleTags; ++ private static readonly HashSet s_knownModules = new(){}; ++ private static readonly HashSet s_knownModuleTags = new(){}; + + /// Gets a value indicating whether telemetry can be sent. + public static bool CanSendTelemetry { get; private set; } = false; +--- a/src/System.Management.Automation/utils/Telemetry.cs ++++ b/src/System.Management.Automation/utils/Telemetry.cs +@@ -165,7 +165,8 @@ namespace Microsoft.PowerShell.Telemetry + static ApplicationInsightsTelemetry() + { + // If we can't send telemetry, there's no reason to do any of this +- CanSendTelemetry = !GetEnvironmentVariableAsBool(name: _telemetryOptoutEnvVar, defaultValue: false); ++ CanSendTelemetry = false; ++ /* + if (CanSendTelemetry) + { + s_sessionId = Guid.NewGuid().ToString(); +@@ -617,6 +618,7 @@ namespace Microsoft.PowerShell.Telemetry + + s_uniqueUserIdentifier = GetUniqueIdentifier().ToString(); + } ++ */ + } + + /// + diff --git a/app-shells/pwsh/pwsh-7.4.0.ebuild b/app-shells/pwsh/pwsh-7.4.0.ebuild index 85a198a23f5f..5c170e355644 100644 --- a/app-shells/pwsh/pwsh-7.4.0.ebuild +++ b/app-shells/pwsh/pwsh-7.4.0.ebuild @@ -252,22 +252,15 @@ inherit check-reqs desktop dotnet-pkg xdg DESCRIPTION="Cross-platform automation and configuration tool" HOMEPAGE="https://microsoft.com/powershell/ https://github.com/PowerShell/PowerShell/" - -if [[ "${PV}" == *9999* ]] ; then - inherit git-r3 - - EGIT_REPO_URI="https://github.com/PowerShell/PowerShell.git" -else - SRC_URI="https://dev.gentoo.org/~xgqt/distfiles/repackaged/${P}.tar.xz" - - KEYWORDS="~amd64 ~arm ~arm64" -fi - -SRC_URI+=" ${NUGET_URIS} " +SRC_URI=" + https://dev.gentoo.org/~xgqt/distfiles/repackaged/${P}.tar.xz + ${NUGET_URIS} +" LICENSE="MIT" SLOT="$(ver_cut 1-2)" -RESTRICT="test" # TODO: "LibraryImports.g.cs" not found. +KEYWORDS="~amd64 ~arm ~arm64" +RESTRICT="test" # TODO: "LibraryImports.g.cs" not found. RDEPEND=" >=dev-libs/libpsl-native-7.4.0:= @@ -289,13 +282,9 @@ DOTNET_PKG_PROJECTS=( src/powershell-unix/powershell-unix.csproj src/Modules/PSGalleryModules.csproj ) -# Lower warning level to skip CS0162 error for the "disable-telemetry" patch. -DOTNET_PKG_BUILD_EXTRA_ARGS=( - -p:WarningLevel=1 -) PATCHES=( - "${FILESDIR}/pwsh-7.3.3-disable-telemetry.patch" "${FILESDIR}/pwsh-7.3.3-disable-update-check.patch" + "${FILESDIR}/pwsh-7.4.0-disable-telemetry.patch" ) DOCS=( CHANGELOG CHANGELOG.md CODE_OF_CONDUCT.md README.md docs ) @@ -303,13 +292,23 @@ DOCS=( CHANGELOG CHANGELOG.md CODE_OF_CONDUCT.md README.md docs ) pkg_setup() { check-reqs_pkg_setup dotnet-pkg_pkg_setup -} -src_unpack() { - dotnet-pkg_src_unpack + if [[ "${MERGE_TYPE}" != binary ]] ; then + local locales="$(locale -a)" + + if has en_US.utf8 ${locales} ; then + LC_ALL=en_US.utf8 + elif has en_US.UTF-8 ${locales} ; then + LC_ALL=en_US.UTF-8 + else + eerror "The locale en_US.utf8 or en_US.UTF-8 is not available." + eerror "Please generate en_US.UTF-8 before building ${CATEGORY}/${P}." + + die "Could not switch to the en_US.UTF-8 locale." + fi - if [[ -n "${EGIT_REPO_URI}" ]] ; then - git-r3_src_unpack + export LC_ALL + einfo "Successfully switched to the ${LC_ALL} locale." fi }