[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH 2/3] Consistently handle major deb format in do_build()



Hi!

On Tue, 2013-08-27 at 18:27:46 +0200, Jérémy Bobbio wrote:
> The only case when we can avoid writing the compressed data.tar is
> when the compressed information is appended directly (format 0).
> Let's just be more clear about it.
> 
> ---
>  dpkg-deb/build.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
> index 703136a..41d14dc 100644
> --- a/dpkg-deb/build.c
> +++ b/dpkg-deb/build.c
> @@ -672,7 +672,7 @@ do_build(const char *const *argv)
>    }
>    create_data_tar(dir, gzfd);
>    /* Okay, we have data.tar as well now, add it to the ar wrapper. */
> -  if (deb_format.major == 2) {
> +  if (deb_format.major != 0) {
>      write_data_tar(debar, arfd, gzfd);
>    }
>    if (fsync(arfd))

I've not applied thie one, because the format that requires that call
is 2.x not 0.x, it assumes possible future formats might need that
same call which is less maintenable and I don't find switching the
check more clear.

What I've done instead is make the other format 2 code branches check
for the major == 2 so that it should be more clear, and I'm guessing
that's what might have confused you?

Thanks,
Guillem


Reply to: