Skip to content

Commit

Permalink
Merge pull request #415 from openxc/gitdir_fix
Browse files Browse the repository at this point in the history
Added fix for line endings and nested submodules' gitdir
  • Loading branch information
cwbaldwin committed Oct 3, 2019
2 parents ae89309 + df30383 commit 54f6167
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions script/bootstrap/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,26 @@ pre-configured Vagrant environment. See the docs for more information."
fi
set -e

echo "Fixing gitdir for nested submodules"

# https://marc.info/?l=git&m=145937129606918&w=2
# There's a bug with the git submodule update command (still unfixed as of v2.23.0) that causes nested submodules to use an absolue
# path for their gitdir, whereas everything else uses relative paths. Since the project root in this context
# is /vagrant/, the gitdirs for the nested submodules will be incorrect and consequentially most git commands won't
# work (unless you're in a vagrant machine). For now we'll just rewrite the gitdirs for the nested submodules to use relative paths
sed -i -e 's/\/vagrant\//..\/..\/..\/..\/..\//g' src/libs/AT-commander/lpc17xx/BSP/.git
sed -i -e 's/\/vagrant\//..\/..\/..\/..\/..\//g' src/libs/AT-commander/lpc17xx/CDL/.git
sed -i -e 's/\/vagrant\//..\/..\/..\/..\/..\//g' src/libs/AT-commander/lpc17xx/emqueue/.git
sed -i -e 's/\/vagrant\//..\/..\/..\/..\/..\//g' src/libs/isotp-c/deps/bitfield-c/.git
sed -i -e 's/\/vagrant\//..\/..\/..\/..\/..\//g' src/libs/openxc-message-format/libs/nanopb/.git
sed -i -e 's/\/vagrant\//..\/..\/..\/..\/..\//g' src/libs/uds-c/deps/bitfield-c/.git
sed -i -e 's/\/vagrant\//..\/..\/..\/..\/..\//g' src/libs/uds-c/deps/isotp-c/.git
sed -i -e 's/\/vagrant\//..\/..\/..\/..\/..\/..\/..\//g' src/libs/uds-c/deps/isotp-c/deps/bitfield-c/.git

# Force git to use CR/LF line endings. The default from within a vagrant machine is different, so without this
# it'll think all of the files have changed when inside a vagrant machine
git config --global core.autocrlf true

#https://cryptography.io/en/latest/installation/#building-cryptography-on-linux
#cryptography is dependency of pyparsing - need to ensure other packages first
#otherwise cffi error
Expand Down

0 comments on commit 54f6167

Please sign in to comment.