File: test-version

package info (click to toggle)
tpm2-tools 5.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,988 kB
  • sloc: ansic: 45,737; sh: 14,915; xml: 8,342; makefile: 610; python: 51
file content (17 lines) | stat: -rwxr-xr-x 466 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

RESULT1=`tpm2_load -v`

# Test if there is version
echo "$RESULT1" | egrep -q -e 'version=["][^"]+["]'

# Test version string
VERSION_STRING=`tpm2_load -v | sed 's/.*version=["]\([^"]*\)["].*/\1/'`
PACKAGE_VERSION=`dpkg -s tpm2-tools | grep Version: | sed -e 's/Version: //' | sed -e 's/-[^-]\+$//'`

echo "VERSION_STRING =" "$VERSION_STRING"
echo "PACKAGE_VERSION =" "$PACKAGE_VERSION"

if [ "$VERSION_STRING" != "$PACKAGE_VERSION" ]; then
    exit 1
fi