Skip to contentSkip to conversation

lib/oe/patch: Use force option when creating symlinks to patches

PATCH In review Richard Purdie 2 participants 2 messages Dec 14, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/oe/patch: Use force option when creating symlinks to patches

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.

---

meta/lib/oe/patch.py +1 -1
index bc86bb5..7ab74fa 100644
@@ -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()
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Richard Purdie

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.

Quoted 23 lines

---

meta/lib/oe/patch.py +1 -1
index bc86bb5..7ab74fa 100644
@@ -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()

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core