diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
| commit | 4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch) | |
| tree | 1682a647d4463397c119183369ae6f750d5fdcff /buildscripts/eslint.py | |
| parent | aa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff) | |
| parent | 8f0827553e09872941945a093b647a4211a9db7f (diff) | |
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0'
with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
Diffstat (limited to 'buildscripts/eslint.py')
| -rwxr-xr-x | buildscripts/eslint.py | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/buildscripts/eslint.py b/buildscripts/eslint.py index b4d1d97df5c..07cbb0ddc5c 100755 --- a/buildscripts/eslint.py +++ b/buildscripts/eslint.py @@ -19,13 +19,12 @@ import sys import tarfile import tempfile import threading -import platform from typing import Optional import urllib.error import urllib.parse import urllib.request -from distutils import spawn +from distutils import spawn # pylint: disable=no-name-in-module from optparse import OptionParser import structlog @@ -51,17 +50,14 @@ ESLINT_VERSION = "7.22.0" # Name of ESLint as a binary. ESLINT_PROGNAME = "eslint" -# Arch of running system -ARCH = platform.machine() if platform.machine() != "aarch64" else "arm64" - # URL location of our provided ESLint binaries. ESLINT_HTTP_LINUX_CACHE = "https://s3.amazonaws.com/boxes.10gen.com/build/eslint-" + \ - ESLINT_VERSION + "-linux-" + ARCH + ".tar.gz" + ESLINT_VERSION + "-linux.tar.gz" ESLINT_HTTP_DARWIN_CACHE = "https://s3.amazonaws.com/boxes.10gen.com/build/eslint-" + \ ESLINT_VERSION + "-darwin.tar.gz" # Path in the tarball to the ESLint binary. -ESLINT_SOURCE_TAR_BASE = string.Template(ESLINT_PROGNAME + "-$operating_system-$arch") +ESLINT_SOURCE_TAR_BASE = string.Template(ESLINT_PROGNAME + "-$platform-$arch") LOGGER = structlog.get_logger(__name__) @@ -80,15 +76,15 @@ def extract_eslint(tar_path, target_file): tarfp.close() -def get_eslint_from_cache(dest_file, operating_system, arch): +def get_eslint_from_cache(dest_file, platform, arch): """Get ESLint binary from mongodb's cache.""" # Get URL - if operating_system == "Linux": + if platform == "Linux": url = ESLINT_HTTP_LINUX_CACHE - elif operating_system == "Darwin": + elif platform == "Darwin": url = ESLINT_HTTP_DARWIN_CACHE else: - raise ValueError('ESLint is not available as a binary for ' + operating_system) + raise ValueError('ESLint is not available as a binary for ' + platform) dest_dir = tempfile.gettempdir() temp_tar_file = os.path.join(dest_dir, "temp.tar.gz") @@ -97,9 +93,9 @@ def get_eslint_from_cache(dest_file, operating_system, arch): print("Downloading ESLint %s from %s, saving to %s" % (ESLINT_VERSION, url, temp_tar_file)) urllib.request.urlretrieve(url, temp_tar_file) + # pylint: disable=too-many-function-args print("Extracting ESLint %s to %s" % (ESLINT_VERSION, dest_file)) - eslint_distfile = ESLINT_SOURCE_TAR_BASE.substitute(operating_system=operating_system, - arch=arch) + eslint_distfile = ESLINT_SOURCE_TAR_BASE.substitute(platform=platform, arch=arch) extract_eslint(temp_tar_file, eslint_distfile) shutil.move(eslint_distfile, dest_file) @@ -113,7 +109,7 @@ class ESLint(object): # Initialize ESLint configuration information if sys.platform.startswith("linux"): - self.arch = ARCH + self.arch = "x86_64" self.tar_path = None elif sys.platform == "darwin": self.arch = "x86_64" |
