Skip to contentSkip to conversation

bash: oe-init-build-env: line 33: syntax error near unexpected token `elif'

poky Elvis Dowson 1 participant 3 messages Apr 18, 2013 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,
The following commit

http://ares/gitweb/?p=tools/poky.git;a=blobdiff;f=oe-init-build-env;h=68af7b5193b73627cd6ebf6196adfa685a787c38;hp=67eddcd295bd9d1adac21fc4e97506fca05f4bfa;hb=813127247a1100b1abe179dfba25795560eac864;hpb=a468b0d5579148771da716eaf357e5d45fc3211c

is causing a build error while sourcing the oe-init-build-env build script

$ cd /tool/yocto/poky;source oe-init-build-env build
: command not found
: command not found
bash: oe-init-build-env: line 33: syntax error near unexpected token `elif'
'ash: oe-init-build-env: line 33: `   elif [ -n "$ZSH_NAME" ]; then

This is on Ubuntu 12.10 x86 64-bit.

Elvis Dowson

A message that is not in the archive (sent off-list or not yet received): CAHUNapQakOn5n3=fAHT7nBCYLU1fAiVNm52cLEn4rORGuXaFRg@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 21 lines · Elvis Dowson
Quoted 4 lines · Trevor Woerner
Quoted 1 line · Elvis Dowson

http://ares/gitweb/?p=tools/poky.git;a=blobdiff;f=oe-init-build-env;h=68af7b5193b73627cd6ebf6196adfa685a787c38;hp=67eddcd295bd9d1adac21fc4e97506fca05f4bfa;hb=813127247a1100b1abe179dfba25795560eac864;hpb=a468b0d5579148771da716eaf357e5d45fc3211c

Do you have a better link?

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/oe-init-build-env?id=813127247a1100b1abe179dfba25795560eac864

I reverted the commit, but the error still persisted. It's something else, probably due to a recent update to Ubuntu 12.10. I tried reverting to known commit ids but all of them don't work.

My shell is correctly configured to use bash instead of dash.

When I ran the debug mode for the bash shell, I found out that the

: command not found
: command not found

errors were due to the new lines on line 2 and line 20. Deleting the new lines made the : command not found errors go away, but I get the following error with the older commit

Quoted 8 lines

bash: ./oe-init-build-env: line 45: syntax error: unexpected end of file

and the following error with the current master

bash: ./oe-init-build-env: line 33: syntax error near unexpected token `elif'
'ash: ./oe-init-build-env: line 33: ` elif [ -n "$ZSH_NAME" ]; then

Man, this is so un-expected!! :-)

Okay, false alarm, sorry about that. I noticed that when I pull the latest updates, something went wrong and there were a lot of modified files after the update in red. I did a git clean -df and git reset --hard, and it solved the problem. Don't know how that happened though, but problem fixed by resetting the git repo and cleaning all the dirty files.

Best regards,

Elvis Dowson

#4 lore raw

Hi,
I think I know what happened. I briefly setup autocrlf=true in the global .gitconfig last week, and when I pull in all the latest commits, it ended up adding CRLF, and ended up causing issues. Even after disabling it, the damage already done to the local poky repository. Luckily I had backups.

This shouldn't have happened to with git!

Elvis Dowson