[csw-devel] Fwd: Problem with GIT patching when WORKSRC != WORKDIR/DISTNAME

Dagobert Michelsen dam at opencsw.org
Mon Mar 21 19:56:34 CET 2011


Hi Ben,

Am 19.03.2011 um 04:18 schrieb Ben Walton:
> The attached patch fixes your issue and should be, I think compatible
> with existing build recipes.  I'm putting the patch out for review
> before committing it though in case anyone spots something that may
> break a recipe they've worked on.
> 
> For reference, Dago's recipe set both WORKSRC
> ($(WORKDIR)/$(NAME)-$(VERSION)/build_unix) and PATCHDIR
> ($(WORKSRC)/..).  The GARPATCH command is defined to use -d$(PATCHDIR)
> and the git patch code was doing cd $(WORKSRC) prior to git init, git
> apply, etc.  In the case of the 'old style' patches, this results in
> trying to apply the patch with a working directory one level above
> where git created it's .git directory.  The patch applies fine, but
> the subsequent git commit fails.
> 
> PATCHDIR is likely a good choice for use in the git commands anyway
> and in normal recipes, it defaults to WORKSRC.
> 
> Anyone see issues with the attached patch?

Looks pretty good, but I would like to add one remark: the PATCHDIR
should default to the same as WORKSRC:
  WORKSRC ?= $(WORKDIR)/$(DISTNAME)
  PATCHDIR ?= $(WORKDIR)/$(DISTNAME)
instead of
  PATCHDIR ?= $(WORKSRC)

That way WORKSRC can safely be modified without disturbing PATCHDIR
and still depending on DISTNAME.

IMHO the patch can be applied.


Best regards

  -- Dago


More information about the devel mailing list