mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
chrome: conditionally extract deb file
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
This commit is contained in:
parent
50b57a4216
commit
de67ea0a84
@ -5,7 +5,7 @@ PKG_NAME="chrome"
|
|||||||
PKG_VERSION="1.0"
|
PKG_VERSION="1.0"
|
||||||
# curl -s http://dl.google.com/linux/chrome/deb/dists/stable/main/binary-amd64/Packages | grep -B 1 Version
|
# curl -s http://dl.google.com/linux/chrome/deb/dists/stable/main/binary-amd64/Packages | grep -B 1 Version
|
||||||
PKG_VERSION_NUMBER="123.0.6312.122"
|
PKG_VERSION_NUMBER="123.0.6312.122"
|
||||||
PKG_REV="0"
|
PKG_REV="1"
|
||||||
PKG_ARCH="x86_64"
|
PKG_ARCH="x86_64"
|
||||||
PKG_LICENSE="Custom"
|
PKG_LICENSE="Custom"
|
||||||
PKG_SITE="http://www.google.com/chrome"
|
PKG_SITE="http://www.google.com/chrome"
|
||||||
|
@ -3,16 +3,28 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
# Copyright (C) 2022-present Team LibreELEC (https://libreelec.tv)
|
# Copyright (C) 2022-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
sys.path.append('/storage/.kodi/addons/browser.chrome/resources')
|
sys.path.append('/storage/.kodi/addons/browser.chrome/resources')
|
||||||
import unix_ar
|
import unix_ar
|
||||||
import tarfile
|
import tarfile
|
||||||
|
|
||||||
|
|
||||||
if len(sys.argv) != 3:
|
if len(sys.argv) != 3:
|
||||||
print("Parameter error", file=sys.stderr)
|
print("Parameter error", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
ar = unix_ar.open(sys.argv[1])
|
if os.path.isfile(sys.argv[1]):
|
||||||
tarball = ar.open('data.tar.xz/')
|
try:
|
||||||
tar = tarfile.open(fileobj=tarball)
|
ar = unix_ar.open(sys.argv[1])
|
||||||
tar.extractall(path=sys.argv[2])
|
except ValueError:
|
||||||
|
print(f"Unable to open archive: {sys.argv[1]}", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
tarball = ar.open('data.tar.xz/')
|
||||||
|
tar = tarfile.open(fileobj=tarball)
|
||||||
|
tar.extractall(path=sys.argv[2])
|
||||||
|
else:
|
||||||
|
print(f"File not found: {sys.argv[1]}", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user