[kteam-tools][PATCH 4/4] git-build-kernel: debuild source packages with suitable -vversion

Kleber Souza kleber.souza at canonical.com
Wed Aug 1 16:03:25 UTC 2018


On 07/19/18 21:50, Kamal Mostafa wrote:
> 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"

There's a catch here with the backport packages. When the
update-from-*-master script is run, it syncs the changelog of the
backport tree with the master tree and adds the
"~<target-series>.<build-number>" prefix to the current version number.
That means we end up losing the previous  backported versions on the
changelog. So when using the output from rmadision with backport
packages, dpkg-genchanges will add more entries than we really want.

The fix would be to remove everything that comes after "~" with
something like:

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
> 





More information about the kernel-team mailing list