File: get-git-source.sh

package info (click to toggle)
abci 0.0~git20170124.0.f94ae5e-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 432 kB
  • sloc: python: 724; sh: 56; makefile: 23
file content (30 lines) | stat: -rwxr-xr-x 860 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

set -ex

PACKAGE=tendermint-go-crypto
REPO='https://github.com/tendermint/go-crypto'
SEP='~'
BASE_REL=${BASE_REL:-$(dpkg-parsechangelog 2>/dev/null | sed -ne 's/Version: \([0-9.]\+\)~.*/\1/p')}
TIMESTAMP="$(date +%Y%m%d)"
OLDDIR=${PWD}
GOS_DIR=${OLDDIR}/get-orig-source
REPACK_EXT=

if [ -z ${BASE_REL} ]; then
    echo 'Please run this script from the sources root directory.'
    exit 1
fi

rm -rf ${GOS_DIR}
mkdir -p ${GOS_DIR} && cd ${GOS_DIR}
git clone "${REPO}" "${PACKAGE}"

cd ${PACKAGE}/
GIT_DESCRIBE=$(git describe --always)
VERSION="${BASE_REL}${SEP}${TIMESTAMP}${SEP}0git${GIT_DESCRIBE}"
cd .. && mv ${PACKAGE} ${PACKAGE}-${VERSION}
tar cf ${OLDDIR}/${PACKAGE}_${VERSION}.orig.tar --exclude-vcs ${PACKAGE}-${VERSION}
#gzip -9fn ${OLDDIR}/${PACKAGE}_${VERSION}.orig.tar
xz -9f ${OLDDIR}/${PACKAGE}_${VERSION}.orig.tar
rm -rf ${GOS_DIR}