diff mbox series

[4/9] dos2unix.bbclass: Move to oe-core

Message ID f1c6008db923f577cb03d5461c06ad97d55a57f6.1534699224.git.raj.khem@gmail.com
State Accepted
Commit bd4a02d8d3cfb476a2da0f4616605c92604266c0
Headers show
Series Use llvmpile for mesa on x86/x86-64 | expand

Commit Message

Khem Raj Aug. 19, 2018, 5:23 p.m. UTC
- 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>

---
 meta/classes/dos2unix.bbclass | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 meta/classes/dos2unix.bbclass

-- 
2.18.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Martin Hundebøll Aug. 20, 2018, 9:23 a.m. UTC | #1
Hi Khem,

On 19/08/2018 19.23, Khem Raj wrote:
> - 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>
> ---
>   meta/classes/dos2unix.bbclass | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>   create mode 100644 meta/classes/dos2unix.bbclass
> 
> diff --git a/meta/classes/dos2unix.bbclass b/meta/classes/dos2unix.bbclass
> new file mode 100644
> index 0000000000..3fc17e2196
> --- /dev/null
> +++ b/meta/classes/dos2unix.bbclass
> @@ -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"

Shouldn't the dos2unix recipe live in oe-core also, when a class depends 
upon it?

// Martin

> +
> +# 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
>
Richard Purdie Aug. 20, 2018, 9:43 a.m. UTC | #2
On Mon, 2018-08-20 at 11:23 +0200, Martin Hundebøll wrote:
> Hi Khem,
> 
> On 19/08/2018 19.23, Khem Raj wrote:
> > - 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>
> > ---
> >   meta/classes/dos2unix.bbclass | 14 ++++++++++++++
> >   1 file changed, 14 insertions(+)
> >   create mode 100644 meta/classes/dos2unix.bbclass
> > 
> > diff --git a/meta/classes/dos2unix.bbclass
> > b/meta/classes/dos2unix.bbclass
> > new file mode 100644
> > index 0000000000..3fc17e2196
> > --- /dev/null
> > +++ b/meta/classes/dos2unix.bbclass
> > @@ -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"
> 
> Shouldn't the dos2unix recipe live in oe-core also, when a class
> depends upon it?

Not necessarily, we do have a number of core classes which aren't
directly used in OE-Core but are needed by many layers and having a
common copy makes sense.

I'd agree it is good to try and have something which tests them though.

Cheers,

Richard
Khem Raj Aug. 20, 2018, 5:02 p.m. UTC | #3
On Mon, Aug 20, 2018 at 2:43 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Mon, 2018-08-20 at 11:23 +0200, Martin Hundebøll wrote:
> > Hi Khem,
> >
> > On 19/08/2018 19.23, Khem Raj wrote:
> > > - 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>
> > > ---
> > >   meta/classes/dos2unix.bbclass | 14 ++++++++++++++
> > >   1 file changed, 14 insertions(+)
> > >   create mode 100644 meta/classes/dos2unix.bbclass
> > >
> > > diff --git a/meta/classes/dos2unix.bbclass
> > > b/meta/classes/dos2unix.bbclass
> > > new file mode 100644
> > > index 0000000000..3fc17e2196
> > > --- /dev/null
> > > +++ b/meta/classes/dos2unix.bbclass
> > > @@ -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"
> >
> > Shouldn't the dos2unix recipe live in oe-core also, when a class
> > depends upon it?
>
> Not necessarily, we do have a number of core classes which aren't
> directly used in OE-Core but are needed by many layers and having a
> common copy makes sense.
>
> I'd agree it is good to try and have something which tests them though.
>

in this case, I think it would make sense to bring in recipe as well, since the
motivation to bring this into core is to unlink dependency on meta-oe layer

> Cheers,
>
> Richard
Khem Raj Aug. 20, 2018, 5:22 p.m. UTC | #4
I updated this in pull branch to include recipe as well.
On Mon, Aug 20, 2018 at 10:02 AM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Mon, Aug 20, 2018 at 2:43 AM Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> >
> > On Mon, 2018-08-20 at 11:23 +0200, Martin Hundebøll wrote:
> > > Hi Khem,
> > >
> > > On 19/08/2018 19.23, Khem Raj wrote:
> > > > - 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>
> > > > ---
> > > >   meta/classes/dos2unix.bbclass | 14 ++++++++++++++
> > > >   1 file changed, 14 insertions(+)
> > > >   create mode 100644 meta/classes/dos2unix.bbclass
> > > >
> > > > diff --git a/meta/classes/dos2unix.bbclass
> > > > b/meta/classes/dos2unix.bbclass
> > > > new file mode 100644
> > > > index 0000000000..3fc17e2196
> > > > --- /dev/null
> > > > +++ b/meta/classes/dos2unix.bbclass
> > > > @@ -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"
> > >
> > > Shouldn't the dos2unix recipe live in oe-core also, when a class
> > > depends upon it?
> >
> > Not necessarily, we do have a number of core classes which aren't
> > directly used in OE-Core but are needed by many layers and having a
> > common copy makes sense.
> >
> > I'd agree it is good to try and have something which tests them though.
> >
>
> in this case, I think it would make sense to bring in recipe as well, since the
> motivation to bring this into core is to unlink dependency on meta-oe layer
>
> > Cheers,
> >
> > Richard
diff mbox series

Patch

diff --git a/meta/classes/dos2unix.bbclass b/meta/classes/dos2unix.bbclass
new file mode 100644
index 0000000000..3fc17e2196
--- /dev/null
+++ b/meta/classes/dos2unix.bbclass
@@ -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