Commit d08ec05f authored by Vitaly Lipatov's avatar Vitaly Lipatov

implement gitery support and git host detection

parent 800556d6
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
# GIRAR_USER=lav # GIRAR_USER=lav
# default girar ssh alias # default girar ssh alias
# autodetect gitery, git.alt if not set here
# GIRARHOST=git.alt # GIRARHOST=git.alt
# Skip error if there are unpackaged files in the build # Skip error if there are unpackaged files in the build
......
git.alt http://git.altlinux.org git.alt http://git.altlinux.org
gitery http://git.altlinux.org
git.eter http://git.etersoft.ru git.eter http://git.etersoft.ru
# ALT Linux # ALT Linux
git.alt sisyphus rsync.altlinux.org::ALTLinux/Sisyphus git.alt sisyphus rsync.altlinux.org::ALTLinux/Sisyphus
git.alt p10 rsync.altlinux.org::ALTLinux/p10/branch
git.alt p9 rsync.altlinux.org::ALTLinux/p9/branch
git.alt p8 rsync.altlinux.org::ALTLinux/p8/branch git.alt p8 rsync.altlinux.org::ALTLinux/p8/branch
git.alt p7 rsync.altlinux.org::ALTLinux/p7/branch git.alt p7 rsync.altlinux.org::ALTLinux/p7/branch
git.alt p6 rsync.altlinux.org::ALTLinux/p6/branch git.alt p6 rsync.altlinux.org::ALTLinux/p6/branch
......
...@@ -61,7 +61,8 @@ CURRENTBRANCHNAME="M80" ...@@ -61,7 +61,8 @@ CURRENTBRANCHNAME="M80"
[ -n "$DEBUG" ] && HASHERARG="-v $HASHERARG" [ -n "$DEBUG" ] && HASHERARG="-v $HASHERARG"
#SSH_KEYFILE=~/.ssh/id_dsa #SSH_KEYFILE=~/.ssh/id_dsa
GIRARHOST=git.alt # by default will detect gitery, git.alt in ~/.ssh/config
#GIRARHOST=git.alt
# Timeout in sec for ssh commands # Timeout in sec for ssh commands
SSHTIMEOUT=300 SSHTIMEOUT=300
......
...@@ -72,6 +72,7 @@ normalize_girar_name() ...@@ -72,6 +72,7 @@ normalize_girar_name()
# Check if $1 like git.alt or git.eter, git.something # Check if $1 like git.alt or git.eter, git.something
is_girar_name() is_girar_name()
{ {
rhas "$1" "^gitery" && return
rhas "$1" "^git\." rhas "$1" "^git\."
} }
...@@ -94,12 +95,20 @@ set_gear_host() ...@@ -94,12 +95,20 @@ set_gear_host()
assert_var GIRARHOST assert_var GIRARHOST
GITHOST="$GIRARHOST" GITHOST="$GIRARHOST"
GEARHOST="$GITHOST" GEARHOST="$GITHOST"
[ "$GEARHOST" = "gitery" ] && GEARHOST="gyle" && return
if [ ! "$GEARHOST" = "git.eter" ] ; then if [ ! "$GEARHOST" = "git.eter" ] ; then
GEARHOST="${GITHOST/git./gear.}" GEARHOST="${GITHOST/git./gear.}"
fi fi
return 0 return 0
} }
# copied from giter
get_girar_host_from_ssh()
{
grep -i "host[\t ]\+" ~/.ssh/config 2>/dev/null | sed "s|.*host[\t ]*||gi" | grep -m1 "^gitery *$" && return
grep -i "host[\t ]\+" ~/.ssh/config 2>/dev/null | sed "s|.*host[\t ]*||gi" | grep -m1 "^git\."
}
# Try autodetect GIRARHOST. Return true, if get it from arg (need for shift args) # Try autodetect GIRARHOST. Return true, if get it from arg (need for shift args)
set_girar_host() set_girar_host()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment