diff mbox

[kteam-tools] git-build-kernel: fix series selection for UNRELEASED custom kernels

Message ID 1494275787-5612-1-git-send-email-kamal@canonical.com
State New
Headers show

Commit Message

Kamal Mostafa May 8, 2017, 8:36 p.m. UTC
G-b-k determines the target series and build chroot by examining the
topmost changelog entry -- but if that is in the "UNRELEASED" state,
it falls back to examining the git repo itself (e.g. xenial.git).

This scheme is insufficient for the custom kernels that we've recently
moved to arbitrary repo.git names e.g. linux-something.git -- they can't
figure out their target series when they are the "UNRELEASED" state.

Now, g-b-k will also examine the second changelog entry, if the first is
in the "UNRELEASED" state.

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

Comments

Kamal Mostafa May 9, 2017, 3:29 p.m. UTC | #1
Ooops, there's a bug in this patch.  [v2] on the way.

 -Kamal
diff mbox

Patch

diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index c0481d4..781c41b 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -76,7 +76,12 @@  eval `git show $GITBRANCH:debian/debian.env | grep DEBIAN=`
 ### debian.master/changelog, and use it as the basis of the chroot.
 ### If it isn't useful, try to use the git repo directory name.
 chg="`git show $GITBRANCH:$DEBIAN/changelog | head -1`"
-DISTRO=`echo "$chg" | sed -n -e '1s/^.* \(.*\);.*$/\1/p'`
+
+DISTRO=$(
+    git show :$DEBIAN/changelog | grep '^[a-z]' | head -2 | sed -n -e 's/^.* \(.*\);.*$/\1/p'  | while read DISTRO
+    do [ "$DISTRO" != "UNRELEASED" ] && { echo $DISTRO; break; }
+    done
+    )
 CHROOT="$DISTRO"
 CHROOT="${CHROOT%-proposed}"
 if [ "$CHROOT" = "UNRELEASED" -o -z "$CHROOT" ]