On Sun, Aug 09, 2009 at 06:04:34PM +0200, Raphael Hertzog wrote: > retitle 485330 Allow context diff in debian/patches/ in 3.0 (quilt) format > thanks > > On Thu, 06 Aug 2009, Pierre Habouzit wrote: > > That said, yes, using non-unified diff is as laughable as using RCS or > > SCCS nowadays. Though I consider it a bug if dpkg refuses to apply a > > patch that patch(1) (that it uses in the end) would apply fine. I shall > > say that I absolutely don't get why there even is an "analyze()" routine > > in Patch.pm, > > analyze() extracts information from the patch in order to: > - create directories that do not exist yet (patch will not do that for > you AFAIK or at least that's the assumption that the current codebase > made, it might have changed since this part of the code has been written)
According to the man page, and to tests I did, it does > - have a listing of all modified files in order to harmonize their > timestamp afterwards (required to avoid unwanted rebuilding when > patching auto-generated files and their source file) Can't you get that using lsdiff from patchutils ? > Extracting those information require to parse the patch files, so why not > error out when the parser finds something not allowed? With that we clearly agree ;) > So while I have no opposition to allowing patches in context format (and > not other non-contextual ones), the fix is most likely not the short one > proposed by Charles. It's not. > Instead the Dpkg::Source::Patch object should have full support of the > context format at least in the analyze() part. Or you may use lsdiff. > > if you want that, let patch(1) do it using its --dry-run > > mode. It'll report failed hunk and bad syntax the same way. > > You'll be surprised how much permissive patch actually is. IIRC missing > context > in unidiff is not always fatal for example (even when the numbers on the > @@ lines stipulate that there should be more lines than what there is). Sure, but there are some tools to verify how clean a patch is, but yeah, you're probably right on that. -- Intersec <http://www.intersec.com> Pierre Habouzit <pierre.habou...@intersec.com> Tél : +33 (0)1 5570 3346 Mob : +33 (0)6 1636 8131 Fax : +33 (0)1 5570 3332 37 Rue Pierre Lhomme 92400 Courbevoie
signature.asc
Description: Digital signature