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

Ben Walton bwalton at opencsw.org
Sat Mar 19 04:18:07 CET 2011


Hi Dago,

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?

Thanks
-Ben

--- Begin forwarded message from Dagobert Michelsen ---

I noticed that GIT patching does not work when $WORKSRC != $WORKDIR/$DISTNAME:

> [===== NOW BUILDING: db-3.3.11 MODULATION isa-sparcv8: ISA=sparcv8 =====]
>  ==> Extracting work/solaris9-sparc/download/db-3.3.11.tar.gz
>  ==> Snapshotting extracted source tree with git
> Initialized empty Git repository in /home/dam/mgar/pkg/bdb3/trunk/work/solaris9-sparc/build-isa-sparcv8/db-3.3.11/build_unix/.git/
> [master (root-commit) c62b7da] Upstream 3.3.11
>  2 files changed, 4 insertions(+), 0 deletions(-)
>  create mode 100644 .IGNORE_ME
>  create mode 120000 tags
> Switched to a new branch 'csw'
>         [extract-modulated] complete for db.
>  ==> Applying patch work/solaris9-sparc/download/patch.3.3.11.2
> Adding old-style patch...
> patching file build_vxworks/db.h
> Hunk #1 succeeded at 21 (offset -11 lines).
> # On branch csw
> nothing to commit (working directory clean)
> gmake[1]: *** [normal-patch-patch.3.3.11.2] Error 1
> gmake[1]: Leaving directory `/home/dam/mgar/pkg/bdb3/trunk'
> gmake: *** [merge-isa-sparcv8] Error 2
> current9s% 
> current9s% 

This is important as WORKSRC is meant to be the directory with the configuration stuff
in there. I don't have a smart idea on how to fix this. Maybe GIT patching should start
at WORKDIR/PATCHDIR which defaults to DISTNAME and which is resettable...


Best regards

  -- Dago
--- End forwarded message ---
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gitpatch.diff
Type: application/octet-stream
Size: 2879 bytes
Desc: not available
URL: <http://lists.opencsw.org/pipermail/devel/attachments/20110318/0789e4fb/attachment-0001.obj>


More information about the devel mailing list