Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Hack needed for building on Linux/Unix #1

Closed
petesoper opened this issue Feb 21, 2016 · 3 comments
Closed

Hack needed for building on Linux/Unix #1

petesoper opened this issue Feb 21, 2016 · 3 comments

Comments

@petesoper
Copy link

The wiced.patch operation described in the README.md instructions fails on Linux because some of the files have CRLF line endings (and so they don't match what patch is expecting). Here's a quick hack that was tested on Linux to run in the directory prior to patch to switch the text file lines so they match. This script can take a long time to traverse the SDK tree with possibly long pauses: be careful not to interrupt it.

#!/bin/sh
# Fix for DOS/Windows files expected to be Unix/Linux files.
# Recursively find all the text files with CRLF endings and make them LF.
# Be careful not to kill this script before it finishes!
# Tested on Ubuntu 13.10

if [ "`which dos2unix` " = " " ] ; then
  echo "Install dos2unix and run this again"
  exit 1
fi

find . -type f | while read file ; do
  file "$file" | grep -q "ASCII text, with CRLF line terminators" 
  if [ $? -eq 0 ] ; then
    dos2unix "$file"
  fi
done
@AriZuu
Copy link
Owner

AriZuu commented Feb 21, 2016

Good point. I didn't notice that myself, as I have SDK in internal git repository where the line endings are already fixed by git (ie. I have core.autocrlf = input).

@AriZuu
Copy link
Owner

AriZuu commented Feb 21, 2016

Alternative way to solve this with git would be

cd WICED-SDK-3.3.1
git init
git config core.autocrlf input
git add .
warning: CRLF will be replaced by LF in ....
The file will have its original line endings in your working directory.
git commit -a -m "fix line endings."
git rm --cached -r .
git reset --hard

AriZuu added a commit that referenced this issue Feb 21, 2016
@AriZuu
Copy link
Owner

AriZuu commented Feb 21, 2016

This is now documented in README.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants