diff options
author | Karel Kočí <cynerd@email.cz> | 2018-02-01 23:07:12 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-02-01 23:07:12 +0100 |
commit | c4beadeca1580e39483a0c8fc47bc741d42179eb (patch) | |
tree | 06937942dc8c0261691423e9c8b2f4f47bd5691c | |
parent | 4ad9d6d2ed02f00d907f40c6db68834974336f19 (diff) | |
download | turris-myrepo-c4beadeca1580e39483a0c8fc47bc741d42179eb.tar.gz turris-myrepo-c4beadeca1580e39483a0c8fc47bc741d42179eb.tar.bz2 turris-myrepo-c4beadeca1580e39483a0c8fc47bc741d42179eb.zip |
Move repopath and support no v* tags
-rwxr-xr-x | build_repo.sh | 4 | ||||
-rw-r--r-- | pkgauto.mk | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/build_repo.sh b/build_repo.sh index 30bfa83..0a1217a 100755 --- a/build_repo.sh +++ b/build_repo.sh @@ -44,8 +44,8 @@ for d in *; do done # Deploy pkgauto.mk -[ -d .omnia-sdk ] && cp pkgauto.mk .omnia-sdk/include/ -[ -d .turris-sdk ] && cp pkgauto.mk .turris-sdk/include/ +[ -d .omnia-sdk ] && sed "s#%PKGAUTO%#$PWD/.pkgauto#" pkgauto.mk > .omnia-sdk/include/pkgauto.mk +[ -d .turris-sdk ] && sed "s#%PKGAUTO%#$PWD/.pkgauto#" pkgauto.mk > .turris-sdk/include/pkgauto.mk if [ -f CONFIG ]; then echo -e "\e[1;34mApply CONFIG\e[0m" @@ -11,7 +11,7 @@ ifndef PKG_SOURCE_BRANCH $(error You have to define PKG_SOURCE_BRANCH before pkgauto.mk include) endif -TMP_REPO_PATH=/tmp/myrepo_$(PKG_NAME) +TMP_REPO_PATH=/%PKGAUTO%/myrepo_$(PKG_NAME) GIT_ARGS=--git-dir='$(TMP_REPO_PATH)' --bare @@ -25,7 +25,15 @@ $(shell \ PKG_SOURCE_VERSION:=$(shell git $(GIT_ARGS) rev-parse $(PKG_SOURCE_BRANCH)) PKG_VERSION:=$(shell git $(GIT_ARGS) describe --abbrev=0 --tags $(PKG_SOURCE_BRANCH) | sed 's/^v//') + +ifeq ($(PKG_VERSION),) +# No version found so we use 9999 instead and count commits since initial commit. +PKG_VERSION:=9999 +PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count $(PKG_SOURCE_VERSION)) +else PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count v$(PKG_VERSION)..$(PKG_SOURCE_VERSION)) +PKG_VERSION:=$(PKG_VERSION).9999 +endif PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME) |