From aa7f2691f850d6ef7815510fa32deb751f3897ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 9 Jun 2017 16:27:45 +0200 Subject: Build opkg-trans master automatically --- build_repo.sh | 3 +++ utils/opkg-trans-master.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 utils/opkg-trans-master.sh diff --git a/build_repo.sh b/build_repo.sh index ddb6744..3d4d526 100755 --- a/build_repo.sh +++ b/build_repo.sh @@ -43,6 +43,9 @@ for d in *; do [ -d .turris-sdk ] && cp -r $d .turris-sdk/package/ done +[ -d .omnia-sdk ] && ./utils/opkg-trans-master.sh .omnia-sdk/package/ +[ -d .turris-sdk ] && ./utils/opkg-trans-master.sh .turris-sdk/package/ + if [ -f CONFIG ]; then echo -e "\e[1;34mApply CONFIG\e[0m" ([ "$BOARD" = "omnia" ] || [ "$BOARD" = "all" ]) && \ diff --git a/utils/opkg-trans-master.sh b/utils/opkg-trans-master.sh new file mode 100755 index 0000000..a44910b --- /dev/null +++ b/utils/opkg-trans-master.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# This script check if updater doesn't contain new commit and if so it bumps +# automatically. + +UPDATER_REPO=https://kkoci@gitlab.labs.nic.cz/turris/updater.git +UPDATER_REPO_PATH=/tmp/myrepo_updater_repo + +if [ ! -f $1/opkg-trans-master-auto/Makefile ]; then + # Skip this when we don't have opkg-trans-master-auto + exit +fi + +# Update updater git repo +GIT_ARGS="--git-dir="$UPDATER_REPO_PATH" --bare" +if [ ! -d $UPDATER_REPO_PATH ]; then + git clone --bare $UPDATER_REPO $UPDATER_REPO_PATH +else + git $GIT_ARGS fetch +fi +# Get info +HASH="$(git $GIT_ARGS rev-parse HEAD)" +VERSION="$(git $GIT_ARGS describe --abbrev=0 --tags)" +RELEASE="$(($(git $GIT_ARGS rev-list --count $VERSION..HEAD) + 1))" + +# Now replace stuff in Makefile +sed -i "s/^PKG_VERSION:=.*/PKG_VERSION:=$VERSION/;s/^PKG_RELEASE:=.*/PKG_RELEASE:=$RELEASE/;s/^PKG_SOURCE_VERSION:=.*/PKG_SOURCE_VERSION:=$HASH/" $1/opkg-trans-master-auto/Makefile -- cgit v1.2.3