UBUNTU: [Packaging] Add debian/control sanity check
BugLink: https://bugs.launchpad.net.bugs/2043994 Only the main linux source packages should produce linux-source-PKGVER binary packages. Add a simple check that fails if debian/control looks fishy. Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
This commit is contained in:
committed by
Paolo Pisati
parent
bb79fba482
commit
8482350050
Vendored
+1
@@ -213,6 +213,7 @@ $(DEBIAN)/control.stub: \
|
||||
.PHONY: debian/control
|
||||
debian/control: $(DEBIAN)/control.stub
|
||||
cp $(DEBIAN)/control.stub debian/control
|
||||
debian/scripts/checks/control-check
|
||||
|
||||
debian/canonical-certs.pem: $(wildcard $(DROOT)/certs/*-all.pem) $(wildcard $(DROOT)/certs/*-$(arch).pem) $(wildcard $(DEBIAN)/certs/*-all.pem) $(wildcard $(DEBIAN)/certs/*-$(arch).pem)
|
||||
for cert in $(sort $(notdir $^)); \
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash -eu
|
||||
#
|
||||
# debian/control sanity checks
|
||||
#
|
||||
|
||||
echo "II: Checking debian/control"
|
||||
|
||||
. debian/debian.env
|
||||
|
||||
source_name=$(dpkg-parsechangelog -l"${DEBIAN}"/changelog -SSource)
|
||||
linux_source=$(grep -P '^Package:\s*linux.*-source-\d+\.\d+\.\d+' debian/control | sed 's/^Package:\s*//')
|
||||
|
||||
case "${source_name}___${linux_source}" in
|
||||
linux___linux-source-*)
|
||||
# Main kernel package produces linux-source
|
||||
true
|
||||
;;
|
||||
linux-*___)
|
||||
# Non-main kernel package must *not* produce linux-source
|
||||
true
|
||||
;;
|
||||
*)
|
||||
# All other combinations are packaging mistakes
|
||||
if [ -n "${linux_source}" ] ; then
|
||||
echo "EE: debian/control contains invalid package stanza:" >&2
|
||||
echo "Package: ${linux_source}" >&2
|
||||
else
|
||||
echo "EE: debian/control is missing package stanza:" >&2
|
||||
echo "Package: linux-source-PKGVER" >&2
|
||||
fi
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "II: Done"
|
||||
exit 0
|
||||
Reference in New Issue
Block a user