[kteam-tools,v2,1/7] git-build-kernel: extract the correct source package name

Message ID 1533249635-9483-2-git-send-email-kamal@canonical.com
State New
Headers show
Series
  • git-build-kernel: source pkg features
Related show

Commit Message

Kamal Mostafa Aug. 2, 2018, 10:40 p.m.
And use it to find the correct .orig tarball when building source packages.

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

Patch

diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index df95e12..44e38c8 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -80,6 +80,7 @@  DISTRO=$(
     do [ "$DISTRO" != "UNRELEASED" ] && { echo $DISTRO; break; }
     done
     )
+SRCPKG=$(git show $GITBRANCH:$DEBIAN/changelog | sed 's/^\(.*\) (.*/\1/;q')
 CHROOT="$DISTRO"
 CHROOT="${CHROOT%-proposed}"
 if [ "$CHROOT" = "UNRELEASED" -o -z "$CHROOT" ]
@@ -116,7 +117,7 @@  touch "$WORKDIR/building"
 trap "rm -rf $WORKDIR/building $BUILDDIR" 0
 
 [ $do_source_pkg = 1 ] && {
-    orig_tarball="linux_${VERSION%%-*}.orig.tar.gz"
+    orig_tarball="${SRCPKG}_${VERSION%%-*}.orig.tar.gz"
     # Careful: $ORIG_TARBALLS_DIR must be accessible from within the chroot.
     # (Alternately, use "cp -p" instead of "ln -s" if that's not an option)
     ln -s $ORIG_TARBALLS_DIR/$orig_tarball $WORKDIR/