File: snapshot-release.sh

package info (click to toggle)
fso-frameworkd 0.10.1-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,224 kB
  • ctags: 5,231
  • sloc: python: 23,834; sh: 170; sql: 4; makefile: 4
file content (68 lines) | stat: -rw-r--r-- 1,358 bytes parent folder | download | duplicates (4)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash

set -e

# This script is used by nomeata to 
# * Create a tarball from the upstream git branch 
# * Insert it into pristine tar
# * Merge it into Debian
# * Create a new debian/changelog entry 

# It requires the upstream/$VERSION tag to be set

VERSION=$1

if [ -z "$VERSION" -o "$VERSION" = "--help" ]
then
	echo "Usage:"
	echo "	$0 <version>"
	echo "Whereas a tag upstream/<version> exists"
	exit 0
fi

if [ ! -e .git ]
then
	echo "Please run in the root of the git tree"
	exit 1
fi


TARBALL=../fso-frameworkd_"$VERSION".orig.tar.gz
TAG="upstream/$VERSION"

if !  git tag -l "$TAG" | fgrep -q "$TAG"
then
	echo "Tag $TAG not found"
	exit 1
fi

if ! git status | fgrep -q 'nothing to commit'
then
	echo "Uncommited changes:"
	git status
	exit 1
fi

set -x

git-archive --format=tar --prefix=frameworkd-"$VERSION"/ "$TAG" | \
	gzip -9 > $TARBALL

pristine-tar -m "New upstream tarball

Generated by:
git-archive --format=tar --prefix=frameworkd-$VERSION/ "$TAG" | \
	gzip -9 > ../fso-frameworkd_$VERSION.orig.tar.gz" \
	commit "$TARBALL" "$TAG"

git checkout debian

git merge "$TAG"

# Even if the last entry was UNRELEASED, we want a new one
dch --release-heuristic log --distribution UNRELEASED --newversion "$VERSION-1" \
 -m "New upstream release"

git commit debian/changelog -m "Entry about new upstream version $VERSION"

echo "Done!"