Commit 6ad4d475 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmgp: rewrite via giter, use full paths

parent bcb0ab9f
......@@ -306,38 +306,28 @@ git_clone()
# clone remote git
if [ -n "$CLONEGIT" ] ; then
# http://git.altlinux.org/gears/N/NAME.git
REPOPATH="$(initial_letter $PKGNAME)/$PKGNAME.git"
RREPO="/gears/$REPOPATH"
# FIXME: use giter print girar repo?
# TODO: check appropriate repo with exist_git_repo
if [ -z "$MIGRATEGIRAR" ] ; then
if ! git_clone $RREPO ; then
# http://git.altlinux.org/srpms/N/NAME.git
RREPO="/srpms/$REPOPATH"
if ! git_clone $RREPO ; then
fatal "$PKGNAME does not exists in $GIRARHOST:/gears, nor in $GIRARHOST:/srpms. Can't clone."
fi
fi
RREPO=$(giter $GITHOST print girar pubrepo $PKGNAME) || fatal "$PKGNAME does not exists in $GIRARHOST:/gears, nor in $GIRARHOST:/srpms. Can't clone."
git_clone $RREPO || fatal "Can't clone $RREPO for $PKGNAME"
if cd $PKGNAME ; then
docmd git remote rename origin gear
cd - >/dev/null
fi
else
[ -z "$PUBLICACCESS" ] || fatal "Can't remote clone via public access"
RREPO=$(giter print girar repo $PKGNAME) || fatal "$PKGNAME does not exists in $GIRARHOST:/gears, nor in $GIRARHOST:/srpms. Can't clone."
RREPO=$(giter $GITHOST print girar pubrepo $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
GITUSER=$(giter $GITHOST print girar user)
UREPO=$(giter $GITHOST print girar userrepo $GITUSER $PKGNAME)
docmd git clone $GIRARHOST:$UREPO
if cd $PKGNAME ; then
# add remotes
docmd git remote rename origin $GIRARHOST && docmd 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
fi
fi
......@@ -404,7 +394,7 @@ if [ -n "$CHECKONLINE" ] ; then
# FIXME: we have a function to get correct url
local GIRARURL=$(get_git_url $GITHOST)
[ -n "$GIRARURL" ] || fatal "Can't get public URL for $GIRHOST"
GITURL="${GIRARURL}people/$GIRAR_USER/packages/$PKGNAME.git"
GITURL=${GIRARURL}$(giter $GITHOST print girar userrepo $GIRAR_USER $PKGNAME)
if $GET -d $GITURL ; then
echog "Published at $GITURL by $GIRAR_USER"
else
......
......@@ -22,7 +22,7 @@ BuildArchitectures: noarch
# Buildreqs note: C compiler is required by rpm-build; we do not require C++ here
BuildRequires: rpm-build-compat >= %altcompat_ver
Requires: giter >= 1.2
Requires: giter >= 1.4
Requires: eepm >= 1.5.0
Requires: erc >= 0.8
......
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