fix(codium-marketplace): sed the json properly (#3827) (#3828)

Honestly should use something like jq to rebuild the json properly
instead imo, but whatever.

Closes #3781

(cherry picked from commit 124b5c7cc6)

Co-authored-by: madomado <madonuko@outlook.com>
This commit is contained in:
Raboneko
2025-03-08 23:08:41 -08:00
committed by GitHub
parent 4f4ffbd486
commit bbe5b0bbd6
@@ -2,7 +2,7 @@
Name: codium-marketplace
Version: 1.65.0
Release: 1%?dist
Release: 2%?dist
Summary: Enable vscode marketplace in vscodium
License: MIT
BuildArch: noarch
@@ -22,7 +22,7 @@ if [ $1 -gt 1 ]; then # update/install
sed -i -e 's/^[[:blank:]]*"serviceUrl":.*/ "serviceUrl": "https:\/\/marketplace.visualstudio.com\/_apis\/public\/gallery",/' \
-e '/^[[:blank:]]*"cacheUrl/d' \
-e '/^[[:blank:]]*"serviceUrl/a\ "cacheUrl": "https:\/\/vscode.blob.core.windows.net\/gallery\/index",' \
-e 's/^[[:blank:]]*"itemUrl":.*/ "itemUrl": "https:\/\/marketplace.visualstudio.com\/items"/' \
-e 's/^[[:blank:]]*"itemUrl":.*/ "itemUrl": "https:\/\/marketplace.visualstudio.com\/items",/' \
-e '/^[[:blank:]]*"linkProtectionTrustedDomains/d' \
/usr/share/codium/resources/app/product.json || true
fi
@@ -30,7 +30,7 @@ fi
%preun
sed -i -e 's/^[[:blank:]]*"serviceUrl":.*/ "serviceUrl": "https:\/\/open-vsx.org\/vscode\/gallery",/' \
-e '/^[[:blank:]]*"cacheUrl/d' \
-e 's/^[[:blank:]]*"itemUrl":.*/ "itemUrl": "https:\/\/open-vsx.org\/vscode\/item"/' \
-e 's/^[[:blank:]]*"itemUrl":.*/ "itemUrl": "https:\/\/open-vsx.org\/vscode\/item",/' \
-e '/^[[:blank:]]*"linkProtectionTrustedDomains/d' \
-e '/^[[:blank:]]*"documentationUrl/i\ "linkProtectionTrustedDomains": ["https://open-vsx.org"],' \
/usr/share/codium/resources/app/product.json || true
@@ -39,9 +39,9 @@ sed -i -e 's/^[[:blank:]]*"serviceUrl":.*/ "serviceUrl": "https:\/\/open-vsx.
sed -i -e 's/^[[:blank:]]*"serviceUrl":.*/ "serviceUrl": "https:\/\/marketplace.visualstudio.com\/_apis\/public\/gallery",/' \
-e '/^[[:blank:]]*"cacheUrl/d' \
-e '/^[[:blank:]]*"serviceUrl/a\ "cacheUrl": "https:\/\/vscode.blob.core.windows.net\/gallery\/index",' \
-e 's/^[[:blank:]]*"itemUrl":.*/ "itemUrl": "https:\/\/marketplace.visualstudio.com\/items"/' \
-e 's/^[[:blank:]]*"itemUrl":.*/ "itemUrl": "https:\/\/marketplace.visualstudio.com\/items",/' \
-e '/^[[:blank:]]*"linkProtectionTrustedDomains/d' \
/usr/share/codium/resources/app/product.json || true
%files
/tmp/terra-codium-marketplace-dummy-file
/tmp/terra-codium-marketplace-dummy-file