[disco/master-next 6/9] UBUNTU: [Packaging] dkms-build -- add support for unversioned overrides
Andy Whitcroft
apw at canonical.com
Tue Mar 12 15:57:16 UTC 2019
We allow package specific overrides for dkms-build. However some
packages have versions in their names. To make these easier to handle
when the version changes add optional unversioned overrides. Where a
package ends with a -NNN version look for overrides in the full name
and with a (literal) -N suffix.
BugLink: http://bugs.launchpad.net/bugs/1764792
Signed-off-by: Andy Whitcroft <apw at canonical.com>
---
debian/scripts/dkms-build | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/debian/scripts/dkms-build b/debian/scripts/dkms-build
index 251761b54e4f..6457d3650506 100755
--- a/debian/scripts/dkms-build
+++ b/debian/scripts/dkms-build
@@ -163,9 +163,14 @@ done
# it the original source directory, destination package directory, the objects
# as squirreled away, and the log in case it is useful. Finally pass a formed
# signing command line in case we need to do that.
-dkms_build="$srcdir/$0--$package"
-if [ -e "$dkms_build" ]; then
- echo "II: dkms-build override $package found, executing"
+dkms_build_specific="$srcdir/$0--$package"
+dkms_build_generic=$(echo "$dkms_build_specific" | sed -e 's/-[0-9][0-9]*$/-N/')
+for dkms_build in "$dkms_build_specific" "$dkms_build_generic"
+do
+ if [ ! -e "$dkms_build" ]; then
+ continue
+ fi
+ echo "II: dkms-build override $(basename "$dkms_build") found, executing"
$SHELL "$dkms_build" \
"$srcdir" \
"$dkms_dir/build/$dkms_package/$dkms_version/objects" \
@@ -177,6 +182,7 @@ if [ -e "$dkms_build" ]; then
"$pkgdir" \
"$package" \
"$@" || exit 1
-fi
+ break
+done
echo "II: dkms-build build $package complete"
--
2.20.1
More information about the kernel-team
mailing list