Commit e4e55248 authored by Vitaly Lipatov's avatar Vitaly Lipatov

gremote, rpmgp: use get_girar_repo func

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