blob: c7d4c6a41c9ea73aefea0a61530eb621362ddfc0 [file] [log] [blame]
Radek Krejci4a2c7552016-02-22 15:09:35 +01001#!/bin/bash
2ABI_MON=abi-monitor
3ABI_TRK=abi-tracker
4
5which $ABI_MON > /dev/null || exit 1
6which $ABI_TRK > /dev/null || exit 1
7
8if test -n "$2"; then
9 VER1="$1"
10 VER2="$2"
11elif test -n "$1"; then
12 if test "$1" = "help" -o "$1" = "-h" -o "$1" = "--help"; then
13 echo Usage:
14 echo \t$0 [number of last versions]
15 echo \t$0 [version1] [version2]
16 exit 0
17 fi
18 LIMIT="-limit $1"
19 l=$1
20fi
21
22if [ -e gitrepo ]; then
23 cd gitrepo
24 git pull
25 cd -
26else
27 git clone https://github.com/CESNET/libnetconf2.git gitrepo
28fi
29test -e packages || mkdir packages
30test -e src/libnetconf2 || mkdir -p src/libnetconf2
31rm -rf src/libnetconf2/*
32
33cd gitrepo
34git checkout devel
35VERSIONS=`git log --grep=VERSION --oneline | sed 's/ .* /_/'`
36cd -
37for i in $VERSIONS; do
38 if test "$l" = "0"; then
39 rm -rf abi_dump/libnetconf2/${i//*_}
40 rm -rf installed/libnetconf2/${i//*_}
41 else
42 test -n "$l" && l=$(($l-1))
43 if test -n "$VER1"; then
44 if test "$VER1" != "${i//*_}" -a "$VER2" != "${i//*_}"; then
45 rm -rf abi_dump/libnetconf2/${i//*_}
46 rm -rf installed/libnetconf2/${i//*_}
47 continue
48 fi
49 fi
50 if test ! -f packages/libnetconf2-${i//*_}.tgz; then
51 cd gitrepo
52 git checkout ${i//_*}
53 cd -
54 tar -czf packages/libnetconf2-${i//*_}.tgz gitrepo
55 fi
56 cp packages/libnetconf2-${i//*_}.tgz src/libnetconf2/
57 fi
58done
59
60cp libnetconf2.json libnetconf2.aux
61abi-monitor -get -build $LIMIT libnetconf2.aux
62abi-tracker -build libnetconf2.aux
63rm -rf libnetconf2.aux
64