b89a13215be6c00e22263a96fa36bfa02c5740da
[platform/upstream/docker-engine.git] / packaging / gitmodules.sh
1 #! /bin/sh
2 # @author: Philippe Coval <mailto:philippe.coval@eurogiciel.fr>
3 # @description: manage git submodules with git-build-package-rpm
4  
5 set -x
6 set -e
7  
8 cat .gitmodules || return 1
9
10 git submodule status | awk '{ print $2 }' | while read dir  ; do
11     name=$(basename "$dir" )
12     echo "name="
13     echo "dir=$dir"
14 # remove submodule init and upste script at gitmodule.sh file
15 # it works with current .gitmodules file and .gitmodules was made from previous tar files
16 # so it should not executed when push with new commit
17 #    git submodule init
18 #    git submodule update
19
20     tar cjvf "./packaging/${name}.tar.bz2" "${dir}"
21
22 cat<<EOF
23 # Please add "SourceN: $name.tar.bz2" and "%setup -q -a N" to "packaging/*.spec"
24 EOF
25
26 done