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

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



Guillem Jover:
> 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.

After the refatoring, the code read:

  if (deb_format.major == 0) {
    gzfd = arfd;
  } else {
    gzfd = setup_temp_gz(_("data member"));
  }
  create_data_tar(dir, gzfd);
  if (deb_format.major == 2) {
    write_data_tar(debar, arfd, gzfd);
  }

With such control flow, what happens when deb_format.major neither 0
nor 2? I understand the gzfd is opened as a temporary file, but then
never written to the .deb.

> 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?

If that fixes the previously described behaviour, it's all good. :)

-- 
Lunar                                .''`. 
lunar@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   

Attachment: signature.asc
Description: Digital signature


Reply to: