From d545e3aa97d6dd0924a71517ff63d86da6f9d866 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Wed, 7 Dec 2022 22:49:33 +0100 Subject: [PATCH] vscode: update to 1.74.0 replace ripgrep patch for security reasons --- srcpkgs/vscode/patches/ripgrep.patch | 32 ---------------------------- srcpkgs/vscode/template | 14 ++++++++++-- 2 files changed, 12 insertions(+), 34 deletions(-) delete mode 100644 srcpkgs/vscode/patches/ripgrep.patch diff --git a/srcpkgs/vscode/patches/ripgrep.patch b/srcpkgs/vscode/patches/ripgrep.patch deleted file mode 100644 index f87bc5eaab5a..000000000000 --- a/srcpkgs/vscode/patches/ripgrep.patch +++ /dev/null @@ -1,32 +0,0 @@ -Ping atk if this needs updating. - -This prevents vscode from fetching prebuilt ripgrep from Microsoft -during build, which unbreaks build on platforms where MS deos not -ship a prebuilt ripgrep. - -diff --git a/package.json b/package.json -index 39c3e9f5b10..198dbf3e421 100644 ---- a/package.json -+++ b/package.json -@@ -62,7 +62,7 @@ - "@microsoft/applicationinsights-web": "^2.6.4", - "@parcel/watcher": "2.0.5", - "@vscode/iconv-lite-umd": "0.7.0", -- "@vscode/ripgrep": "^1.14.2", -+ "@vscode/ripgrep": "https://github.com/atk/void-vscode-ripgrep.git", - "@vscode/sqlite3": "5.0.8", - "@vscode/sudo-prompt": "9.3.1", - "@vscode/vscode-languagedetection": "1.0.21", -diff --git a/remote/package.json b/remote/package.json -index 936aa5f5bab..152ba516795 100644 ---- a/remote/package.json -+++ b/remote/package.json -@@ -6,7 +6,7 @@ - "@microsoft/applicationinsights-web": "^2.6.4", - "@parcel/watcher": "2.0.5", - "@vscode/iconv-lite-umd": "0.7.0", -- "@vscode/ripgrep": "^1.14.2", -+ "@vscode/ripgrep": "https://github.com/atk/void-vscode-ripgrep.git", - "@vscode/vscode-languagedetection": "1.0.21", - "applicationinsights": "1.4.2", - "cookie": "^0.4.0", diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template index 6e50274feaf3..d145b12e209b 100644 --- a/srcpkgs/vscode/template +++ b/srcpkgs/vscode/template @@ -1,6 +1,6 @@ # Template file for 'vscode' pkgname=vscode -version=1.73.1 +version=1.74.0 revision=1 _electronver=19.0.8 _npmver=8.6.0 @@ -12,7 +12,7 @@ maintainer="shizonic , Alex Lohr " license="MIT" homepage="https://code.visualstudio.com/" distfiles="https://github.com/microsoft/vscode/archive/refs/tags/${version}.tar.gz" -checksum=fd0b6786968f19e52820d75abbc8ee9345b010d64f96b6c4d6766f9d8705a022 +checksum=171435a9e2736d323af78591593f8a59eac52d26e98ba817daa37261e835aa1f nocross=yes # x64 build does not cut it, it contains native code if [ "$XBPS_TARGET_WORDSIZE" = "32" ]; then @@ -35,6 +35,16 @@ do_configure() { # set used electron version vsed -e "s/^target .*/target \"${_electronver}\"/" -i .yarnrc + + # @vscode/ripgrep attempts to install an own version of ripgrep and provides a path + # we want to use our own version instead, so all we need is the fixed path (/bin/rg) + # remove @vscode/ripgrep from all package.json files it is in: + _PACKAGE_PATTERN="\"@vscode.ripgrep\":" + grep -rl --exclude-dir=.git -E $_PACKAGE_PATTERN | xargs sed -i -E "/${_PACKAGE_PATTERN}/d" + # replace path import with fixed path: + _IMPORT_PATTERN="import.*from '@vscode.ripgrep';" + _IMPORT_REPLACEMENT="s/${_IMPORT_PATTERN}/const rgPath = '\/bin\/rg';/" + grep -rl --exclude-dir=.git -E "$_IMPORT_PATTERN" | xargs sed -i -E "$_IMPORT_REPLACEMENT" } do_build() {