File get_version.sh of Package kodi (Revision eb6aca3db3d7073be88cde03cf480160)
Currently displaying revision eb6aca3db3d7073be88cde03cf480160 , Show latest
19
1
2
3
SOURCE0=$(rpmspec -P kodi.spec |grep Source0 | awk '{print $2}' | sed -e 's/.tar.gz//')
4
TAG=$(basename $SOURCE0)
5
6
function getJsonVal () {
7
python -c "import json,sys;obj=json.load(sys.stdin);print obj$1;"
8
}
9
10
API_URL=https://api.github.com/repos/xbmc/xbmc/git
11
_sha=$(curl -s $API_URL/refs/tags/$TAG | getJsonVal "['object']['sha']")
12
sha=${_sha:0:7}
13
14
_date=$(curl -s $API_URL/commits/$_sha | getJsonVal "['committer']['date']")
15
date=$(date -d$_date +%Y%m%d)
16
17
echo "$date-$sha" > kodi.VERSION
18
19