[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: git-buildpackage interface change and use in .mrconfig



-=| Csillag Tamas, 27.06.2013 09:06:04 +0200 |=-
> What do you think about this one?
> 
> -----------------------------------
> 
> diff --git a/.mrconfig b/.mrconfig
> index 4d2e509..6b1150e 100644
> --- a/.mrconfig
> +++ b/.mrconfig
> @@ -4,10 +4,18 @@ lib=
>          echo "I: $1"
>        }
>        git_checkout () {
> -        gbp-clone --all git+ssh://git.debian.org/git/pkg-perl/packages/$1.git
> +        if [ -e /usr/bin/gbp ]; then
> +          gbp clone --all git+ssh://git.debian.org/git/pkg-perl/packages/$1.git
> +        else
> +          gbp-clone --all git+ssh://git.debian.org/git/pkg-perl/packages/$1.git
> +        fi
>        }
>        git_update() {
> -        gbp-pull --pristine-tar
> +        if [ -e /usr/bin/gbp ]; then
> +          gbp pull --pristine-tar
> +        else
> +          gbp-pull --pristine-tar
> +        fi
>        }
>        git_checkout_special() {
>          git clone git+ssh://git.debian.org/git/pkg-perl/$1.git
>  
> -----------------------------------

Supporting both versions sounds like a good thing to me exactly 
because of the potential wheezy users. Here's my take, which is 
basically the same as above, but with centralized gbp existence 
checking:


diff --git a/.mrconfig b/.mrconfig
index 3a6c656..8dcb80a 100644
--- a/.mrconfig
+++ b/.mrconfig
@@ -3,11 +3,20 @@ lib=
       msg () {
         echo "I: $1"
       }
+      gbp () {
+        if [ -x /usr/bin/gbp ]; then
+          /usr/bin/gbp "$@"
+        else
+          local sub_cmd="$1"
+          shift
+          /usr/bin/gbp-"$sub_cmd" "$@"
+        fi
+      }
       git_checkout () {
-        gbp-clone --all git+ssh://git.debian.org/git/pkg-perl/packages/$1.git
+        gbp clone --all git+ssh://git.debian.org/git/pkg-perl/packages/$1.git
       }
       git_update() {
-        gbp-pull --pristine-tar
+        gbp pull --pristine-tar
       }
       git_checkout_special() {
         git clone git+ssh://git.debian.org/git/pkg-perl/$1.git

Attachment: signature.asc
Description: Digital signature


Reply to: