On Mon, 4 Jun 2012, Jonathan Nieder wrote:

> Santiago Vila wrote:
> 
> > You are right, I had not tried that. The second dpkg-buildpackage
> > would indeed realize that the patches are not applied and it would
> > apply them.
> >
> > However, what I was trying over and over again was this:
> >
> > dpkg-buildpackage
> > debian/rules clean
> > dpkg-buildpackage
> 
> Thanks again for explaining, and sorry for the ramble.  I think this
> is a duplicate of one of the two following bugs:
> 
>  #643043 dpkg-buildpackage: --no-unapply-patches to keep patches applied
>  #649531 dpkg-buildpackage -T: manpage should explain need to run
>          "dpkg-source --before-build" first
> 
> Do you agree?

They are basically the same, yes. Unfortunately, none of the previous
submitters seem to have succeeded at convincing you the maintainers
that this default behaviour is suboptimal and inconsistent. So, I wish
this report not to be considered "just a duplicate".

Quote from #643043:

  [The current behaviour] causes a problem where the clean rules of the
  upstream makefile have been patched to ensure that the clean works.

This is exactly my claim, but in that bug it's suggested to use -tc
and the following objection is not addressed:

  Well -tc option certainly works and will sometimes be what I want. What
  however happens when I want to inspect the debian/<package> directories?


Bug #649531 is also very similar. The submitter says "it just wastes
my time", which is exactly the feeling I have.

In fact, I fully agree with this from such report:

  For that reason I believe if dpkg-source wants to unapply patches,
  `debian/rules clean' should be run before. But in such a case it
  shouldn't automatically unapply anything.

This matches completely my idea that the states of a package are in a
stack: If the patches have to be unapplied at all, it should only be done
after a clean.

I'll try to reply to your earlier message:

> As far as I can tell, most people starting from the patches-unapplied
> state keep that form in version control.  If the build does not
> involve modifying any source files (the usual case), they can use
> usual commands like "vcs diff" and "vcs commit" when done --- that is,
> dpkg-buildpackage returns the package to a normal state.
> 
> If dpkg left patches applied, we would get complaints that, after
> running "debian/rules clean" by hand, the source tree is not clean and
> ready to be committed.

Hmm, why do you say that the usual case does not involve modifying
any source files?

Creating new patches in debian/patches is one of the maintainer's tasks.
If the patches are unapplied after a build, this task becomes a lot more
complex than it should be.

Even in Bug #649531 you say this:

  In dpkg's source format v3, the patched source is considered
  to be standard "unpacked" form.  So if you run

        dpkg-source -x foo.dsc
        cd foo-*
        dpkg-buildpackage; # just builds the package

  then patches will be applied in the first step and never unapplied.


So, consider the following flow:

(A) ===> (B) ===> (C)
                   |
                  (D)


I want to reach C, which is "package with patches applied and built".
If my starting point is B, "package with patches applied and not built",
dpkg-buildpackage just builds the package and does not do anything else.

If my starting point is A, "package with patches unapplied and not built",
dpkg-buildpackage is right to think "package is not in standard form
let's move from (A) to (B)".

However, I still want to reach (C), not a dead end state like (D).

It's nice from dpkg-buildpackage that it moves from (A) to (B) automatically,
but this move is really unsupported and useless if it *also* moves
from (C) to (D) after the build.

Because move from (A) to (B) is not properly supported, for the
purposes of not making a lot of people to waste a lot of time (which
is what happened to me), I would have preferred that dpkg-buildpackage
just stops with an error if I try to invoke it with pacthes unapplied.

But of course it would be a pity to remove a useful feature, and I
still think that it would be much better to keep the patches applied
after a build, as that's what we consider the "canonical form" in dpkg v3.

Thanks.



-- 
To UNSUBSCRIBE, email to debian-dpkg-bugs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to