diff mbox series

[kteam-tools] git-build-kernel: do not expect orig tarball for debian "native" packages

Message ID 1533669743-30477-1-git-send-email-kamal@canonical.com
State New
Headers show
Series [kteam-tools] git-build-kernel: do not expect orig tarball for debian "native" packages | expand

Commit Message

Kamal Mostafa Aug. 7, 2018, 7:22 p.m. UTC
Determine whether or not to expect an orig tarball based on the file
debian/source/format, as follows:

  - if the file does not exist:  NO orig tarball
  - if the file contains "native" e.g. "3.0 (native)":  NO orig tarball
  - otherwise:  YES orig tarball

This eliminates the need for name-based special cases for -meta and -signed
and allows for the construction of main kernel source packages when an
orig tarball has not (yet) been published.

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

Comments

Andy Whitcroft Aug. 10, 2018, 3:59 p.m. UTC | #1
On Tue, Aug 07, 2018 at 12:22:23PM -0700, Kamal Mostafa wrote:
> Determine whether or not to expect an orig tarball based on the file
> debian/source/format, as follows:
> 
>   - if the file does not exist:  NO orig tarball
>   - if the file contains "native" e.g. "3.0 (native)":  NO orig tarball
>   - otherwise:  YES orig tarball
> 
> This eliminates the need for name-based special cases for -meta and -signed
> and allows for the construction of main kernel source packages when an
> orig tarball has not (yet) been published.
> 
> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---
>  git-build-kernel/git-build-kernel | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
> index ad6c3c5..831c0af 100755
> --- a/git-build-kernel/git-build-kernel
> +++ b/git-build-kernel/git-build-kernel
> @@ -142,11 +142,10 @@ touch "$WORKDIR/building"
>  trap "rm -rf $WORKDIR/building $BUILDDIR" 0
>  
>  [ $do_source_pkg = 1 ] && {
> -    ### Special case for linux-signed and linux-meta packages, which
> -    ### have no .orig tarball
> -    [ ${SRCPKG/-signed} != $SRCPKG ] && no_orig_tarball=1
> -    [ ${SRCPKG/-meta} != $SRCPKG ] && no_orig_tarball=1
> -    if [ "$no_orig_tarball" = 1 ]
> +    deb_format="$(git show $GITBRANCH:debian/source/format 2>/dev/null)"
> +    [ -z "$deb_format" ] && no_orig_tarball=1
> +    [ "${deb_format/native/}" != "$deb_format" ] && no_orig_tarball=1
> +    if [ "$no_orig_tarball" == 1 ]
>      then
>  	srcpkg_debopts="--no-tgz-check $srcpkg_debopts"
>      else

Much nicer.  No idea if the huristic is completely correct but
this will cover the the cases which I expect to hit in the field.
Well other than the time when don't have an orig tarball in devel
for linux.  There I think we will have to train those guys to
flip the version to 3.0 (native) for that period.  Regardless that
problem exists before this change:

Acked-by: Andy Whitcroft <apw@canonical.com>

-apw
Khalid Elmously Aug. 10, 2018, 5:37 p.m. UTC | #2
On 2018-08-07 12:22:23 , Kamal Mostafa wrote:
> Determine whether or not to expect an orig tarball based on the file
> debian/source/format, as follows:
> 
>   - if the file does not exist:  NO orig tarball
>   - if the file contains "native" e.g. "3.0 (native)":  NO orig tarball
>   - otherwise:  YES orig tarball
> 
> This eliminates the need for name-based special cases for -meta and -signed
> and allows for the construction of main kernel source packages when an
> orig tarball has not (yet) been published.
> 
> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---
>  git-build-kernel/git-build-kernel | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
> index ad6c3c5..831c0af 100755
> --- a/git-build-kernel/git-build-kernel
> +++ b/git-build-kernel/git-build-kernel
> @@ -142,11 +142,10 @@ touch "$WORKDIR/building"
>  trap "rm -rf $WORKDIR/building $BUILDDIR" 0
>  
>  [ $do_source_pkg = 1 ] && {
> -    ### Special case for linux-signed and linux-meta packages, which
> -    ### have no .orig tarball
> -    [ ${SRCPKG/-signed} != $SRCPKG ] && no_orig_tarball=1
> -    [ ${SRCPKG/-meta} != $SRCPKG ] && no_orig_tarball=1
> -    if [ "$no_orig_tarball" = 1 ]
> +    deb_format="$(git show $GITBRANCH:debian/source/format 2>/dev/null)"
> +    [ -z "$deb_format" ] && no_orig_tarball=1
> +    [ "${deb_format/native/}" != "$deb_format" ] && no_orig_tarball=1
> +    if [ "$no_orig_tarball" == 1 ]
>      then
>  	srcpkg_debopts="--no-tgz-check $srcpkg_debopts"
>      else

Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Kamal Mostafa Aug. 10, 2018, 5:41 p.m. UTC | #3
On Tue, Aug 07, 2018 at 12:22:23PM -0700, Kamal Mostafa wrote:
> Determine whether or not to expect an orig tarball based on the file
> debian/source/format, as follows:
> 
>   - if the file does not exist:  NO orig tarball
>   - if the file contains "native" e.g. "3.0 (native)":  NO orig tarball
>   - otherwise:  YES orig tarball
> 
> This eliminates the need for name-based special cases for -meta and -signed
> and allows for the construction of main kernel source packages when an
> orig tarball has not (yet) been published.
> 
> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---
>  git-build-kernel/git-build-kernel | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
> index ad6c3c5..831c0af 100755
> --- a/git-build-kernel/git-build-kernel
> +++ b/git-build-kernel/git-build-kernel
> @@ -142,11 +142,10 @@ touch "$WORKDIR/building"
>  trap "rm -rf $WORKDIR/building $BUILDDIR" 0
>  
>  [ $do_source_pkg = 1 ] && {
> -    ### Special case for linux-signed and linux-meta packages, which
> -    ### have no .orig tarball
> -    [ ${SRCPKG/-signed} != $SRCPKG ] && no_orig_tarball=1
> -    [ ${SRCPKG/-meta} != $SRCPKG ] && no_orig_tarball=1
> -    if [ "$no_orig_tarball" = 1 ]
> +    deb_format="$(git show $GITBRANCH:debian/source/format 2>/dev/null)"
> +    [ -z "$deb_format" ] && no_orig_tarball=1
> +    [ "${deb_format/native/}" != "$deb_format" ] && no_orig_tarball=1
> +    if [ "$no_orig_tarball" == 1 ]
>      then
>  	srcpkg_debopts="--no-tgz-check $srcpkg_debopts"
>      else
> -- 
> 2.7.4
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff mbox series

Patch

diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index ad6c3c5..831c0af 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -142,11 +142,10 @@  touch "$WORKDIR/building"
 trap "rm -rf $WORKDIR/building $BUILDDIR" 0
 
 [ $do_source_pkg = 1 ] && {
-    ### Special case for linux-signed and linux-meta packages, which
-    ### have no .orig tarball
-    [ ${SRCPKG/-signed} != $SRCPKG ] && no_orig_tarball=1
-    [ ${SRCPKG/-meta} != $SRCPKG ] && no_orig_tarball=1
-    if [ "$no_orig_tarball" = 1 ]
+    deb_format="$(git show $GITBRANCH:debian/source/format 2>/dev/null)"
+    [ -z "$deb_format" ] && no_orig_tarball=1
+    [ "${deb_format/native/}" != "$deb_format" ] && no_orig_tarball=1
+    if [ "$no_orig_tarball" == 1 ]
     then
 	srcpkg_debopts="--no-tgz-check $srcpkg_debopts"
     else