[kteam-tools,v2,3/7] git-build-kernel: support SOURCE_PACKAGE_CHROOT=series via debian.env

Message ID 1533249635-9483-4-git-send-email-kamal@canonical.com
State New
Headers show
Series
  • Untitled series #59083
Related show

Commit Message

Kamal Mostafa Aug. 2, 2018, 10:40 p.m.
When building a source package via the "git push commit-ish:source"
method...

If debian/debian.env contains a "SOURCE_PACKAGE_CHROOT=series" line
(where series is a distro series like 'xenial') then git-build-kernel
will build the source package in a chroot of that specified series.

If no SOURCE_PACKAGE_CHROOT line exists, then git-build-kernel will use
a chroot of the series indicated by debian/changelog.

The SOURCE_PACKAGE_CHROOT feature applies only to *source* package
builds; binary packages are always built in a chroot of the series
indicated by debian/changelog.

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 git-build-kernel/git-build-kernel | 4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index 6dd0792..cfad062 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -83,6 +83,10 @@  DISTRO=$(
 SRCPKG=$(git show $GITBRANCH:$DEBIAN/changelog | sed 's/^\(.*\) (.*/\1/;q')
 CHROOT="$DISTRO"
 CHROOT="${CHROOT%-proposed}"
+[ $do_source_pkg = 1 ] && {
+    eval `git show $GITBRANCH:debian/debian.env | grep SOURCE_PACKAGE_CHROOT=`
+    [ -z "$SOURCE_PACKAGE_CHROOT" ] || CHROOT="$SOURCE_PACKAGE_CHROOT"
+}
 if [ "$CHROOT" = "UNRELEASED" -o -z "$CHROOT" ]
 then
     GITREPOBASE="${GITREPO%/*}"	# e.g. /home/kamal/src/linux