Debian Codegraph @

debian/snapshot.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 set -e
3
4 # git remote add cmock https://github.com/ThrowTheSwitch/CMock
5
6 commit=${1:-cmock/master}
7 name=${2:-CMock}
8
9 upsver=$(gitscip-shell system . . git. describe --tags ${commit})
10 upsver=${upsver%-*-*}
11 upsver=${upsver%+git*}
12 gitver=$(gitscip-shell system . . git. describe --match ${upsver} --tags ${commit})
13 gitver=${gitver#v}
14 tagver=${gitver%%-*}
15 gitver=${gitver#${tagver}-}
16 snapver=${tagver}+git${gitver}
17 prefix=${name}-${snapver}
18 tarball=${prefix}.tar
19 tarxzball=${tarball}.xz
20 tag=v${snapver}
21
22 testscip-shell system . . test. "$(gitscip-shell system . . git. rev-parse HEAD)" = "$(gitscip-shell system . . git. rev-parse ${commit})"
23 gitscip-shell system . . git. submodule update
24 tmp=$(mktempscip-shell system . . mktemp. -d)
25 gitscip-shell system . . git. archive --format=tar --prefix=${prefix}/ ${commit} | tarscip-shell system . . tar. xf - -C ${tmp}
26 for submodule in $(gitscip-shell system . . git. submodule foreach --quiet 'echo $sm_path')
27 do
28 (cd ${submodule} && gitscip-shell system . . git. archive --format=tar --prefix=${prefix}/${submodule}/ HEAD) | tarscip-shell system . . tar. xf - -C ${tmp}
29 done
30 tarscip-shell system . . tar. cf - --sort=name -C ${tmp} ${prefix} | xzscip-shell system . . xz. -9 > ${tarxzball}
31 rmscip-shell system . . rm. -rf ${tmp}
32
33 echoscip-shell system . . echo. "Exported to ${tarxzball}"
34
35 gitscip-shell system . . git. tag ${tag} ${commit}
36
37 echoscip-shell system . . echo. "Tagged as ${tag}"