[Build-common-hackers] Bug#281982: simple-patchsys.mk: should unapply successful patches when another one fails

Josselin Mouette Josselin Mouette <joss@debian.org>, 281982@bugs.debian.org
Fri, 19 Nov 2004 00:18:43 +0100


Package: cdbs
Version: 0.4.25-1
Severity: normal

A scenario I encounter quite often:

Say package foo has a few patches in debian/patches. I'm updating the
package to a new upstream version, and launching the compilation.
patch1.patch applies fine, same for patch2.patch. Then patch3.patch
doesn't apply cleanly, and the build stops. Fine, that's why I expect.

Then I fix patch3.patch, launch the build again, and... it fails again.
Why? Simply because in this case, the clean target doesn't unapply
patch1.patch and patch2.patch. This very annoying, as they now appear in
the .diff.gz, and furthermore they don't apply cleanly. The only thing
to do then is to clean the build tree by hand. The worst scenario is
when a patch can be applied twice, using a fuzz. You then get a broken
package without even noticing it.

It seems that simple-patchsys unapplies all the patches at once, when
stamp-patched is found. A better behavior would be to set a stamp for
each patch, unapplying all patches that were applied successfully.

Regards,
-- 
 .''`.           Josselin Mouette        /\./\
: :' :           josselin.mouette@ens-lyon.org
`. `'                        joss@debian.org
  `-  Debian GNU/Linux -- The power of freedom