File: pre-commit

package info (click to toggle)
python-hpilo 4.4.3-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,784 kB
  • sloc: python: 3,418; ruby: 467; makefile: 122; sh: 31
file content (18 lines) | stat: -rwxr-xr-x 605 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

die() {
    echo "(pre-commit) $@" >&2
    exit 1
}

# Mistakes I commonly make:
# - Not bumping *all* versions

# Gesundheit
versions=$(git show :setup.py :hpilo.py :docs/conf.py | sed -ne  "s/^ *_*\(version\|release\)_* *= *['\"]\([0-9.]*\)['\"].*/\2/p"; sed -ne 's/Version: \(.*\)/\1/p' devtools/python-hpilo.spec)
if [ $(echo $versions | wc -w) != 5 ]; then
    die "Yikes. Can't find the versions! (Found: $versions)"
fi
if [ $(echo $versions | xargs -n1 echo | uniq | wc -w) != 1 ]; then
    die "Inconsistent version numbers in setup.py / hpilo.py / docs/conf.py / python-hpilo.spec"
fi