code-marketplace: auto updated to 1.102.1-2
It has been built because: * nvchecker detects the following updates: aur(0): 1.102.1-1 -> 1.102.1-2
This commit is contained in:
parent
75a4d001c5
commit
145854e7de
|
@ -1,7 +1,7 @@
|
|||
# Maintainer: Sainnhe Park <sainnhe@gmail.com>
|
||||
pkgname=code-marketplace
|
||||
pkgver=1.102.1
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc='Enable vscode marketplace in Code OSS'
|
||||
arch=('any')
|
||||
url='https://marketplace.visualstudio.com/vscode'
|
||||
|
@ -13,7 +13,7 @@ source=('code-marketplace.hook'
|
|||
'patch.py'
|
||||
'patch.json')
|
||||
md5sums=('ce502275aa945985182b51420fc6037c'
|
||||
'9ed6f3972479ab6d3d053e7c47ead55a'
|
||||
'8ff44c81624f63e20884531715896ef3'
|
||||
'10c1c73ea3977afb9b8954e5e8407d6e')
|
||||
|
||||
package() {
|
||||
|
|
|
@ -31,6 +31,33 @@ if not os.path.exists(cache_path):
|
|||
with open(cache_path, "w") as file:
|
||||
file.write("{}")
|
||||
|
||||
def fix_sign(undo=False):
|
||||
"""Fix the error of failed signature verification."""
|
||||
path = (
|
||||
"/usr/lib/code/out/vs/code/electron-utility/sharedProcess/sharedProcessMain.js"
|
||||
)
|
||||
orig_text = 'import("node-ovsx-sign")'
|
||||
fixed_text = 'import("@vscode/vsce-sign")'
|
||||
if undo:
|
||||
search_text = fixed_text
|
||||
replace_text = orig_text
|
||||
else:
|
||||
search_text = orig_text
|
||||
replace_text = fixed_text
|
||||
try:
|
||||
with open(path, "r", encoding="utf-8") as f:
|
||||
content = f.read()
|
||||
|
||||
if search_text not in content:
|
||||
return
|
||||
|
||||
new_content = content.replace(search_text, replace_text)
|
||||
|
||||
with open(path, "w", encoding="utf-8") as f:
|
||||
_ = f.write(new_content)
|
||||
|
||||
except Exception as e:
|
||||
print(f"[code-marketplace] ERROR: {e}")
|
||||
|
||||
def patch():
|
||||
with open(product_path, "r") as product_file:
|
||||
|
@ -46,6 +73,7 @@ def patch():
|
|||
json.dump(product_data, product_file, indent="\t")
|
||||
with open(cache_path, "w") as cache_file:
|
||||
json.dump(cache_data, cache_file, indent="\t")
|
||||
fix_sign(False)
|
||||
|
||||
|
||||
def restore():
|
||||
|
@ -62,6 +90,7 @@ def restore():
|
|||
product_data[key] = cache_data[key]
|
||||
with open(product_path, "w") as product_file:
|
||||
json.dump(product_data, product_file, indent="\t")
|
||||
fix_sign(True)
|
||||
|
||||
|
||||
if operation == "patch":
|
||||
|
|
Loading…
Reference in a new issue