From: Johannes Berg Date: Tue, 16 Apr 2013 07:45:23 +0000 (+0200) Subject: patch library: don't use -p1 for git patches X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=6fa898d06e6cb1058a3f38dc54cb2be14192aadf;p=openwrt%2Fstaging%2Fblogic.git patch library: don't use -p1 for git patches For git patches, the patch library will automatically use -p1 and strip the a/ b/ filename prefix, while for other patches it uses -p0 and doesn't strip anything. We usually use a/ b/ prefixes even when the patches aren't in the git format and strip a path in gentree, so remove this from the library. Signed-off-by: Johannes Berg --- diff --git a/lib/patch.py b/lib/patch.py index 878aa3c3db33..b5949fd7328f 100644 --- a/lib/patch.py +++ b/lib/patch.py @@ -626,21 +626,6 @@ class PatchSet(object): return None """ - for i,p in enumerate(self.items): - if p.type in (HG, GIT): - # TODO: figure out how to deal with /dev/null entries - debug("stripping a/ and b/ prefixes") - if p.source != '/dev/null': - if not p.source.startswith("a/"): - warning("invalid source filename") - else: - p.source = p.source[2:] - if p.target != '/dev/null': - if not p.target.startswith("b/"): - warning("invalid target filename") - else: - p.target = p.target[2:] - p.source = xnormpath(p.source) p.target = xnormpath(p.target)