From patchwork Tue May 9 16:36:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 760231 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3wMlPS1B8yz9ryQ; Wed, 10 May 2017 02:36:28 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1d887Y-00015Y-Mi; Tue, 09 May 2017 16:36:20 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d887T-00014l-SP for kernel-team@lists.ubuntu.com; Tue, 09 May 2017 16:36:15 +0000 Received: from 1.general.kamal.us.vpn ([10.172.68.52] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1d887T-0007dT-EE for kernel-team@lists.ubuntu.com; Tue, 09 May 2017 16:36:15 +0000 Received: from kamal by fourier with local (Exim 4.86_2) (envelope-from ) id 1d887R-0006QO-8U for kernel-team@lists.ubuntu.com; Tue, 09 May 2017 09:36:13 -0700 From: Kamal Mostafa To: kernel-team@lists.ubuntu.com Subject: [PATCH v2][kteam-tools] git-build-kernel: fix series selection for UNRELEASED custom kernels Date: Tue, 9 May 2017 09:36:12 -0700 Message-Id: <1494347772-24658-1-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com 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 --- git-build-kernel/git-build-kernel | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel index c0481d4..df95e12 100755 --- a/git-build-kernel/git-build-kernel +++ b/git-build-kernel/git-build-kernel @@ -75,8 +75,11 @@ eval `git show $GITBRANCH:debian/debian.env | grep DEBIAN=` ### Extract the distro target (e.g. "raring-proposed") from ### 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 $GITBRANCH:$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" ] @@ -97,6 +100,7 @@ else fi ### Get the version number - we need it to locate the orig tarball +chg="`git show $GITBRANCH:$DEBIAN/changelog | head -1`" VERSION=`echo "$chg" | sed -n -e '1s/^.*(\([^)]*\)).*$/\1/p'`