Patchwork qemu: Remove stray .git files after unpacking

login
register
mail settings
Submitter Phil Blundell
Date Jan. 9, 2014, 11:18 a.m.
Message ID <1389266306.9182.124.camel@phil-desktop.brightsign>
Download mbox | patch
Permalink /patch/64475/
State New
Headers show

Comments

Phil Blundell - Jan. 9, 2014, 11:18 a.m.
The qemu tarball ships some extraneous .git metadata in the dtc/ and pixman/ 
subfolders, containing a reference to the path "../.git/modules" which
doesn't exist.  The presence of these files will confuse git if it happens
to recurse into the qemu source folder during an operation on some parent
directory, for example "git clean" at a higher level.  Avoid that problem
(mostly) by removing them immediately after the sources are unpacked.

Signed-off-by: Phil Blundell <pb@pbcl.net>
---
 meta/recipes-devtools/qemu/qemu_1.6.1.bb | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch

diff --git a/meta/recipes-devtools/qemu/qemu_1.6.1.bb b/meta/recipes-devtools/qemu/qemu_1.6.1.bb
index 03e28a0..b5cd61e 100644
--- a/meta/recipes-devtools/qemu/qemu_1.6.1.bb
+++ b/meta/recipes-devtools/qemu/qemu_1.6.1.bb
@@ -11,6 +11,14 @@  SRC_URI[sha256sum] = "fc736f44aa10478223c881310a7e40fc8386547e9cadf7d01ca4685951
 
 COMPATIBLE_HOST_class-target_mips64 = "null"
 
+do_sanitize_sources() {
+    # These .git files point to a nonexistent path "../.git/modules" and will confuse git
+    # if it tries to recurse into those directories.
+    rm -f ${S}/dtc/.git ${S}/pixman/.git
+}
+
+addtask sanitize_sources after do_unpack before do_patch
+
 do_install_append() {
     # Prevent QA warnings about installed ${localstatedir}/run
     if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi