File: sanity.sh

package info (click to toggle)
debmake 5.1.5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 696 kB
  • sloc: python: 2,195; sh: 240; makefile: 30
file content (24 lines) | stat: -rwxr-xr-x 856 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
22
23
24
#!/usr/bin/sh -e
# Sanity check of source tree
for f in src/debmake/*.py ;
  do
    echo " ... testing $f for python syntax"
    python3 -m py_compile $f || exit 1
  done
# Checking hardcoded versions
# debian/changelog
DEBIAN_VERSION="$(dpkg-parsechangelog -S "Version")"
# remove salsaci version bump/bin nmu version bump etc.
echo "DEBIAN_VERSION = $DEBIAN_VERSION @ debian/changelog (original)"
DEBIAN_VERSION="${DEBIAN_VERSION%%+*}"
# src/debmake/__init__.py
echo "DEBIAN_VERSION = $DEBIAN_VERSION @ debian/changelog (sanitized)"
PYCODE_VERSION="$(sed -n -e '/^__version__/s/^__version__ = "\([^"][^"]*\)".*$/\1/p' src/debmake/__init__.py)"
echo "PYCODE_VERSION = $PYCODE_VERSION @ src/debmake/__init__.py"
if [ "$DEBIAN_VERSION" = "$PYCODE_VERSION" ]; then
  echo "All version OK: $DEBIAN_VERSION"
else
  echo "XXX version mismatch XXX"
  exit 1
fi