Bug 12462 - Git configuration can break poky scripts
Summary: Git configuration can break poky scripts
Status: RESOLVED NOTABUG
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: Scripts and Tools (show other bugs)
Version: 2.5
Hardware: All Multiple
: Medium normal
Target Milestone: 2.5 M3
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-01-02 20:42 UTC by kratsg
Modified: 2018-02-22 15:23 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kratsg 2018-01-02 20:42:19 UTC
When cloning poky with the git config set "core.autocrlf=true", sourcing the scaffolding script breaks:

$ source oe-init-build-env
: command not found
: command not found
-bash: oe-init-build-env: line 30: syntax error near unexpected token `elif'
'bash: oe-init-build-env: line 30: `elif [ -n "$ZSH_NAME" ]; then

To reproduce:

git config core.autocrlf true
git clone -b pyro git://git.yoctoproject.org/poky
cd poky
source oe-init-build-env
Comment 1 Michael Halstead 2018-01-02 22:39:12 UTC
We can't control this on the infrastructure side as far as I know. The end user can control this setting or the repository owner can add a .gitattributes file and set "text eol=lf". I'm moving this to where the repository owners will see it.
Comment 2 Ross Burton 2018-01-04 15:44:21 UTC
Context: core.autocrlf=true tells git to force every text file to use Windows line endings, but on Linux shell scripts needs Linux line endings.

Why do you have autocrlf=true set?
Comment 3 kratsg 2018-01-16 14:05:37 UTC
Hi, sorry for late response. This was needed between we're running Vivado/SDK on Windows machines and yocto/bitbake on Linux machines -- and having to run version control on both.
Comment 4 Richard Purdie 2018-02-22 15:23:53 UTC
You can't clone linux based shell scripts with that setting and expect them to work and this isn't something we can fix, sorry.