File: sanity.sh

package info (click to toggle)
debmake 5.1.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 696 kB
  • sloc: python: 2,175; sh: 238; makefile: 30
file content (21 lines) | stat: -rwxr-xr-x 683 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/sh -e
# Sanity check of source tree
for f in src/debmake/*.py ;
  do
    echo " ... testing $f for python syntaz"
    python3 -m py_compile $f || exit 1
  done
# Checking hardcoded versions
# debian/changelog
DEBIAN_VERSION="$(dpkg-parsechangelog -S "Version")"
# src/debmake/__init__.py
PYCODE_VERSION="$(sed -n -e '/^__version__/s/^__version__ = "\([^"][^"]*\)".*$/\1/p' src/debmake/__init__.py)"
if [ "$DEBIAN_VERSION" = "$PYCODE_VERSION" ]; then
  echo "All version OK: $DEBIAN_VERSION"
else
  echo "XXX version mismatch XXX"
  echo "DEBIAN_VERSION = $DEBIAN_VERSION @ debian/changelog"
  echo "PYCODE_VERSION = $PYCODE_VERSION @ src/debmake/__init__.py"
  exit 1
fi