-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshowversions.sh
executable file
·64 lines (52 loc) · 2.19 KB
/
showversions.sh
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
#grep _VERSION LinuxSDK/DTAPI/Include/DTAPI.h
egrep '^#define.*_VERSION_' $( find . -name \*.h )
egrep _VERSION_ $( find . -name Version.inc )
function getdefine() {
local file="$1"
local define="$2"
egrep "^#define $2" "$file" | sed -E 's/#define [^ \t]+[ \t]+//'
}
function getassign() {
local file="$1"
local var="$2"
egrep "^${var} = " "$file" | sed -E 's/.* = //'
}
function print_ver() {
printf '.%s' "$@" | sed 's/[.]//'
}
DTAPI=(
"$(getdefine ./LinuxSDK/DTAPI/Include/DTAPI.h DTAPI_VERSION_MAJOR)"
"$(getdefine ./LinuxSDK/DTAPI/Include/DTAPI.h DTAPI_VERSION_MINOR)"
"$(getdefine ./LinuxSDK/DTAPI/Include/DTAPI.h DTAPI_VERSION_BUGFIX)"
"$(getdefine ./LinuxSDK/DTAPI/Include/DTAPI.h DTAPI_VERSION_BUILD)"
)
DTA=(
"$(getassign ./LinuxSDK/Drivers/Dta/Source/Version.inc DTA_VERSION_MAJOR)"
"$(getassign ./LinuxSDK/Drivers/Dta/Source/Version.inc DTA_VERSION_MINOR)"
"$(getassign ./LinuxSDK/Drivers/Dta/Source/Version.inc DTA_VERSION_MICRO)"
"$(getassign ./LinuxSDK/Drivers/Dta/Source/Version.inc DTA_VERSION_BUILD)"
)
DTANW=(
"$(getassign ./LinuxSDK/Drivers/DtaNw/Source/Version.inc DTANW_VERSION_MAJOR)"
"$(getassign ./LinuxSDK/Drivers/DtaNw/Source/Version.inc DTANW_VERSION_MINOR)"
"$(getassign ./LinuxSDK/Drivers/DtaNw/Source/Version.inc DTANW_VERSION_MICRO)"
"$(getassign ./LinuxSDK/Drivers/DtaNw/Source/Version.inc DTANW_VERSION_BUILD)"
)
DTPCIE=(
"$(getassign ./LinuxSDK/Drivers/DtPcie/Source/Version.inc DTPCIE_VERSION_MAJOR)"
"$(getassign ./LinuxSDK/Drivers/DtPcie/Source/Version.inc DTPCIE_VERSION_MINOR)"
"$(getassign ./LinuxSDK/Drivers/DtPcie/Source/Version.inc DTPCIE_VERSION_MICRO)"
"$(getassign ./LinuxSDK/Drivers/DtPcie/Source/Version.inc DTPCIE_VERSION_BUILD)"
)
DTU=(
"$(getassign ./LinuxSDK/Drivers/Dtu/Source/Version.inc DTU_VERSION_MAJOR)"
"$(getassign ./LinuxSDK/Drivers/Dtu/Source/Version.inc DTU_VERSION_MINOR)"
"$(getassign ./LinuxSDK/Drivers/Dtu/Source/Version.inc DTU_VERSION_MICRO)"
"$(getassign ./LinuxSDK/Drivers/Dtu/Source/Version.inc DTU_VERSION_BUILD)"
)
echo "DTAPI $( print_ver "${DTAPI[@]}" )"
echo "Dta $( print_ver "${DTA[@]}" )"
echo "DtaNw $( print_ver "${DTANW[@]}" )"
echo "DtPcie $( print_ver "${DTPCIE[@]}" )"
echo "Dtu $( print_ver "${DTU[@]}" )"