Skip to content

Commit b82e71f

Browse files
Update binaryspec for deb creation as debmake=4.3.2-1 and above introduced nodejs (#5401)
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
1 parent e703f50 commit b82e71f

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

scripts/components/OpenSearch-Dashboards/install.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ fi
8686

8787
if [ "$DISTRIBUTION" = "rpm" -o "$DISTRIBUTION" = "deb" ]; then
8888
cp -v ../../../config/opensearch_dashboards-$MAJOR_VERSION.x.yml "$OUTPUT/../etc/opensearch-dashboards/opensearch_dashboards.yml"
89-
cp -a ../../../scripts/pkg/service_templates/opensearch-dashboards/* "$OUTPUT/../"
89+
cp -va ../../../scripts/pkg/service_templates/opensearch-dashboards/* "$OUTPUT/../"
9090

9191
if [ "$MAJOR_VERSION" = "1" ]; then
92-
cp -a ../../../scripts/pkg/build_templates/legacy/opensearch-dashboards/$DISTRIBUTION/* "$OUTPUT/../"
92+
cp -va ../../../scripts/pkg/build_templates/legacy/opensearch-dashboards/$DISTRIBUTION/* "$OUTPUT/../"
9393
else
94-
cp -a ../../../scripts/pkg/build_templates/current/opensearch-dashboards/$DISTRIBUTION/* "$OUTPUT/../"
94+
cp -va ../../../scripts/pkg/build_templates/current/opensearch-dashboards/$DISTRIBUTION/* "$OUTPUT/../"
9595
fi
9696
else
9797
cp -v ../../../config/opensearch_dashboards-$MAJOR_VERSION.x.yml "$OUTPUT/config/opensearch_dashboards.yml"

src/assemble_workflow/bundle_linux_deb.py

+5
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ def build(self, name: str, dest: str, archive_path: str, build_cls: BuildManifes
109109
deb_version = build_cls.version.replace('-', '.')
110110
self.generate_changelog_file(ext_dest, deb_version)
111111

112+
# 20250316: debmake since 4.3.2-1 introduced nodejs type with auto detection of js
113+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=954828
114+
# Official update to 4.4.0-3 further replace pkg-js-tools with dh-nodejs here:
115+
# https://launchpad.net/ubuntu/+source/debmake/+changelog
112116
bundle_cmd = " ".join(
113117
[
114118
'debmake',
@@ -117,6 +121,7 @@ def build(self, name: str, dest: str, archive_path: str, build_cls: BuildManifes
117121
'--invoke debuild',
118122
f'--package {self.filename}',
119123
'--native',
124+
f'--binaryspec {self.filename}:bin' if self.filename == 'opensearch' else f'--binaryspec {self.filename}:nodejs',
120125
'--revision 1',
121126
f"--upstreamversion {deb_version}"
122127
]

tests/tests_assemble_workflow/test_bundle_linux_deb.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def test_build_deb(self, generate_changelog_file_call_mock: Mock, check_call_moc
5656

5757
self.assertRaises(KeyError, lambda: os.environ['OPENSEARCH_PATH_CONF'])
5858
self.assertEqual(check_call_mock.call_count, 1)
59-
self.assertEqual('debmake --fullname "OpenSearch Team" --email "release@opensearch.org" --invoke debuild --package opensearch --native --revision 1 --upstreamversion 1.3.0',
59+
self.assertEqual('debmake --fullname "OpenSearch Team" --email "release@opensearch.org" --invoke debuild --package opensearch --native '
60+
'--binaryspec opensearch:bin --revision 1 --upstreamversion 1.3.0',
6061
args_list_deb[0][0][0])
6162
self.assertEqual(shutil_move_mock.call_count, 2)
6263
self.assertEqual(generate_changelog_file_call_mock.call_count, 1)
@@ -74,7 +75,8 @@ def test_build_deb_qualifier(self, generate_changelog_file_call_mock: Mock, chec
7475

7576
self.assertRaises(KeyError, lambda: os.environ['OPENSEARCH_PATH_CONF'])
7677
self.assertEqual(check_call_mock.call_count, 1)
77-
self.assertEqual('debmake --fullname "OpenSearch Team" --email "release@opensearch.org" --invoke debuild --package opensearch --native --revision 1 --upstreamversion 2.0.0.alpha1',
78+
self.assertEqual('debmake --fullname "OpenSearch Team" --email "release@opensearch.org" --invoke debuild --package opensearch --native '
79+
'--binaryspec opensearch:bin --revision 1 --upstreamversion 2.0.0.alpha1',
7880
args_list_deb_qualifier[0][0][0])
7981
self.assertEqual(shutil_move_mock.call_count, 2)
8082
self.assertEqual(generate_changelog_file_call_mock.call_count, 1)

0 commit comments

Comments
 (0)