Skip to content
Snippets Groups Projects
Commit 1c89f616 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

build: add support for .scmversion files for GLUON_VERSION and GLUON_SITE_VERSION

Sometimes it is useful to override the default version detection, for
example when local patches are applied to a repo. Allow providing a
version number using a file called .scmversion, which is the same that
the Linux kernel and U-Boot use.
parent b5db6435
No related branches found
No related tags found
No related merge requests found
...@@ -7,3 +7,4 @@ ...@@ -7,3 +7,4 @@
.bash_history .bash_history
.subversion .subversion
.wget-hsts .wget-hsts
/.scmversion
...@@ -88,3 +88,17 @@ update.sh ...@@ -88,3 +88,17 @@ update.sh
source and installs it into *packages/* directory. It simply tries to set the *base* source and installs it into *packages/* directory. It simply tries to set the *base*
branch of the cloned repo to the correct commit. If this fails it fetches the branch of the cloned repo to the correct commit. If this fails it fetches the
upstream branch and tries again to set the local *base* branch. upstream branch and tries again to set the local *base* branch.
getversion.sh
Used to determine the version numbers of the repositories of Gluon and the
site configuraiton, to be included in the built firmware images as
*/lib/gluon/gluon-version* and */lib/gluon/site-version*.
By default, this uses ``git describe`` to generate a version number based
on the last git tag. This can be overridden by putting a file called
*.scmversion* into the root of the respective repositories.
A command like ``rm -f .scmversion; echo "$(./scripts/getversion.sh .)" > .scmversion``
can be used before applying local patches to ensure that the reported
version numbers refer to an upstream commit ID rather than an arbitrary
local one after ``git am``.
...@@ -7,6 +7,7 @@ fi ...@@ -7,6 +7,7 @@ fi
cd "$1" || exit 1 cd "$1" || exit 1
cat .scmversion 2>/dev/null && exit 0
git --git-dir=.git describe --always --abbrev=7 --dirty=+ 2>/dev/null && exit 0 git --git-dir=.git describe --always --abbrev=7 --dirty=+ 2>/dev/null && exit 0
echo unknown echo unknown
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment