Commit 85b4ba40 authored by Vitaly Lipatov's avatar Vitaly Lipatov

introduce repos/git, test for it and get_git_url function

introduce check_url, initial_letter functions and use it
parent afd6e840
......@@ -252,14 +252,14 @@ fi
# clone remote git
if [ -n "$CLONEGIT" ] ; then
INITLETTER=$(echo $PKGNAME | cut -c1)
REPOPATH="$(initial_letter $PKGNAME)/$PKGNAME.git"
# http://git.altlinux.org/gears/N/NAME.git
RREPO="/gears/$INITLETTER/$PKGNAME.git"
RREPO="/gears/$REPOPATH"
echo "Remote clone from $RREPO ..."
if ! ssh $GIRARHOST clone $RREPO packages/$PKGNAME.git ; then
# http://git.altlinux.org/srpms/N/NAME.git
RREPO="/srpms/$INITLETTER/$PKGNAME.git"
RREPO="/srpms/$REPOPATH"
echo "Remote clone from $RREPO ..."
ssh $GIRARHOST clone $RREPO packages/$PKGNAME.git || warning "Can't remote clone."
fi
......@@ -267,6 +267,7 @@ if [ -n "$CLONEGIT" ] ; then
git clone git.alt:packages/$PKGNAME.git
if cd $PKGNAME ; then
CURRENTBRANCH=$(get_current_branch)
# create all branches
for i in $(git branch -a | grep -v "/HEAD" | grep "remotes/origin/") ; do
git checkout -b $(echo $i | sed -e "s|remotes.*/||g") $i
done
......
git.alt http://git.altlinux.org
git.eter http://git.etersoft.ru
#!/bin/bash
# 2010 Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
get_git_url()
{
grep "^$1 " $ETERBUILDETC/repos/git | cut -f2 -d" "
}
......@@ -33,3 +33,8 @@ drop_args()
#echo "$ARGS" | \
# ( for i in $LISTIGNORE ; do sed -e "s|-$i||g" ; done ) #| sed -e "s| +| |g"
}
initial_letter()
{
echo $1 | cut -c1
}
......@@ -14,3 +14,8 @@ download_url()
which wget >/dev/null || fatal "Can't download, wget command is missed"
a= wget -c -t 1 -T 30 "$1"
}
check_url()
{
$GET -d "$1"
}
#!/bin/sh
. `dirname $0`/../share/eterbuild/functions/common
load_mod web strings repos
check()
{
[ "$2" != "$3" ] && echo "FATAL with '$1': result '$3' do not match with '$2'" || echo "OK for '$1' with '$2'"
}
check git.alt "http://git.altlinux.org" $(get_git_url git.alt)
check git.eter "http://git.etersoft.ru" $(get_git_url git.eter)
check git.some "" $(get_git_url git.some)
test_repo()
{
local PKGNAME=$2
local REPOPATH=$(initial_letter $PKGNAME)/$PKGNAME.git
local URL=$(get_git_url $1)/$3/$REPOPATH
check_url "$URL" && echo "OK with $URL" || echo "URL $URL does not exists"
}
test_repo git.alt testdisk gears
test_repo git.alt testdisk srpms
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