summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Barć <xgqt@gentoo.org>2023-12-16 22:40:24 +0100
committerMaciej Barć <xgqt@gentoo.org>2023-12-16 22:44:59 +0100
commite9606837f04d623e6d5b00d790dcb8e82b1d8e45 (patch)
treef77a71c2bca686dc4010f00fa700c655cc911c3d /app-shells
parentapp-text/paper-clip: bump to 3.6 (diff)
downloadgentoo-e9606837f04d623e6d5b00d790dcb8e82b1d8e45.tar.gz
gentoo-e9606837f04d623e6d5b00d790dcb8e82b1d8e45.tar.bz2
gentoo-e9606837f04d623e6d5b00d790dcb8e82b1d8e45.zip
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ć <xgqt@gentoo.org>
Diffstat (limited to 'app-shells')
-rw-r--r--app-shells/pwsh/files/pwsh-7.4.0-disable-telemetry.patch47
-rw-r--r--app-shells/pwsh/pwsh-7.4.0.ebuild45
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<string> s_knownModules;
+- private static readonly HashSet<string> s_knownModuleTags;
++ private static readonly HashSet<string> s_knownModules = new(){};
++ private static readonly HashSet<string> s_knownModuleTags = new(){};
+
+ /// <summary>Gets a value indicating whether telemetry can be sent.</summary>
+ 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();
+ }
++ */
+ }
+
+ /// <summary>
+
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
}