Skip to contentSkip to conversation

Dealing with line endings

DISCUSSION keith.derrick 2 participants 3 messages Jun 25, 2019 – Jun 26, 2019

lore
Share & tools
lore
#0 lore raw

I am using an upstream repo with a mix of line endings.

In my recipe, I'm applying a patch with normalized line endings, as our meta layer repo has a .gitattributes with "text=auto" set.

The patch is failing due to "different line endings".

Can the git fetcher be configured to normalize line endings on unpack? I tried setting core.autocrlf in my global .gitconfig, but the fetcher/unpacker seems to ignore it.

Thanks

Keith

#1 lore raw

Hi Keith,

you can use dos2unix.bbclass:
http://git.openembedded.org/openembedded-core/tree/meta/classes/dos2unix.bbclass
to convert them before do_patch.

Cheers,

Quoted 26 lines · keith.derrick

I am using an upstream repo with a mix of line endings.

In my recipe, I'm applying a patch with normalized line endings, as our meta layer repo has a .gitattributes with "text=auto" set.

The patch is failing due to "different line endings".

Can the git fetcher be configured to normalize line endings on unpack? I tried setting core.autocrlf in my global .gitconfig, but the fetcher/unpacker seems to ignore it.

Thanks

Keith

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#2 lore raw

Thanks Martin, that fixed it nicely.

________________________________
From: Martin Jansa <[email protected]>
Sent: Tuesday, June 25, 2019 12:30 AM
To: Keith Derrick/LGEUS Advanced Platform([email protected])
Cc: [email protected]
Subject: Re: [yocto] Dealing with line endings

Hi Keith,

you can use dos2unix.bbclass:
http://git.openembedded.org/openembedded-core/tree/meta/classes/dos2unix.bbclass
to convert them before do_patch.

Cheers,

On Tue, Jun 25, 2019 at 4:57 AM keith.derrick <[email protected]<mailto:[email protected]>> wrote:

I am using an upstream repo with a mix of line endings.

In my recipe, I'm applying a patch with normalized line endings, as our meta layer repo has a .gitattributes with "text=auto" set.

The patch is failing due to "different line endings".

Can the git fetcher be configured to normalize line endings on unpack? I tried setting core.autocrlf in my global .gitconfig, but the fetcher/unpacker seems to ignore it.

Thanks

Keith

--
_______________________________________________
yocto mailing list [email protected]<mailto:[email protected]>
https://lists.yoctoproject.org/listinfo/yocto