git submodule

git submodule

build-linux.sh
#!/bin/sh

set -x
git pull
if [ $? -ne 0 ]; then echo "FAIL!!"; exit 1; fi
git submodule init
if [ $? -ne 0 ]; then echo "FAIL!!"; exit 1; fi
git submodule update
if [ $? -ne 0 ]; then echo "FAIL!!"; exit 1; fi
make OYW_HASQT=1 OYW_CCC=1 clean
if [ $? -ne 0 ]; then echo "FAIL!!"; exit 1; fi
make OYW_HASQT=1 OYW_CCC=1
if [ $? -ne 0 ]; then echo "FAIL!!"; exit 1; fi
echo "Done"
  • Below are examples

add submodule

...
$ git submodule add https://github.com/iamyuiwong/cppnetwork.git modules/cppnetwork
...

$ cat .gitmodules
[submodule "modules/base64ende"]
    path = modules/base64ende
    url = https://github.com/iamyuiwong/base64ende.git
[submodule "modules/checksum"]
    path = modules/checksum
    url = https://github.com/iamyuiwong/checksum.git
[submodule "modules/cppnetwork"]
    path = modules/cppnetwork
    url = https://github.com/iamyuiwong/cppnetwork.git

add submodule url (from .gitmodules) to .git/config 以及后续 submodules clone

Set url(s):
git submodule init
Clone:
git submodule update

brand-new clone master and sub modules:

git clone --recursive https://github.com/iamyuiwong/liboywcppbase.git

watch

git submodule
Or.
git submodule status
Or.
git submodule status --recursive

E.x.
 38837fa4806b58bc17a002c5a1db36b95b1be7e5 modules/base64ende (heads/master)
 fdbf9709c66cb027e44b92cf12b9f3f5e893083e modules/checksum (heads/master)
 cc1977851ebbf2c72d60d88d49161be43e5f3796 modules/cppnetwork (heads/master)

get remote latest need by master

E.x.
git submodule update --remote

Or.
git submodule update --remote modules/cppnetwork

foreach

E.x.
git submodule foreach 'git checkout master'

git submodule foreach 'git pull'

update master deps.

  • 1 git submodule foreach 'git pull'
  • 2 add and commit

在 Ubuntu 16.04 AMD64 Desktop 编译 paparazziUAV V5.8.2 stable

在 Ubuntu 16.04 AMD64 Desktop 编译 paparazziUAV v5.8.2 stable

Ref. paparazziuav.org Installation for Ubuntu (2016-09-25 16:37:07 +0800)

步骤

  • 1 Clone paparazzi repo.
git clone --origin upstream https://github.com/paparazzi/paparazzi.git
  • 2 在软件中心将软件源改为 主服务 (Main server)

  • 3 添加软件源并更新

E.x. 2016-09-25 +0800

# add-apt-repository -y ppa:paparazzi-uav/ppa
# add-apt-repository -y ppa:team-gcc-arm-embedded/ppa

# apt-get update
  • 4 安装依赖
# apt-get -f -y install paparazzi-dev paparazzi-jsbsim gcc-arm-embedded
  • P.S. 编译时可能需要根据提示安装其他依赖

  • 5 切到稳定版本

E.x.
git checkout v5.8.2_stable
  • 6 可能需要修改 Google 地图 API URL
E.x.
文件: data/maps/Makefile
http://maps.googleapis.com/maps/api/js
改为:
http://ditu.google.cn/maps/api/js
  • 7 make
make clean
make
  • 8 最后
E.x.
commit 6260b7c457ad530e1b9eab97f49e9127fbb53772
Author: Felix Ruess <felix.ruess@gmail.com>
Date:   Tue Jun 21 21:16:03 2016 +0200

    v5.8.2 maintenance release

-rwxrwxr-x 1 yuiwong yuiwong 1375022 9月  25 13:32 sw/supervision/paparazzicenter*
sw/supervision/paparazzicenter: a /usr/bin/ocamlrun script executable (binary data)
1375022 sw/supervision/paparazzicenter
f93ec9ac6d860e380291704fb09af7d7  sw/supervision/paparazzicenter

Run:
./paparazzi