]> code.ossystems Code Review - openembedded-core.git/commitdiff
dos2unix.bbclass: Move to oe-core
authorKhem Raj <raj.khem@gmail.com>
Sun, 19 Aug 2018 17:23:36 +0000 (10:23 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 20 Aug 2018 09:43:59 +0000 (10:43 +0100)
- Import from meta-oe layer

- This is useful for many packages where CR-LF
  needs to be adjusted, many recipes depend on it
  e.g. meta-multimedia libebml and so on.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/dos2unix.bbclass [new file with mode: 0644]

diff --git a/meta/classes/dos2unix.bbclass b/meta/classes/dos2unix.bbclass
new file mode 100644 (file)
index 0000000..3fc17e2
--- /dev/null
@@ -0,0 +1,14 @@
+# Class for use to convert all CRLF line terminators to LF
+# provided that some projects are being developed/maintained
+# on Windows so they have different line terminators(CRLF) vs
+# on Linux(LF), which can cause annoying patching errors during
+# git push/checkout processes.
+
+do_convert_crlf_to_lf[depends] += "dos2unix-native:do_populate_sysroot"
+
+# Convert CRLF line terminators to LF
+do_convert_crlf_to_lf () {
+       find ${S} -type f -exec dos2unix {} \;
+}
+
+addtask convert_crlf_to_lf after do_unpack before do_patch