lib/oe/patch.py: Dont import patches but symlink them instead
authorKhem Raj <raj.khem@gmail.com>
Wed, 9 Jun 2010 14:36:15 +0000 (14:36 +0000)
committerKhem Raj <raj.khem@gmail.com>
Thu, 10 Jun 2010 22:35:55 +0000 (15:35 -0700)
* This patch removes the usage of quilt import <patch>
  instead it creasted a symlink to the patch in the patches
  directory and synthesizes the series file which otherwise
  would be done automatically by quilt import.

* This should help a bit in reducing build time as it avoids
  copying of the patch and also other things that quilt import
  would otherwise do.

* Tested by doing minimal-image on qemuarm.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Chris Larson <chris_larson@mentor.com>
Acked-by: Roman I Khimov <khimov@altell.ru>
lib/oe/patch.py

index 7f6b0fe..607ad44 100644 (file)
@@ -230,15 +230,10 @@ class QuiltTree(PatchSet):
         if not self.initialized:
             self.InitFromDir()
         PatchSet.Import(self, patch, force)
-
-        args = ["import", "-p", patch["strippath"]]
-        if force:
-            args.append("-f")
-            args.append("-dn")
-        args.append(patch["file"])
-
-        self._runcmd(args)
-
+        os.symlink(patch["file"], self._quiltpatchpath(patch["file"]))
+        f = open(os.path.join(self.dir, "patches","series"), "a");
+        f.write(os.path.basename(patch["file"]) + " -p" + patch["strippath"]+"\n")
+        f.close()
         patch["quiltfile"] = self._quiltpatchpath(patch["file"])
         patch["quiltfilemd5"] = bb.utils.md5_file(patch["quiltfile"])