]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oe/patch: Use force option when creating symlinks to patches
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 14 Dec 2012 17:21:05 +0000 (17:21 +0000)
committerSaul Wold <sgw@linux.intel.com>
Fri, 14 Dec 2012 23:17:22 +0000 (15:17 -0800)
Under the scenario where you have an existing source tree and you then
change one of the patches, maybe to be architecture or machine specific,
then rebuild, the build will fail since the symlink already exists
but should now point at a different file.

The easiest fix is to tell the system to remove and recreate the link
which is done with the force option.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/lib/oe/patch.py

index bc86bb5391ebd42ec5eb9df362d227e34636961f..7ab74fae8a5ecaf84aaa1962e36285e0dcca3144 100644 (file)
@@ -278,7 +278,7 @@ class QuiltTree(PatchSet):
         if not self.initialized:
             self.InitFromDir()
         PatchSet.Import(self, patch, force)
-        oe.path.symlink(patch["file"], self._quiltpatchpath(patch["file"]))
+        oe.path.symlink(patch["file"], self._quiltpatchpath(patch["file"]), force=True)
         f = open(os.path.join(self.dir, "patches","series"), "a");
         f.write(os.path.basename(patch["file"]) + " -p" + patch["strippath"]+"\n")
         f.close()