From nobody Tue Aug 09 04:40:43 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M20kM5ZjHz4YGGf; Tue, 9 Aug 2022 04:40:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M20kM55qcz3w8M; Tue, 9 Aug 2022 04:40:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660020043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PbIxMLfXtmMxsM94i7MfNnDX2AJkusEYS5rv1Tx35co=; b=yklPoEVHzRmdHONzPlvLacpMuGfJ0psyXbIldoViGqVUMup1RNlhFwN4yl5WO8U5qb6wzp oiAIe2XYZKE7aACdpIBvg0F0ropxtD7fCkvA2/6BVecfVEG6A3NGPFahijQCmC3Ol2DCNJ B+LC1pQyS950nb+Dj87WibxrTgkzKUHXVe6iUBRZ5QitpU3eoDL+1IBQxbgeyCtZgyuaHM O1hLDHd4YaX6khb61gj2nhf2zU1b6jLDJUW8uLJ2H2czB4G2z7dRnbhPwxfKZGARON31ND bzw+98jIzbJTFc/nVCznEi+H/Kq18pc1Si+o1gr8ctQYfK1U1PQBTHFYBREl9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M20kM48LSzJQD; Tue, 9 Aug 2022 04:40:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2794ehFD080309; Tue, 9 Aug 2022 04:40:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2794ehKF080308; Tue, 9 Aug 2022 04:40:43 GMT (envelope-from git) Date: Tue, 9 Aug 2022 04:40:43 GMT Message-Id: <202208090440.2794ehKF080308@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: =?utf-8?Q?Romain=20Tarti=C3=A8re?= Subject: git: 01c33f63b62f - main - textproc/opensearch-dashboards: Fix startup after node14 update List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: romain X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01c33f63b62fe112782908ab9f926a36ec144f09 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660020043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PbIxMLfXtmMxsM94i7MfNnDX2AJkusEYS5rv1Tx35co=; b=hECwUJiDaRjYqcTJhePGzaJZIo7fZPZpG+dFrerF62J9xjiO4GvUnfBXbn+b5roEUhIMLI 5OAR1wb/6kCQNuSTl18kL79nmzbmWsYCa99cWxxEKKFiImipMYI+Z88C5TUU6vUQSInls2 zr6nWv0krGeKDHLyuMI9NgXrFB+9XR//Eg596doRovPKpRSOq12IuhpXfg4zm8rnjJMRy6 Gg7h902FgB4i33fBuQFCCBhwExSrra1qJtXOu/62CFIkTWF4RvAvUzG9XrsodHAQVwXM6V p927CZl6oZLBVaTFvRDkbc1vMSkWDQQj4ZPfixXeWcpbEL0/3IdvvEZBEYdi6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660020043; a=rsa-sha256; cv=none; b=J/GnZ6wLayCH2R9iAKca5E7bpV5a2l/5IBhMvo+SFOXNJxPonnMGkr88cvcnWpJ5d8gJHK xBH0g+It8eVJWodA/wM6qQdWY0ZhDzfjfizTnusEawGhWoBwgt8IwXT5wW7rRvIn2a8mKn uqi1dSd0eN3WAIH/o5/xIPsPoxqpG3jGJdS5/+fIjbwIgvNJRuvE+p1rebjzk1tSrjLcEL HlairG8JOOQtStH6aEV2tcUYYyHV9KNL7N2cam5qeTF7c2bDiTKlrhXjrIN8OtSCX3M7cf VFzkMuvimtoOaFSPS7eSzLo7+hVOfPWZ2lVVpZkzWoDp4UmclQX286bAsZWG3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by romain: URL: https://cgit.FreeBSD.org/ports/commit/?id=01c33f63b62fe112782908ab9f926a36ec144f09 commit 01c33f63b62fe112782908ab9f926a36ec144f09 Author: Romain Tartière AuthorDate: 2022-08-09 04:27:50 +0000 Commit: Romain Tartière CommitDate: 2022-08-09 04:40:28 +0000 textproc/opensearch-dashboards: Fix startup after node14 update PR: 265717 With hat: opensearch --- textproc/opensearch-dashboards/Makefile | 1 + ...src_setup__node__env_node__version__validator.js | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/textproc/opensearch-dashboards/Makefile b/textproc/opensearch-dashboards/Makefile index 8e0365f4e303..2ff215926a43 100644 --- a/textproc/opensearch-dashboards/Makefile +++ b/textproc/opensearch-dashboards/Makefile @@ -1,6 +1,7 @@ PORTNAME= opensearch-dashboards DISTVERSION= 2.1.0 DISTVERSIONSUFFIX= -linux-x64 +PORTREVISION= 1 CATEGORIES= textproc www MASTER_SITES= https://artifacts.opensearch.org/releases/bundle/${PORTNAME}/${DISTVERSION}/ diff --git a/textproc/opensearch-dashboards/files/patch-src_setup__node__env_node__version__validator.js b/textproc/opensearch-dashboards/files/patch-src_setup__node__env_node__version__validator.js new file mode 100644 index 000000000000..b78a0bf27cc9 --- /dev/null +++ b/textproc/opensearch-dashboards/files/patch-src_setup__node__env_node__version__validator.js @@ -0,0 +1,21 @@ +--- src/setup_node_env/node_version_validator.js.orig 2022-06-30 21:38:00 UTC ++++ src/setup_node_env/node_version_validator.js +@@ -36,13 +36,13 @@ var pkg = require('../../package.json'); // Note: This + var currentVersion = process && process.version || null; + var rawRequiredVersion = pkg && pkg.engines && pkg.engines.node || null; + var requiredVersion = rawRequiredVersion ? 'v' + rawRequiredVersion : rawRequiredVersion; +-var currentVersionMajorMinorPatch = currentVersion.match(/^v(\d+)\.(\d+)\.(\d+)/); +-var requiredVersionMajorMinorPatch = requiredVersion.match(/^v(\d+)\.(\d+)\.(\d+)/); +-var isVersionValid = currentVersionMajorMinorPatch[1] === requiredVersionMajorMinorPatch[1] && currentVersionMajorMinorPatch[2] === requiredVersionMajorMinorPatch[2] && parseInt(currentVersionMajorMinorPatch[3], 10) >= parseInt(requiredVersionMajorMinorPatch[3], 10); // Validates current the NodeJS version compatibility when OpenSearch Dashboards starts. ++var currentVersionMajorMinorPatch = currentVersion.match(/^v(\d+)\.(\d+)\.(\d+)/).map(x => parseInt(x, 10)); ++var requiredVersionMajorMinorPatch = requiredVersion.match(/^v(\d+)\.(\d+)\.(\d+)/).map(x => parseInt(x, 10)); ++var isVersionValid = currentVersionMajorMinorPatch[1] === requiredVersionMajorMinorPatch[1] && currentVersionMajorMinorPatch[2] > requiredVersionMajorMinorPatch[2] || currentVersionMajorMinorPatch[1] === requiredVersionMajorMinorPatch[1] && currentVersionMajorMinorPatch[2] === requiredVersionMajorMinorPatch[2] && currentVersionMajorMinorPatch[3] >= requiredVersionMajorMinorPatch[3]; // Validates current the NodeJS version compatibility when OpenSearch Dashboards starts. + + if (!isVersionValid) { + var errorMessage = `OpenSearch Dashboards was built with ${requiredVersion} and does not support the current Node.js version ${currentVersion}. ` + `Please use Node.js ${requiredVersion} or a higher patch version.`; // Actions to apply when validation fails: error report + exit. + + console.error(errorMessage); + process.exit(1); +-} +\ No newline at end of file ++}