diff mbox series

[kteam-tools] git-build-kernel: Don't hard-code the location of the build script

Message ID 20180326144032.28726-1-juergh@canonical.com
State New
Headers show
Series [kteam-tools] git-build-kernel: Don't hard-code the location of the build script | expand

Commit Message

Juerg Haefliger March 26, 2018, 2:40 p.m. UTC
Instead, deduce its location from the location of the post-receive hook.
With this, one can use a local build script, for example for testing or
special builds.

Signed-off-by: Juerg Haefliger <juergh@canonical.com>
---
 git-build-kernel/post-receive | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Juerg Haefliger April 20, 2018, 7:12 a.m. UTC | #1
Ping.

On 03/26/2018 04:40 PM, Juerg Haefliger wrote:
> Instead, deduce its location from the location of the post-receive hook.
> With this, one can use a local build script, for example for testing or
> special builds.
> 
> Signed-off-by: Juerg Haefliger <juergh@canonical.com>
> ---
>  git-build-kernel/post-receive | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/git-build-kernel/post-receive b/git-build-kernel/post-receive
> index dd8451f35dd5..43671f97a82a 100755
> --- a/git-build-kernel/post-receive
> +++ b/git-build-kernel/post-receive
> @@ -2,8 +2,9 @@
>  # .git/hooks/post-receive --> git-build-kernel automatic push builder
>  # Kamal Mostafa <kamal@canonical.com>
>  
> -### directory containing the git-build-kernel script
> -GBK_DIR=/usr3/ubuntu/kteam-tools/git-build-kernel
> +### directory containing the git-build-kernel script (the same directory where
> +### the post-receive hook is located)
> +GBK_DIR="$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")"
>  
>  option_only_build_refs_build=0
>  option_only_build_predefined_refs=1
>
Stefan Bader April 20, 2018, 7:34 a.m. UTC | #2
On 20.04.2018 09:12, Juerg Haefliger wrote:
> Ping.
> 
> On 03/26/2018 04:40 PM, Juerg Haefliger wrote:
>> Instead, deduce its location from the location of the post-receive hook.
>> With this, one can use a local build script, for example for testing or
>> special builds.
>>
>> Signed-off-by: Juerg Haefliger <juergh@canonical.com>
>> ---

It would seem to be ok and work for me. *If* the instructions were clear enough
to make the hook always a softlink and noting else (like copy).

-Stefan

>>  git-build-kernel/post-receive | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/git-build-kernel/post-receive b/git-build-kernel/post-receive
>> index dd8451f35dd5..43671f97a82a 100755
>> --- a/git-build-kernel/post-receive
>> +++ b/git-build-kernel/post-receive
>> @@ -2,8 +2,9 @@
>>  # .git/hooks/post-receive --> git-build-kernel automatic push builder
>>  # Kamal Mostafa <kamal@canonical.com>
>>  
>> -### directory containing the git-build-kernel script
>> -GBK_DIR=/usr3/ubuntu/kteam-tools/git-build-kernel
>> +### directory containing the git-build-kernel script (the same directory where
>> +### the post-receive hook is located)
>> +GBK_DIR="$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")"
>>  
>>  option_only_build_refs_build=0
>>  option_only_build_predefined_refs=1
>>
> 
> 
> 
>
diff mbox series

Patch

diff --git a/git-build-kernel/post-receive b/git-build-kernel/post-receive
index dd8451f35dd5..43671f97a82a 100755
--- a/git-build-kernel/post-receive
+++ b/git-build-kernel/post-receive
@@ -2,8 +2,9 @@ 
 # .git/hooks/post-receive --> git-build-kernel automatic push builder
 # Kamal Mostafa <kamal@canonical.com>
 
-### directory containing the git-build-kernel script
-GBK_DIR=/usr3/ubuntu/kteam-tools/git-build-kernel
+### directory containing the git-build-kernel script (the same directory where
+### the post-receive hook is located)
+GBK_DIR="$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")"
 
 option_only_build_refs_build=0
 option_only_build_predefined_refs=1