aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-01-17 17:10:20 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-01-17 17:10:20 +0000
commit83cf7b602d9595658609cf621b823a6a5ed30e89 (patch)
tree32c7e705b9e5ddbb6795a557d3620d65680ac1be
parentfa2f1091fad2d4a376c6ab2bb834712fb9610771 (diff)
downloadpaludis-83cf7b602d9595658609cf621b823a6a5ed30e89.tar.gz
paludis-83cf7b602d9595658609cf621b823a6a5ed30e89.tar.xz
Support git+file://, and keep "origin" up to date.
-rw-r--r--paludis/syncers/Makefile.am5
-rwxr-xr-x[-rw-r--r--]paludis/syncers/dogit.in7
2 files changed, 9 insertions, 3 deletions
diff --git a/paludis/syncers/Makefile.am b/paludis/syncers/Makefile.am
index 85627d2..5d95470 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+http dodarcs+ssh dofile dogit dogit+http dogit+ssh dorsync dosvn dosvn+http dosvn+https dosvn+ssh dotar+file dotar+ftp dotar+http
+CLEANFILES = *~ .keep docvs+ext docvs+pserver docvs+ssh dodarcs+http dodarcs+ssh dofile dogit dogit+file dogit+http dogit+ssh dorsync dosvn dosvn+http dosvn+https dosvn+ssh dotar+file dotar+ftp dotar+http
SUBDIRS = .
.keep :
@@ -15,6 +15,7 @@ libexecprog_SCRIPTS = \
dodarcs+ssh \
dofile \
dogit \
+ dogit+file \
dogit+http \
dogit+ssh \
dorsync \
@@ -48,7 +49,7 @@ docvs+ext docvs+pserver docvs+ssh : docvs.in
cat $? > $@
dodarcs+http dodarcs+ssh : dodarcs.in
cat $? > $@
-dogit dogit+http dogit+ssh : dogit.in
+dogit dogit+file dogit+http dogit+ssh : dogit.in
cat $? > $@
dofile dorsync : dorsync.in
cat $? > $@
diff --git a/paludis/syncers/dogit.in b/paludis/syncers/dogit.in
index 52492fa..1fd14f1 100644..100755
--- a/paludis/syncers/dogit.in
+++ b/paludis/syncers/dogit.in
@@ -34,6 +34,8 @@ while [[ $# -gt 0 ]]; do
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+file ]]; then
+ echo " URL syntax: git+file:///PATH"
else
ewarn "URL syntax for ${PROTO} is unknown. This script will likely not work with the ${PROTO} protocol"
fi
@@ -72,6 +74,7 @@ elif [[ -z "${REMOTE}" ]]; then
fi
[[ "${REMOTE}" == git+http* ]] && REMOTE="${REMOTE#git+}"
+REMOTE="${REMOTE#git+file://}"
if [[ -d "${LOCAL}" && ! -d "${LOCAL}/.git" ]]; then
eerror "'${LOCAL}' exists but it is not a Git repository"
@@ -79,7 +82,9 @@ if [[ -d "${LOCAL}" && ! -d "${LOCAL}/.git" ]]; then
fi
if [[ -d "${LOCAL}/.git" ]]; then
- cd "${LOCAL}" && ${GIT_WRAPPER} git pull "${GIT_PULL_OPTIONS[@]}" "${REMOTE}"
+ cd "${LOCAL}" \
+ && ${GIT_WRAPPER} git config remote.origin.url "${REMOTE}" \
+ && ${GIT_WRAPPER} git pull "${GIT_PULL_OPTIONS[@]}"
else
${GIT_WRAPPER} git clone "${GIT_CLONE_OPTIONS[@]}" "${REMOTE}" "${LOCAL}"
fi