Skip to content

Commit 85e73ae

Browse files
author
HiFiBerry
committed
usbaudio: mark as deliberately unpublished
It is work in progress, built so it does not rot but kept out of the package repository on purpose. check-release.py reported it on every run, and a check that always shows the same known finding is one people stop reading. A package declares this with a .unpublished file next to its build.sh saying why. The marker sits with the package rather than in a list inside the script, so deleting the package takes the exemption with it - the central PRIVATE_SUBMODULES list outlived what it described and had to be removed for exactly that reason. load_sibling now degrades instead of raising when check-packages.py is not next to it, which is what a copy of the script elsewhere used to do.
1 parent 512fd08 commit 85e73ae

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

packages/usbaudio/.unpublished

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Work in progress. Built here so it does not rot, but deliberately kept out of
2+
the package repository - `apt install hifiberry-usbaudio` is expected to fail.
3+
4+
Remove this file when it should ship; check-release.py will then start
5+
reporting the package as built but not published until it is.

scripts/check-release.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ def load_sibling(name: str, filename: str):
4545
if spec is None or spec.loader is None:
4646
return None
4747
module = importlib.util.module_from_spec(spec)
48-
spec.loader.exec_module(module)
48+
try:
49+
spec.loader.exec_module(module)
50+
except OSError:
51+
# Copied somewhere without its sibling. Losing the clone-target map
52+
# only means sources are looked for in the default places, which beats
53+
# a traceback.
54+
return None
4955
return module
5056

5157

@@ -151,6 +157,13 @@ def main() -> int:
151157
source_version = history[0] if history else "-"
152158
names = binary_names(src) if src else []
153159

160+
# A package can declare that it is deliberately not published, by
161+
# dropping a .unpublished file next to its build.sh saying why. The
162+
# marker lives with the package rather than in a list in here, so that
163+
# removing the package removes the exemption with it - a central list
164+
# outlives what it describes and starts lying.
165+
unpublished_on_purpose = os.path.isfile(os.path.join(pkgdir, pkg, ".unpublished"))
166+
154167
built: Dict[str, str] = {}
155168
for deb in glob.glob(os.path.join(pkgdir, pkg, "*.deb")):
156169
parsed = deb_version(deb)
@@ -163,8 +176,11 @@ def main() -> int:
163176
p = max(available, key=cmp_to_key(compare)) if available else "-"
164177
note = ""
165178
if b != "-" and p == "-":
166-
note = "built but never published"
167-
findings.append(f"{name}: built {b} is not in the repository")
179+
if unpublished_on_purpose:
180+
note = "unpublished on purpose"
181+
else:
182+
note = "built but never published"
183+
findings.append(f"{name}: built {b} is not in the repository")
168184
elif b != "-" and p != "-" and compare(b, p) > 0:
169185
note = "built newer than published"
170186
findings.append(f"{name}: built {b}, published {p}")

0 commit comments

Comments
 (0)