[2/4] scritps/git_hash: change repo to CUSTOM_STR

Message ID 1439201248-12253-3-git-send-email-anders.roxell@linaro.org
State New
Headers show

Commit Message

Anders Roxell Aug. 10, 2015, 10:07 a.m.
other platforms should export CUSTOM_STR in their
platform/<target>/Makefile.am

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 scripts/git_hash.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Maxim Uvarov Aug. 10, 2015, 10:33 a.m. | #1
On 08/10/15 13:07, Anders Roxell wrote:
> other platforms should export CUSTOM_STR in their
> platform/<target>/Makefile.am
It will be nice to that that as commented text in linux-generic 
Makefile.am. So
other people can use it as template.

> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>   scripts/git_hash.sh | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh
> index 48ae24e..6cfec2f 100755
> --- a/scripts/git_hash.sh
> +++ b/scripts/git_hash.sh
> @@ -6,14 +6,14 @@ if [ -z ${1} ]; then
>   fi
>   ROOTDIR=${1}
>   
> -repo=https://git.linaro.org/lng/odp.git
> +CUSTOM_STR=${CUSTOM_STR:-https://git.linaro.org/lng/odp.git}
>   if [ -d ${ROOTDIR}/.git ]; then
>   	hash=$(git describe | tr -d "\n")
>   	if git diff-index --name-only HEAD &>/dev/null ; then
>   		dirty=-dirty
>   	fi
>   
> -	echo -n "'${repo}' (${hash}${dirty})">${ROOTDIR}/.scmversion
> +	echo -n "'${CUSTOM_STR}' (${hash}${dirty})">${ROOTDIR}/.scmversion
>   fi
>   
>   cat ${ROOTDIR}/.scmversion
What do you think about renaming .scmversion to .api_pull_version. or 
.api_pool.

I.e. it can be used not only for tar ball. Like that:
You develop platform X so you have:
platform-x
platform-linux-generic
then pull new API from tag v1.2 (for example), and update 
.api_pull_version in you local branch.
So when you compile your local linux-generic it will be the same version 
as .api_pull_version, not related
how many local tags on top you have there.

Maxim.

Patch

diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh
index 48ae24e..6cfec2f 100755
--- a/scripts/git_hash.sh
+++ b/scripts/git_hash.sh
@@ -6,14 +6,14 @@  if [ -z ${1} ]; then
 fi
 ROOTDIR=${1}
 
-repo=https://git.linaro.org/lng/odp.git
+CUSTOM_STR=${CUSTOM_STR:-https://git.linaro.org/lng/odp.git}
 if [ -d ${ROOTDIR}/.git ]; then
 	hash=$(git describe | tr -d "\n")
 	if git diff-index --name-only HEAD &>/dev/null ; then
 		dirty=-dirty
 	fi
 
-	echo -n "'${repo}' (${hash}${dirty})">${ROOTDIR}/.scmversion
+	echo -n "'${CUSTOM_STR}' (${hash}${dirty})">${ROOTDIR}/.scmversion
 fi
 
 cat ${ROOTDIR}/.scmversion