Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Denys Dmytriyenko <denis@denix.org>
To: openembedded-devel@lists.openembedded.org
Cc: Dale Farnsworth <dfarnsworth@mvista.com>
Subject: Re: [PATCH] patch.bbclass: Add "git" patchtool mechanism, which uses git-apply
Date: Wed, 19 Aug 2009 23:55:28 -0400	[thread overview]
Message-ID: <20090820035528.GE32010@denix.org> (raw)
In-Reply-To: <1250738680-20274-3-git-send-email-clarson@mvista.com>

On Wed, Aug 19, 2009 at 08:24:34PM -0700, Chris Larson wrote:
> From: Dale Farnsworth <dfarnsworth@mvista.com>
> 
> It can be selected by setting PATCHTOOL = "git".
> 
> This is useful because git-apply honors the permissions information
> produced by git-format-patch.
> 
> Signed-off-by: Dale Farnsworth <dfarnsworth@mvista.com>
> Signed-off-by: Chris Larson <clarson@mvista.com>

Acked-by: Denys Dmytriyenko <denis@denix.org>

Nice one, thanks!

> ---
>  classes/patch.bbclass |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)
> 
> diff --git a/classes/patch.bbclass b/classes/patch.bbclass
> index 2aa63c0..650d9c1 100644
> --- a/classes/patch.bbclass
> +++ b/classes/patch.bbclass
> @@ -189,6 +189,24 @@ def patch_init(d):
>  		def Clean(self):
>  			""""""
>  
> +	class GitApplyTree(PatchTree):
> +		def __init__(self, dir, d):
> +			PatchTree.__init__(self, dir, d)
> +
> +		def _applypatch(self, patch, force = False, reverse = False, run = True):
> +			shellcmd = ["git", "--git-dir=.", "apply", "-p%s" % patch['strippath']]
> +
> +			if reverse:
> +				shellcmd.append('-R')
> +
> +			shellcmd.append(patch['file'])
> +
> +			if not run:
> +				return "sh" + "-c" + " ".join(shellcmd)
> +
> +			return runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
> +
> +
>  	class QuiltTree(PatchSet):
>  		def _runcmd(self, args, run = True):
>  			quiltrc = bb.data.getVar('QUILTRCFILE', self.d, 1)
> @@ -424,6 +442,7 @@ def patch_init(d):
>  	g["PatchSet"] = PatchSet
>  	g["PatchTree"] = PatchTree
>  	g["QuiltTree"] = QuiltTree
> +	g["GitApplyTree"] = GitApplyTree
>  	g["Resolver"] = Resolver
>  	g["UserResolver"] = UserResolver
>  	g["NOOPResolver"] = NOOPResolver
> @@ -449,6 +468,7 @@ python patch_do_patch() {
>  	patchsetmap = {
>  		"patch": PatchTree,
>  		"quilt": QuiltTree,
> +		"git": GitApplyTree,
>  	}
>  
>  	cls = patchsetmap[bb.data.getVar('PATCHTOOL', d, 1) or 'quilt']
> -- 
> 1.6.0
> 
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



  parent reply	other threads:[~2009-08-20  4:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20  3:24 [PATCH] cross.bbclass: keep TARGET_SYS & TARGET_PREFIX independent Chris Larson
2009-08-20  3:24 ` [PATCH] patch.bbclass: catch exceptions raised in the Resolve() Chris Larson
2009-08-20  3:24   ` [PATCH] patch.bbclass: Add "git" patchtool mechanism, which uses git-apply Chris Larson
2009-08-20  3:24     ` [PATCH] kernel.bbclass: Set EXTRA_OEMAKE to null for kernel Chris Larson
2009-08-20  3:24       ` [PATCH] kernel.bbclass: Install & package symvers as /boot/Module.symvers-<ver> Chris Larson
2009-08-20  3:24         ` [PATCH] bitbake.conf: Kill CCACHE. Implicit, automatic use of things which can fail is bad Chris Larson
2009-08-20  3:24           ` [PATCH] bitbake.conf: Add export for cross NM Chris Larson
2009-08-20  3:24             ` [PATCH] bitbake.conf: BUILD_LDFLAGS: use $ORIGIN in the -rpath rather than a full path Chris Larson
2009-08-20  3:24               ` [PATCH] bitbake.conf: only pass --no-check-certificate if wget supports it Chris Larson
2009-08-20  4:18               ` [PATCH] bitbake.conf: BUILD_LDFLAGS: use $ORIGIN in the -rpath rather than a full path Denys Dmytriyenko
2009-08-20  4:53                 ` Chris Larson
2009-08-20  5:06                   ` Denys Dmytriyenko
2009-08-20  5:49             ` [PATCH] bitbake.conf: Add export for cross NM Holger Hans Peter Freyther
2009-08-20  4:06           ` [PATCH] bitbake.conf: Kill CCACHE. Implicit, automatic use of things which can fail is bad Denys Dmytriyenko
2009-08-20  5:49           ` Holger Hans Peter Freyther
2009-08-20  7:32             ` Graham Gower
2009-08-20  7:43               ` Denys Dmytriyenko
2009-08-20 12:09                 ` Martyn Welch
2009-08-20 12:05         ` [PATCH] kernel.bbclass: Install & package symvers as /boot/Module.symvers-<ver> Michael Smith
2009-08-20  3:43       ` [PATCH] kernel.bbclass: Set EXTRA_OEMAKE to null for kernel Denys Dmytriyenko
2009-08-20  3:55     ` Denys Dmytriyenko [this message]
2009-08-20 12:04 ` [PATCH] cross.bbclass: keep TARGET_SYS & TARGET_PREFIX independent Michael Smith
2009-08-20 15:21   ` Chris Larson
2009-08-20 16:11     ` Michael Smith
2010-02-25 18:28 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090820035528.GE32010@denix.org \
    --to=denis@denix.org \
    --cc=dfarnsworth@mvista.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox