[kteam-tools][PATCH 4/4] git-build-kernel: debuild source packages with suitable -vversion
Kamal Mostafa
kamal at canonical.com
Thu Jul 19 19:50:54 UTC 2018
Determine latest released package version in <series>-updates and supply
it to dpkg-genchanges via debuild -vversion.
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
git-build-kernel/git-build-kernel | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index cfad062..0d5414a 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -95,6 +95,15 @@ then
CHROOT="${CHROOT%.git}"
fi
+### Find the appropriate -v{version} value for dpkg-genchanges
+[ $do_source_pkg = 1 ] && {
+ updates_version=$(rmadison -s ${DISTRO}-updates $SRCPKG | grep 'source$' | awk '{print $3}')
+ if [ -n "$updates_version" ]
+ then srcpkg_debopts="-v$updates_version"
+ else echo "warning: cannot determine current release for ${DISTRO}-updates $SRCPKG"
+ fi
+}
+
### Compile amd64 and i386 in a native chroot.
### Cross-compile ARM in an amd64 chroot (for dramatically better performance).
if [ "$ARCH" = "amd64" -o "$ARCH" = "i386" ]
@@ -138,7 +147,12 @@ trap "rm -rf $WORKDIR/building $BUILDDIR" 0
echo "git-build-kernel"
echo " package: $SRCPKG ($VERSION) $DISTRO"
echo " targets: $TARGETS"
-echo " arch: $ARCH"
+if [ $do_source_pkg = 1 ]
+then
+ echo " changes-v: $updates_version"
+else
+ echo " arch: $ARCH"
+fi
echo " chroot: $CHROOT"
echo " starting build in $HOSTNAME:$WORKDIR ..."
@@ -180,7 +194,7 @@ show_elapsed &
fakeroot debian/rules clean
if [ $do_source_pkg = 1 ]
then
- debuild -S -I -i -uc -us
+ debuild -S -I -i -uc -us $srcpkg_debopts
else
debian/rules build
fakeroot debian/rules $TARGETS
--
2.7.4
More information about the kernel-team
mailing list