aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-02-16 19:53:17 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-02-16 19:53:17 +0000
commit25dc20a25946fa3187eeba65a96ff292e8a88359 (patch)
tree8547861febda8bbc5961d22d252dfbb5fce27778
parent61d9f92240373466e160867e97a5b4ea7af8c96e (diff)
downloadpaludis-25dc20a25946fa3187eeba65a96ff292e8a88359.tar.gz
paludis-25dc20a25946fa3187eeba65a96ff292e8a88359.tar.xz
Use git remote rather than git config to determine the current origin URL. Support https for darcs, git and tar, and rsync for git. See: ticket:511
-rw-r--r--paludis/syncers/Makefile.am12
-rw-r--r--paludis/syncers/dodarcs.in4
-rw-r--r--paludis/syncers/dogit.in10
3 files changed, 16 insertions, 10 deletions
diff --git a/paludis/syncers/Makefile.am b/paludis/syncers/Makefile.am
index 8417b08..b72ed13 100644
--- a/paludis/syncers/Makefile.am
+++ b/paludis/syncers/Makefile.am
@@ -1,5 +1,5 @@
MAINTAINERCLEANFILES = Makefile.in
-CLEANFILES = *~ .keep docvs+ext docvs+pserver docvs+ssh dodarcs+file dodarcs+http dodarcs+ssh dofile dogit dogit+file dogit+http dogit+ssh dorsync dosvn dosvn+file dosvn+http dosvn+https dosvn+ssh dotar+file dotar+ftp dotar+http
+CLEANFILES = *~ .keep docvs+ext docvs+pserver docvs+ssh dodarcs+file dodarcs+http dodarcs+https dodarcs+ssh dofile dogit dogit+file dogit+http dogit+https dogit+rsync dogit+ssh dorsync dosvn dosvn+file dosvn+http dosvn+https dosvn+ssh dotar+file dotar+ftp dotar+http dotar+https
SUBDIRS = .
.keep :
@@ -13,11 +13,14 @@ libexecprog_SCRIPTS = \
docvs+ssh \
dodarcs+file \
dodarcs+http \
+ dodarcs+https \
dodarcs+ssh \
dofile \
dogit \
dogit+file \
dogit+http \
+ dogit+https \
+ dogit+rsync \
dogit+ssh \
dorsync \
dosvn \
@@ -28,6 +31,7 @@ libexecprog_SCRIPTS = \
dotar+file \
dotar+ftp \
dotar+http \
+ dotar+https \
dodummy
TESTS_ENVIRONMENT = env \
@@ -49,15 +53,15 @@ AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
docvs+ext docvs+pserver docvs+ssh : docvs.in
cat $? > $@
-dodarcs+file dodarcs+http dodarcs+ssh : dodarcs.in
+dodarcs+file dodarcs+http dodarcs+https dodarcs+ssh : dodarcs.in
cat $? > $@
-dogit dogit+file dogit+http dogit+ssh : dogit.in
+dogit dogit+file dogit+http dogit+https dogit+rsync dogit+ssh : dogit.in
cat $? > $@
dofile dorsync : dorsync.in
cat $? > $@
dosvn dosvn+file dosvn+http dosvn+https dosvn+ssh : dosvn.in
cat $? > $@
-dotar+file dotar+ftp dotar+http : dotar.in
+dotar+file dotar+ftp dotar+http dotar+https : dotar.in
cat $? > $@
built-sources : $(BUILT_SOURCES)
diff --git a/paludis/syncers/dodarcs.in b/paludis/syncers/dodarcs.in
index 67e69a9..64bde51 100644
--- a/paludis/syncers/dodarcs.in
+++ b/paludis/syncers/dodarcs.in
@@ -30,8 +30,8 @@ while [[ $# -gt 0 ]]; do
PROTO="${0##*/do}"
if [[ "${PROTO}" == darcs+ssh ]]; then
echo " URL syntax: darcs+ssh://[USERNAME[:PASSWORD]@]SERVER:/PATH"
- elif [[ "${PROTO}" == darcs+http ]]; then
- echo " URL syntax: darcs+http://[USERNAME[:PASSWORD]@]SERVER[:PORT]/PATH"
+ elif [[ "${PROTO}" == darcs+http || "${PROTO}" == darcs+https ]]; then
+ echo " URL syntax: ${PROTO}://[USERNAME[:PASSWORD]@]SERVER[:PORT]/PATH"
elif [[ "${PROTO}" == darcs+file ]]; then
echo " URL syntax: darcs+file:///PATH"
else
diff --git a/paludis/syncers/dogit.in b/paludis/syncers/dogit.in
index 909cda7..5005a1d 100644
--- a/paludis/syncers/dogit.in
+++ b/paludis/syncers/dogit.in
@@ -32,10 +32,12 @@ while [[ $# -gt 0 ]]; do
echo " URL syntax: git://SERVER/PATH"
elif [[ "${PROTO}" == git+ssh ]]; then
echo " URL syntax: git+ssh://[USERNAME[:PASSWORD]@]SERVER/PATH"
- elif [[ "${PROTO}" == git+http ]]; then
- echo " URL syntax: git+http://[USERNAME[:PASSWORD]@]SERVER[:PORT]/PATH"
+ elif [[ "${PROTO}" == git+http || "${PROTO}" == git+https ]]; then
+ echo " URL syntax: ${PROTO}://[USERNAME[:PASSWORD]@]SERVER[:PORT]/PATH"
elif [[ "${PROTO}" == git+file ]]; then
echo " URL syntax: git+file:///PATH"
+ elif [[ "${PROTO}" == git+rsync ]]; then
+ echo " URL syntax: git+rsync://[USERNAME@]SERVER[:PORT]/PATH"
else
ewarn "URL syntax for ${PROTO} is unknown. This script will likely not work with the ${PROTO} protocol"
fi
@@ -73,7 +75,7 @@ elif [[ -z "${REMOTE}" ]]; then
exit 1
fi
-[[ "${REMOTE}" == git+http* ]] && REMOTE="${REMOTE#git+}"
+[[ "${REMOTE}" == git+http* || "${REMOTE}" == git+rsync* ]] && REMOTE="${REMOTE#git+}"
REMOTE="${REMOTE#git+file://}"
if [[ -d "${LOCAL}" && ! -d "${LOCAL}/.git" ]]; then
@@ -83,7 +85,7 @@ fi
if [[ -d "${LOCAL}" ]]; then
cd "${LOCAL}"
- OLD_REMOTE="$(${GIT_WRAPPER} git config remote.origin.url)"
+ OLD_REMOTE="$(${GIT_WRAPPER} git remote show -n origin | sed -ne 's/^ *URL: //p')"
if [[ "${OLD_REMOTE}" != "${REMOTE}" ]]; then
if ! ${GIT_WRAPPER} git config remote.origin.url "${REMOTE}"; then
eerror "${0}: could not switch from '${OLD_REMOTE}' to '${REMOTE}'"