File: get-vcs-snapshot.sh

package info (click to toggle)
vdr-plugin-softhddevice 0.6.0%2Bgit20160108-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,800 kB
  • ctags: 2,989
  • sloc: ansic: 14,641; cpp: 2,609; makefile: 145; sh: 13
file content (19 lines) | stat: -rw-r--r-- 716 bytes parent folder | download | duplicates (27)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
echo Downloading latest from git repository...
set -e

DEB_SOURCE_PACKAGE=`egrep '^Source: ' debian/control | cut -f 2 -d ' '`
VERSION_UPSTREAM=`dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2 | cut -d- -f1 | sed -r 's/(.*)\+git.*/\1/'`
VERSION_DATE=`/bin/date --utc +%0Y%0m%0d`
VERSION_FULL="${VERSION_UPSTREAM}+git${VERSION_DATE}"

git clone --depth 1 git://projects.vdr-developer.org/${DEB_SOURCE_PACKAGE}.git

cd ${DEB_SOURCE_PACKAGE}
GIT_SHA=`git show --pretty=format:"%h" --quiet | head -1 || true`
cd ..

tar --exclude=.git -czf "../${DEB_SOURCE_PACKAGE}_${VERSION_FULL}.orig.tar.gz" ${DEB_SOURCE_PACKAGE}

dch -v "$VERSION_FULL-1" "New Upstream Snapshot (commit $GIT_SHA)"

rm -rf ${DEB_SOURCE_PACKAGE}