diff mbox series

[kteam-tools,6/6] git-build-kernel: special case no .orig tarball for "-signed" src packages

Message ID 1533067677-22831-2-git-send-email-kamal@canonical.com
State New
Headers show
Series git-build-kernel: source pkg features | expand

Commit Message

Kamal Mostafa July 31, 2018, 8:07 p.m. UTC
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 git-build-kernel/git-build-kernel | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

Comments

Kleber Sacilotto de Souza Aug. 1, 2018, 5:41 p.m. UTC | #1
On 07/31/18 22:07, Kamal Mostafa wrote:
> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---
>  git-build-kernel/git-build-kernel | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
> index 5b17c48..62d2714 100755
> --- a/git-build-kernel/git-build-kernel
> +++ b/git-build-kernel/git-build-kernel
> @@ -130,10 +130,16 @@ touch "$WORKDIR/building"
>  trap "rm -rf $WORKDIR/building $BUILDDIR" 0
>  
>  [ $do_source_pkg = 1 ] && {
> -    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/
> +    ### HACK Special case for linux-signed, which has no .orig tarball

The meta packages don't have .orig tarball as well.

> +    if [ ${SRCPKG/-signed} != $SRCPKG ]
> +    then
> +	srcpkg_debopts="--no-tgz-check $srcpkg_debopts"
> +    else
> +	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/
> +    fi
>  }
>  
>  ###
> @@ -194,7 +200,7 @@ show_elapsed &
>  			fakeroot debian/rules clean
>  			if [ $do_source_pkg = 1 ]
>  			then
> -			    debuild -S -I -i -uc -us $srcpkg_debopts
> +			    debuild $srcpkg_debopts -S -I -i -uc -us
>  			else
>  			    debian/rules build
>  			    fakeroot debian/rules $TARGETS
>
Kamal Mostafa Aug. 1, 2018, 5:48 p.m. UTC | #2
On Wed, Aug 01, 2018 at 07:41:32PM +0200, Kleber Souza wrote:
> On 07/31/18 22:07, Kamal Mostafa wrote:
> > Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> > ---
> >  git-build-kernel/git-build-kernel | 16 +++++++++++-----
> >  1 file changed, 11 insertions(+), 5 deletions(-)
> > 
> > diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
> > index 5b17c48..62d2714 100755
> > --- a/git-build-kernel/git-build-kernel
> > +++ b/git-build-kernel/git-build-kernel
> > @@ -130,10 +130,16 @@ touch "$WORKDIR/building"
> >  trap "rm -rf $WORKDIR/building $BUILDDIR" 0
> >  
> >  [ $do_source_pkg = 1 ] && {
> > -    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/
> > +    ### HACK Special case for linux-signed, which has no .orig tarball
> 
> The meta packages don't have .orig tarball as well.

Ah yes, agreed.  The meta packages actually get built properly anyway,
despite not being special-cased here, because their x.y.z.a.b version
number implies a Debian-native package . . . So debuild doesn't end up
looking for any .orig tarball for meta packages, regardless.  But its
wrong that g-b-k tries to setup the symlink to the non-existent tarball
in any case.  I'll fix in in a [v2] of this patch set.

Thanks!

 -Kamal

> 
> > +    if [ ${SRCPKG/-signed} != $SRCPKG ]
> > +    then
> > +	srcpkg_debopts="--no-tgz-check $srcpkg_debopts"
> > +    else
> > +	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/
> > +    fi
> >  }
> >  
> >  ###
> > @@ -194,7 +200,7 @@ show_elapsed &
> >  			fakeroot debian/rules clean
> >  			if [ $do_source_pkg = 1 ]
> >  			then
> > -			    debuild -S -I -i -uc -us $srcpkg_debopts
> > +			    debuild $srcpkg_debopts -S -I -i -uc -us
> >  			else
> >  			    debian/rules build
> >  			    fakeroot debian/rules $TARGETS
> > 
>
diff mbox series

Patch

diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index 5b17c48..62d2714 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -130,10 +130,16 @@  touch "$WORKDIR/building"
 trap "rm -rf $WORKDIR/building $BUILDDIR" 0
 
 [ $do_source_pkg = 1 ] && {
-    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/
+    ### HACK Special case for linux-signed, which has no .orig tarball
+    if [ ${SRCPKG/-signed} != $SRCPKG ]
+    then
+	srcpkg_debopts="--no-tgz-check $srcpkg_debopts"
+    else
+	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/
+    fi
 }
 
 ###
@@ -194,7 +200,7 @@  show_elapsed &
 			fakeroot debian/rules clean
 			if [ $do_source_pkg = 1 ]
 			then
-			    debuild -S -I -i -uc -us $srcpkg_debopts
+			    debuild $srcpkg_debopts -S -I -i -uc -us
 			else
 			    debian/rules build
 			    fakeroot debian/rules $TARGETS