File: get-git-source.sh

package info (click to toggle)
sshcommand 0~20160110.1~2795f65-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid, stretch
  • size: 100 kB
  • ctags: 17
  • sloc: sh: 188; makefile: 53
file content (26 lines) | stat: -rwxr-xr-x 668 bytes parent folder | download
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
#!/bin/sh

set -ex

PACKAGE=sshcommand
BASE_REL=$(dpkg-parsechangelog 2>/dev/null | sed -ne 's/Version: \([0-9]\)\+.*/\1/p')
OLDCWD="${PWD}"
GOS_DIR="${OLDCWD}/get-orig-source"
GIT_DESCRIBE_STR='git describe --always'
TODAY="$(date '+%Y%m%d')"

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


mkdir "${GOS_DIR}"
git clone git@github.com:dokku/sshcommand.git "${GOS_DIR}/${PACKAGE}"
cd "${GOS_DIR}/${PACKAGE}"
GIT_DESCRIBE=$(eval "${GIT_DESCRIBE_STR}")
cd "${GOS_DIR}"
XZ_OPT=-f9 tar cJf \
	"${OLDCWD}/${PACKAGE}_${BASE_REL}~${TODAY}.1~${GIT_DESCRIBE}.orig.tar.xz" \
	"${PACKAGE}" --exclude-vcs
cd "${OLDCWD}"