oe.patch: for 'patch', always use -f
authorChris Larson <chris_larson@mentor.com>
Fri, 22 Oct 2010 18:04:36 +0000 (11:04 -0700)
committerChris Larson <chris_larson@mentor.com>
Mon, 8 Nov 2010 14:59:23 +0000 (07:59 -0700)
Apparently quilt always ignores hunks that seem already applied, so let's do
the same via -f.  -t would probably be better, but isn't safe to use from a
portability standpoint.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
lib/oe/patch.py

index 29d5102..4e709be 100644 (file)
@@ -73,16 +73,13 @@ class PatchTree(PatchSet):
         self.patches.insert(i, patch)
 
     def _applypatch(self, patch, force = False, reverse = False, run = True):
-        shellcmd = ["patch", "-p%s" % patch['strippath']]
+        shellcmd = ["patch", "-p%s" % patch['strippath'], "-f"]
         if reverse:
             shellcmd.append('-R')
 
         if not run:
             return subprocess.list2cmdline(shellcmd)
 
-        if force:
-            shellcmd.append('-f')
-
         patch = open(patch['file'], "r")
         return oe.process.run(shellcmd, cwd=self.dir, env=self.env, stdin=patch)