diff mbox

linux-generic: move git_hash.sh under linux-generic directory

Message ID CAK--WWN2t8B1BtVCFhcviUTJt1RcWhc_DoMNTCjLv+=JpiK52Q@mail.gmail.com
State New
Headers show

Commit Message

Anders Roxell Aug. 3, 2015, 12:52 p.m. UTC
On 3 August 2015 at 13:35, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> git_hash.sh is used to generate version string. Each platform
> should have it's own version of that script.

I don't think we need to move the files isn't it enough to just do:



and then just export repo from the platform/<target>/Makefile.am

Cheers,
Anders

>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> ---
>  configure.ac                                            | 2 +-
>  platform/Makefile.inc                                   | 2 +-
>  {scripts => platform/linux-generic/scripts}/Makefile.am | 0
>  {scripts => platform/linux-generic/scripts}/git_hash.sh | 0
>  4 files changed, 2 insertions(+), 2 deletions(-)
>  rename {scripts => platform/linux-generic/scripts}/Makefile.am (100%)
>  rename {scripts => platform/linux-generic/scripts}/git_hash.sh (100%)
>
> diff --git a/configure.ac b/configure.ac
> index 24a3fa1..8b535be 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -300,7 +300,7 @@ AC_CONFIG_FILES([Makefile
>                  pkgconfig/libodphelper.pc
>                  platform/linux-generic/Makefile
>                  platform/linux-generic/test/pktio/Makefile
> -                scripts/Makefile
> +                platform/linux-generic/scripts/Makefile
>                  test/Makefile
>                  test/api_test/Makefile
>                  test/performance/Makefile
> diff --git a/platform/Makefile.inc b/platform/Makefile.inc
> index f64e37c..f26a8c5 100644
> --- a/platform/Makefile.inc
> +++ b/platform/Makefile.inc
> @@ -12,6 +12,6 @@ lib_LTLIBRARIES = $(LIB)/libodp.la
>
>  AM_LDFLAGS += -version-number '$(ODP_LIBSO_VERSION)'
>
> -GIT_DESC = `$(top_srcdir)/scripts/git_hash.sh`
> +GIT_DESC = `$(top_srcdir)/platform/linux-generic/scripts/git_hash.sh`
>  AM_CFLAGS += "-DGIT_HASH=$(GIT_DESC)"
>  AM_CFLAGS += -DPLATFORM=${with_platform}
> diff --git a/scripts/Makefile.am b/platform/linux-generic/scripts/Makefile.am
> similarity index 100%
> rename from scripts/Makefile.am
> rename to platform/linux-generic/scripts/Makefile.am
> diff --git a/scripts/git_hash.sh b/platform/linux-generic/scripts/git_hash.sh
> similarity index 100%
> rename from scripts/git_hash.sh
> rename to platform/linux-generic/scripts/git_hash.sh
> --
> 1.9.1
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp

Comments

Maxim Uvarov Aug. 3, 2015, 1:05 p.m. UTC | #1
On 08/03/15 15:52, Anders Roxell wrote:
> On 3 August 2015 at 13:35, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>> git_hash.sh is used to generate version string. Each platform
>> should have it's own version of that script.
> I don't think we need to move the files isn't it enough to just do:
>
> diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh
> index c9f1faf..1b55ddb 100755
> --- a/scripts/git_hash.sh
> +++ b/scripts/git_hash.sh
> @@ -1,6 +1,6 @@
>   #!/bin/bash
>
> -repo=https://git.linaro.org/lng/odp.git
> +repo=${repo:-https://git.linaro.org/lng/odp.git}
>   hash=$(git describe | tr -d "\n")
>   if git diff-index --name-only HEAD &>/dev/null ; then
>          dirty=-dirty
>
>
> and then just export repo from the platform/<target>/Makefile.am
>
> Cheers,
> Anders

That is custom string and might be other platform will not want to 
provide repo. And with multi platform repo
there will be conflict with tags. So that script is useful only for 
linux-generic. That is why I decided to move in under platform.

Maxim.

>
>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>> ---
>>   configure.ac                                            | 2 +-
>>   platform/Makefile.inc                                   | 2 +-
>>   {scripts => platform/linux-generic/scripts}/Makefile.am | 0
>>   {scripts => platform/linux-generic/scripts}/git_hash.sh | 0
>>   4 files changed, 2 insertions(+), 2 deletions(-)
>>   rename {scripts => platform/linux-generic/scripts}/Makefile.am (100%)
>>   rename {scripts => platform/linux-generic/scripts}/git_hash.sh (100%)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 24a3fa1..8b535be 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -300,7 +300,7 @@ AC_CONFIG_FILES([Makefile
>>                   pkgconfig/libodphelper.pc
>>                   platform/linux-generic/Makefile
>>                   platform/linux-generic/test/pktio/Makefile
>> -                scripts/Makefile
>> +                platform/linux-generic/scripts/Makefile
>>                   test/Makefile
>>                   test/api_test/Makefile
>>                   test/performance/Makefile
>> diff --git a/platform/Makefile.inc b/platform/Makefile.inc
>> index f64e37c..f26a8c5 100644
>> --- a/platform/Makefile.inc
>> +++ b/platform/Makefile.inc
>> @@ -12,6 +12,6 @@ lib_LTLIBRARIES = $(LIB)/libodp.la
>>
>>   AM_LDFLAGS += -version-number '$(ODP_LIBSO_VERSION)'
>>
>> -GIT_DESC = `$(top_srcdir)/scripts/git_hash.sh`
>> +GIT_DESC = `$(top_srcdir)/platform/linux-generic/scripts/git_hash.sh`
>>   AM_CFLAGS += "-DGIT_HASH=$(GIT_DESC)"
>>   AM_CFLAGS += -DPLATFORM=${with_platform}
>> diff --git a/scripts/Makefile.am b/platform/linux-generic/scripts/Makefile.am
>> similarity index 100%
>> rename from scripts/Makefile.am
>> rename to platform/linux-generic/scripts/Makefile.am
>> diff --git a/scripts/git_hash.sh b/platform/linux-generic/scripts/git_hash.sh
>> similarity index 100%
>> rename from scripts/git_hash.sh
>> rename to platform/linux-generic/scripts/git_hash.sh
>> --
>> 1.9.1
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
Anders Roxell Aug. 4, 2015, 6:30 p.m. UTC | #2
On 3 August 2015 at 15:05, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> On 08/03/15 15:52, Anders Roxell wrote:
>>
>> On 3 August 2015 at 13:35, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>>>
>>> git_hash.sh is used to generate version string. Each platform
>>> should have it's own version of that script.
>>
>> I don't think we need to move the files isn't it enough to just do:
>>
>> diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh
>> index c9f1faf..1b55ddb 100755
>> --- a/scripts/git_hash.sh
>> +++ b/scripts/git_hash.sh
>> @@ -1,6 +1,6 @@
>>   #!/bin/bash
>>
>> -repo=https://git.linaro.org/lng/odp.git
>> +repo=${repo:-https://git.linaro.org/lng/odp.git}
>>   hash=$(git describe | tr -d "\n")
>>   if git diff-index --name-only HEAD &>/dev/null ; then
>>          dirty=-dirty
>>
>>
>> and then just export repo from the platform/<target>/Makefile.am
>>
>> Cheers,
>> Anders
>
>
> That is custom string and might be other platform will not want to provide
> repo. And with multi platform repo
> there will be conflict with tags. So that script is useful only for
> linux-generic. That is why I decided to move in under platform.

I'm still not convinced... However, before we do more with this patch I think
we should fix problem we get when we build from the tarball.
We are using git but the tarball isn't a git repo...

Cheers,
Anders

>
> Maxim.
>
>
>>
>>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>>> ---
>>>   configure.ac                                            | 2 +-
>>>   platform/Makefile.inc                                   | 2 +-
>>>   {scripts => platform/linux-generic/scripts}/Makefile.am | 0
>>>   {scripts => platform/linux-generic/scripts}/git_hash.sh | 0
>>>   4 files changed, 2 insertions(+), 2 deletions(-)
>>>   rename {scripts => platform/linux-generic/scripts}/Makefile.am (100%)
>>>   rename {scripts => platform/linux-generic/scripts}/git_hash.sh (100%)
>>>
>>> diff --git a/configure.ac b/configure.ac
>>> index 24a3fa1..8b535be 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -300,7 +300,7 @@ AC_CONFIG_FILES([Makefile
>>>                   pkgconfig/libodphelper.pc
>>>                   platform/linux-generic/Makefile
>>>                   platform/linux-generic/test/pktio/Makefile
>>> -                scripts/Makefile
>>> +                platform/linux-generic/scripts/Makefile
>>>                   test/Makefile
>>>                   test/api_test/Makefile
>>>                   test/performance/Makefile
>>> diff --git a/platform/Makefile.inc b/platform/Makefile.inc
>>> index f64e37c..f26a8c5 100644
>>> --- a/platform/Makefile.inc
>>> +++ b/platform/Makefile.inc
>>> @@ -12,6 +12,6 @@ lib_LTLIBRARIES = $(LIB)/libodp.la
>>>
>>>   AM_LDFLAGS += -version-number '$(ODP_LIBSO_VERSION)'
>>>
>>> -GIT_DESC = `$(top_srcdir)/scripts/git_hash.sh`
>>> +GIT_DESC = `$(top_srcdir)/platform/linux-generic/scripts/git_hash.sh`
>>>   AM_CFLAGS += "-DGIT_HASH=$(GIT_DESC)"
>>>   AM_CFLAGS += -DPLATFORM=${with_platform}
>>> diff --git a/scripts/Makefile.am
>>> b/platform/linux-generic/scripts/Makefile.am
>>> similarity index 100%
>>> rename from scripts/Makefile.am
>>> rename to platform/linux-generic/scripts/Makefile.am
>>> diff --git a/scripts/git_hash.sh
>>> b/platform/linux-generic/scripts/git_hash.sh
>>> similarity index 100%
>>> rename from scripts/git_hash.sh
>>> rename to platform/linux-generic/scripts/git_hash.sh
>>> --
>>> 1.9.1
>>>
>>> _______________________________________________
>>> lng-odp mailing list
>>> lng-odp@lists.linaro.org
>>> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
diff mbox

Patch

diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh
index c9f1faf..1b55ddb 100755
--- a/scripts/git_hash.sh
+++ b/scripts/git_hash.sh
@@ -1,6 +1,6 @@ 
 #!/bin/bash

-repo=https://git.linaro.org/lng/odp.git
+repo=${repo:-https://git.linaro.org/lng/odp.git}
 hash=$(git describe | tr -d "\n")
 if git diff-index --name-only HEAD &>/dev/null ; then
        dirty=-dirty