File: update-dch-from-git

package info (click to toggle)
linuxcnc 1%3A2.9.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 282,780 kB
  • sloc: python: 201,110; ansic: 106,370; cpp: 99,219; tcl: 16,054; xml: 10,617; sh: 10,258; makefile: 1,251; javascript: 138; sql: 72; asm: 15
file content (49 lines) | stat: -rwxr-xr-x 1,196 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash

if [ ! -d debian -o ! -d src ]; then
    echo "this script must be run from the root of the source tree (the directory with debian and src in it)"
    exit 1
fi


source scripts/githelper.sh
githelper $1

GIT_VERSION=$(scripts/get-version-from-git $GIT_BRANCH)
if [ $? -ne 0 ]; then
    echo "error determining version!"
    exit 1
fi

DEB_VERSION=`git show HEAD:debian/changelog | head -1 | sed 's/.*(\(.*\)).*/\1/'`

NEW_DEB_VERSION=$(echo $GIT_VERSION | sed -r 's/-pre/~pre/; s/-/./g')
NEW_DEB_VERSION="1:${NEW_DEB_VERSION/v/}"

if [ "$NEW_DEB_VERSION" = "$DEB_VERSION" ]; then
    echo "no changes since the version at the top of the debian/changelog file"
    echo "not modifying debian/changelog"
    exit 0
fi

# Workaround until <URL: https://bugs.debian.org/1008735 > in lsb_release is fixed.
CODENAME="$(lsb_release --codename --short)"
case "$CODENAME" in
  n/a)
    CODENAME=unstable
    ;;
esac

set -e
(
echo "linuxcnc ($NEW_DEB_VERSION) $CODENAME; urgency=low"
echo
git log --pretty=format:"  * %w(72,0,6)%s" $GIT_TAG..
echo
echo
echo " -- buildbot <buildbot@example.com>  $(date -R)"
echo
git show HEAD:debian/changelog
) > debian/changelog

dch -r --nomultimaint ""