Skip to content

Commit d6f3e1f

Browse files
authored
fix(packaging): keep SPDX comments out of Debian control (#3483)
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent fa0bfa4 commit d6f3e1f

4 files changed

Lines changed: 19 additions & 5 deletions

File tree

deploy/deb/control.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2-
# SPDX-License-Identifier: Apache-2.0
3-
41
Package: openshell
52
Version: @VERSION@
63
Architecture: @ARCH@

deploy/deb/control.in.license

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
SPDX-License-Identifier: Apache-2.0

scripts/update_license_headers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@
6060
"scripts/bin/openshell": "#",
6161
}
6262

63-
# Strict JSON does not support comments. Keep SPDX data in REUSE-compatible
64-
# sidecars so these files remain valid inputs to their consumers.
63+
# Some consumer formats do not support comments. Keep SPDX data in
64+
# REUSE-compatible sidecars so these files remain valid inputs.
6565
SIDECAR_LICENSE_FILES: set[str] = {
66+
"deploy/deb/control.in",
6667
"scripts/keycloak-realm.json",
6768
"sdk/conformance/oauth-client-credentials.json",
6869
"sdk/typescript/biome.json",

tasks/scripts/test-packaging-assets.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,25 @@ assert_file_exists() {
3838
}
3939

4040
service="${ROOT}/deploy/deb/openshell-gateway.service"
41+
control="${ROOT}/deploy/deb/control.in"
4142
spec="${ROOT}/openshell.spec"
4243

4344
assert_file_exists "$service"
45+
assert_file_exists "$control"
4446
assert_file_exists "$spec"
4547

48+
# Debian control files are RFC822-style metadata. Older dpkg-deb releases
49+
# reject comment lines as malformed fields, so keep SPDX metadata in the
50+
# adjacent .license sidecar instead of emitting it into DEBIAN/control.
51+
if grep -Eq '^[[:space:]]*#' "$control"; then
52+
echo "FAIL: Debian control template contains a comment field" >&2
53+
exit 1
54+
fi
55+
if [[ $(sed -n '/[^[:space:]]/ { p; q; }' "$control") != "Package: openshell" ]]; then
56+
echo "FAIL: Debian control template must begin with the Package field" >&2
57+
exit 1
58+
fi
59+
4660
assert_contains \
4761
"$service" \
4862
'Environment=OPENSHELL_LOCAL_TLS_DIR=%h/.local/state/openshell/tls'

0 commit comments

Comments
 (0)