blob: 8a25923becde9eec7e9f20f10726390575ff7b5d (
plain)
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
|
#!/bin/bash
# This file is part of RTSAdmin Community Edition.
# Copyright (c) 2011 by RisingTide Systems LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, version 3 (AGPLv3).
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
NAME=$(git config --get user.name)
EMAIL=$(git config --get user.email)
DATE=$(date +'%a, %d %b %Y %H:%M:%S %z')
SRCPKG=$(cat debian/control | grep ^Source | awk '{print $2}')
LAST_TAG=$(git tag | tail -1)
if [ -z $LAST_TAG ]; then
LAST_TAG='0.0'
fi
COMMIT=$(git log ${LAST_TAG}..HEAD | head -1 | colrm 1 7 | colrm 8)
TS=$(date +%Y%m%d%H%M%S)
if [ -z $COMMIT ]; then
VERSION="${LAST_TAG}"
else
VERSION="${LAST_TAG}-${TS}.${COMMIT}"
fi
sed -i "s/__version__ = .*/__version__ = '${VERSION}'/g" ${SRCPKG}/__init__.py
echo "${SRCPKG} (${VERSION}) unstable; urgency=low" > debian/changelog
echo >> debian/changelog
echo " * Generated package." >> debian/changelog
echo >> debian/changelog
echo " -- ${NAME} <${EMAIL}> ${DATE}" >> debian/changelog
|