Commit bb460b8f authored by Vitaly Lipatov's avatar Vitaly Lipatov

gremote: add -o option for add origin repo

parent 7bb3a2be
...@@ -7,10 +7,11 @@ load_mod git rpm ...@@ -7,10 +7,11 @@ load_mod git rpm
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "gremote - git remote -v" echo "gremote - git remote -v analogue"
echo "Use: gremote" echo "Use: gremote"
echo "Options:" echo "Options:"
echo " -u USER add path to USER package repo" echo " -u USER add path to USER package repo"
echo " -o add path to the origin repo (/srpms or /gears)"
exit 1 exit 1
fi fi
...@@ -33,6 +34,20 @@ if [ "$1" = "-u" ] ; then ...@@ -33,6 +34,20 @@ if [ "$1" = "-u" ] ; then
exit exit
fi 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
# TODO: add http access support when have no ssh access
docmd git remote add gear $GIRARHOST:$RREPO
exit
fi
test -r "$1" && fatal "Do not need any params more" test -r "$1" && fatal "Do not need any params more"
showcmd git remote -v showcmd git remote -v
......
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