Commit e4e55248 authored by Vitaly Lipatov's avatar Vitaly Lipatov

gremote, rpmgp: use get_girar_repo func

parent 7317b5f5
......@@ -2,8 +2,7 @@
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
load_mod git rpm
#load_mod rpm tarball alt git web buildsrpm
load_mod rpm git girar
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
......@@ -37,12 +36,7 @@ fi
if [ "$1" = "-o" ] ; then
# http://git.altlinux.org/gears/N/NAME.git
PKGNAME=$(get_gear_name)
REPOPATH="$(initial_letter $PKGNAME)/$PKGNAME.git"
RREPO="/gears/$REPOPATH"
if ! is_exist_git_repo $RREPO ; then
RREPO="/srpms/$REPOPATH"
is_exist_git_repo $RREPO || fatal "Can't detect origin repo for $PKGNAME"
fi
RREPO=$(get_girar_repo $PKGNAME) || fatal "Can't detect origin repo for $PKGNAME"
# TODO: add http access support when have no ssh access
docmd git remote add gear $GIRARHOST:$RREPO
exit
......
......@@ -301,7 +301,7 @@ if [ -n "$CLONEGIT" ] ; then
# http://git.altlinux.org/gears/N/NAME.git
REPOPATH="$(initial_letter $PKGNAME)/$PKGNAME.git"
RREPO="/gears/$REPOPATH"
# FIXME: use get_girar_repo?
# TODO: check appropriate repo with exist_git_repo
if [ -z "$MIGRATEGIRAR" ] ; then
if ! git_clone $RREPO ; then
......@@ -317,25 +317,16 @@ if [ -n "$CLONEGIT" ] ; then
fi
else
[ -z "$PUBLICACCESS" ] || fatal "Can't remote clone via public access"
if is_exist_git_repo $RREPO ; then
echo "Remote clone from $RREPO ..."
docmd ssh $GIRARHOST clone $RREPO packages/$PKGNAME.git || warning "Can't remote clone."
else
# http://git.altlinux.org/srpms/N/NAME.git
RREPO="/srpms/$REPOPATH"
if is_exist_git_repo $RREPO ; then
echo "Remote clone from $RREPO ..."
docmd ssh $GIRARHOST clone $RREPO packages/$PKGNAME.git || warning "Can't remote clone."
else
fatal "$PKGNAME does not exists in $GIRARHOST:/gears, nor in $GIRARHOST:/srpms. Can't clone."
fi
fi
RREPO=$(get_girar_repo $PKGNAME) || fatal "$PKGNAME does not exists in $GIRARHOST:/gears, nor in $GIRARHOST:/srpms. Can't clone."
echo "Remote clone from $RREPO ..."
docmd ssh $GIRARHOST clone $RREPO packages/$PKGNAME.git || warning "Can't remote clone."
docmd git clone $GIRARHOST:packages/$PKGNAME.git
if cd $PKGNAME ; then
# add remotes
docmd git remote rename origin $GIRARHOST && docmd git remote add gear $GIRARHOST:$RREPO
docmd git remote rename origin $GIRARHOST && docmd $ETERBUILDBIN/gremote $GIRARHOST -o
cd - >/dev/null
#elif is_exist_remote_repo origin && ! is_exist_remote_repo gears ; then
# git remote -v | grep -q "^origin.*/gears/" && docmd git remote rename origin gears
......
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