aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-02-01 20:28:31 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-02-01 20:28:31 +0000
commit02f472efc3ef56df191ddfe3dd393d7521a888a2 (patch)
tree6bd33ffda7c0b51bc34db87e3ab593e7c8f577e5
parent67bd3cba961ed68331c171f2c41620f4ff32d585 (diff)
downloadpaludis-02f472efc3ef56df191ddfe3dd393d7521a888a2.tar.gz
paludis-02f472efc3ef56df191ddfe3dd393d7521a888a2.tar.xz
Make syncers source bashrc, with ${PALUDIS_ACTION} set to sync. Add support for ${RSYNC_WRAPPER}, ${SVN_WRAPPER} etc, similar to ${WGET_WRAPPER}. Specify the URL to git pull, so it can be changed after the initial clone.
-rw-r--r--ebuild/syncers/docvs.in12
-rw-r--r--ebuild/syncers/dodarcs.in12
-rw-r--r--ebuild/syncers/dogit.in10
-rw-r--r--ebuild/syncers/dorsync.in11
-rw-r--r--ebuild/syncers/dosvn.in8
-rw-r--r--ebuild/syncers/dotar.in13
-rw-r--r--paludis/syncer.cc3
7 files changed, 50 insertions, 19 deletions
diff --git a/ebuild/syncers/docvs.in b/ebuild/syncers/docvs.in
index 53d05f8..0c143c4 100644
--- a/ebuild/syncers/docvs.in
+++ b/ebuild/syncers/docvs.in
@@ -2,6 +2,10 @@
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
+for f in ${PALUDIS_BASHRC_FILES}; do
+ [[ -f "${f}" ]] && source "${f}"
+done
+
LOCAL=
REMOTE=
@@ -47,7 +51,7 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
-
+
esac
shift
done
@@ -79,6 +83,8 @@ CVSROOT="${SERVER%:*}"
LOCAL=${LOCAL%/}
WORKING="${LOCAL%/*}"
[[ ! -d "${WORKING}" ]] && mkdir -p "${WORKING}"
-cd "${WORKING}" && ( ! ${PSERVER} || cvs "${CVS_OPTIONS[@]}" -d "${CVSROOT}" login ) &&
- cvs -d "${CVSROOT}" "${CVS_OPTIONS[@]}" checkout -P -d "${LOCAL##*/}" "${CVS_CHECKOUT_OPTIONS[@]}" "${MODULE}"
+cd "${WORKING}" &&
+ ( ! ${PSERVER} || ${CVS_WRAPPER} cvs "${CVS_OPTIONS[@]}" -d "${CVSROOT}" login ) &&
+ ${CVS_WRAPPER} cvs -d "${CVSROOT}" "${CVS_OPTIONS[@]}" checkout \
+ -P -d "${LOCAL##*/}" "${CVS_CHECKOUT_OPTIONS[@]}" "${MODULE}"
diff --git a/ebuild/syncers/dodarcs.in b/ebuild/syncers/dodarcs.in
index cca3245..ef0001e 100644
--- a/ebuild/syncers/dodarcs.in
+++ b/ebuild/syncers/dodarcs.in
@@ -2,6 +2,10 @@
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
+for f in ${PALUDIS_BASHRC_FILES}; do
+ [[ -f "${f}" ]] && source "${f}"
+done
+
LOCAL=
REMOTE=
@@ -55,7 +59,7 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
-
+
esac
shift
done
@@ -77,8 +81,10 @@ if [[ -d "${LOCAL}" && ! -d "${LOCAL}/_darcs" ]]; then
fi
if [[ -d "${LOCAL}/_darcs" ]]; then
- cd "${LOCAL}" && darcs pull --all --set-scripts-executable "${DARCS_PULL_OPTIONS[@]}" "${REMOTE}"
+ cd "${LOCAL}" && ${DARCS_WRAPPER} darcs pull --all \
+ --set-scripts-executable "${DARCS_PULL_OPTIONS[@]}" "${REMOTE}"
else
- darcs get --partial --set-scripts-executable "${DARCS_GET_OPTIONS[@]}" --repo-name="${LOCAL}" "${REMOTE}"
+ ${DARCS_WRAPPER} darcs get --partial --set-scripts-executable \
+ "${DARCS_GET_OPTIONS[@]}" --repo-name="${LOCAL}" "${REMOTE}"
fi
diff --git a/ebuild/syncers/dogit.in b/ebuild/syncers/dogit.in
index 15b711e..7a5d1fd 100644
--- a/ebuild/syncers/dogit.in
+++ b/ebuild/syncers/dogit.in
@@ -2,6 +2,10 @@
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
+for f in ${PALUDIS_BASHRC_FILES}; do
+ [[ -f "${f}" ]] && source "${f}"
+done
+
LOCAL=
REMOTE=
@@ -51,7 +55,7 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
-
+
esac
shift
done
@@ -72,8 +76,8 @@ if [[ -d "${LOCAL}" && ! -d "${LOCAL}/.git" ]]; then
fi
if [[ -d "${LOCAL}/.git" ]]; then
- cd "${LOCAL}" && git pull "${GIT_PULL_OPTIONS[@]}"
+ cd "${LOCAL}" && ${GIT_WRAPPER} git pull "${GIT_PULL_OPTIONS[@]}" "${REMOTE}"
else
- git clone "${GIT_CLONE_OPTIONS[@]}" "${REMOTE}" "${LOCAL}"
+ ${GIT_WRAPPER} git clone "${GIT_CLONE_OPTIONS[@]}" "${REMOTE}" "${LOCAL}"
fi
diff --git a/ebuild/syncers/dorsync.in b/ebuild/syncers/dorsync.in
index 7389c96..e226f43 100644
--- a/ebuild/syncers/dorsync.in
+++ b/ebuild/syncers/dorsync.in
@@ -1,8 +1,11 @@
#!/bin/bash
-
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
+for f in ${PALUDIS_BASHRC_FILES}; do
+ [[ -f "${f}" ]] && source "${f}"
+done
+
LOCAL=
REMOTE=
@@ -64,8 +67,8 @@ fi
REMOTE="${REMOTE#file://}"
-rsync --recursive --links --safe-links --perms --times --compress --force \
- --whole-file --delete --delete-after --stats --timeout=180 \
- --exclude=/distfiles --exclude=/packages --exclude=/local \
+${RSYNC_WRAPPER} rsync --recursive --links --safe-links --perms --times \
+ --compress --force --whole-file --delete --delete-after --stats \
+ --timeout=180 --exclude=/distfiles --exclude=/packages --exclude=/local \
--exclude=/.cache --progress "${RSYNC_OPTIONS[@]}" "${REMOTE}" "${LOCAL}/"
diff --git a/ebuild/syncers/dosvn.in b/ebuild/syncers/dosvn.in
index 0ee372f..45ec0f6 100644
--- a/ebuild/syncers/dosvn.in
+++ b/ebuild/syncers/dosvn.in
@@ -2,6 +2,10 @@
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
+for f in ${PALUDIS_BASHRC_FILES}; do
+ [[ -f "${f}" ]] && source "${f}"
+done
+
LOCAL=
REMOTE=
@@ -44,7 +48,7 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
-
+
esac
shift
done
@@ -59,5 +63,5 @@ fi
[[ "${REMOTE}" == svn+http* ]] && REMOTE="${REMOTE#svn+}"
-svn checkout "${SVN_CHECKOUT_OPTIONS[@]}" "${REMOTE}" "${LOCAL}/"
+${SVN_WRAPPER} svn checkout "${SVN_CHECKOUT_OPTIONS[@]}" "${REMOTE}" "${LOCAL}/"
diff --git a/ebuild/syncers/dotar.in b/ebuild/syncers/dotar.in
index 191235b..d07587a 100644
--- a/ebuild/syncers/dotar.in
+++ b/ebuild/syncers/dotar.in
@@ -2,6 +2,10 @@
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
+for f in ${PALUDIS_BASHRC_FILES}; do
+ [[ -f "${f}" ]] && source "${f}"
+done
+
LOCAL=
REMOTE=
@@ -121,7 +125,8 @@ TARFILE="${URL##*/}"
UNPACKDIR="${TEMP}/repository"
mkdir "${UNPACKDIR}"
-( cd "${UNPACKDIR}" && "${PALUDIS_EBUILD_DIR}/utils/dounpack" "${DOUNPACK_OPTIONS[@]}" "${TEMP}/${TARFILE}" ) || exit $?
+( cd "${UNPACKDIR}" && "${PALUDIS_EBUILD_DIR}/utils/dounpack" \
+ "${DOUNPACK_OPTIONS[@]}" "${TEMP}/${TARFILE}" ) || exit $?
rm "${TEMP}/${TARFILE}"
@@ -132,9 +137,9 @@ if [[ -z "$( ls -A "${UNPACKDIR}" )" ]]; then
fi
[[ -d "${LOCAL}" ]] || mkdir -p "${LOCAL}"
-rsync --recursive --links --safe-links --perms --times --compress --force \
- --whole-file --delete --delete-after --stats --timeout=180 \
- --exclude=/distfiles --exclude=/packages --exclude=/local \
+${RSYNC_WRAPPER} rsync --recursive --links --safe-links --perms --times \
+ --compress --force --whole-file --delete --delete-after --stats \
+ --timeout=180 --exclude=/distfiles --exclude=/packages --exclude=/local \
--exclude=/.cache --progress "${RSYNC_OPTIONS[@]}" "${UNPACKDIR}/" "${LOCAL}/" || exit $?
rm -rf "${TEMP}"
diff --git a/paludis/syncer.cc b/paludis/syncer.cc
index ba1545a..dc6e878 100644
--- a/paludis/syncer.cc
+++ b/paludis/syncer.cc
@@ -94,7 +94,10 @@ DefaultSyncer::sync(const SyncOptions & opts) const
{
MakeEnvCommand cmd(make_env_command(stringify(_syncer) + " " + opts.options + " '" + _local + "' '" + _remote + "'")
+ ("PALUDIS_ACTION", "sync")
+ ("PALUDIS_BASHRC_FILES", _environment->bashrc_files())
("PALUDIS_FETCHERS_DIRS", _environment->fetchers_dirs())
+ ("PALUDIS_SYNCERS_DIRS", _environment->syncers_dirs())
("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis")));
if (run_command(cmd))