Explorar o código

lib/oe/patch: handle patches that delete files with older git

When running "git add" on a directory with older git versions, deleted
files aren't added to what is to be committed unless you explicitly
specify the -A option. The result of this is that when applying a patch
from a recipe which doesn't apply with "git am" (and we fall back to
applying the patch through other means then "git add" following by
a "git commit") these deletes weren't committed with the patch, leaving
them sitting deleted but not committed at the end.

This should fix test_devtool_modify_native (which unwittingly exercises
this scenario by attempting to run "devtool modify" on apt-native) on
machines with older git versions.

(From OE-Core rev: 367ffba394bb815d776f48a367d5d7e5ea9b3bba)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Paul Eggleton %!s(int64=9) %!d(string=hai) anos
pai
achega
9253e927d7
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      meta/lib/oe/patch.py

+ 1 - 1
meta/lib/oe/patch.py

@@ -415,7 +415,7 @@ class GitApplyTree(PatchTree):
                     # Fall back to patch
                     output = PatchTree._applypatch(self, patch, force, reverse, run)
                 # Add all files
-                shellcmd = ["git", "add", "-f", "."]
+                shellcmd = ["git", "add", "-f", "-A", "."]
                 output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
                 # Exclude the patches directory
                 shellcmd = ["git", "reset", "HEAD", self.patchdir]