aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-01-26 15:14:08 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-01-26 15:14:08 +0000
commit76da50c645eeb1d3bca9014209919d1fe2c540f3 (patch)
tree8d37389edf83adf910fa3a2c845197aecb0facd3
parentcd97b615582f231451efa92d22b5664123c1afa2 (diff)
downloadpaludis-76da50c645eeb1d3bca9014209919d1fe2c540f3.tar.gz
paludis-76da50c645eeb1d3bca9014209919d1fe2c540f3.tar.xz
Document new sync stuff, and make tar syncer not kill distfiles and friends.
-rw-r--r--doc/configuration.html.skel9
-rw-r--r--ebuild/syncers/dorsync.in2
-rw-r--r--ebuild/syncers/dotar.in35
3 files changed, 34 insertions, 12 deletions
diff --git a/doc/configuration.html.skel b/doc/configuration.html.skel
index e492258..0b21281 100644
--- a/doc/configuration.html.skel
+++ b/doc/configuration.html.skel
@@ -235,10 +235,15 @@ provided, the default is 0.</p>
<li><code>sync</code> (default: empty), which controls how the repository is
synced. Typically values are in the form <code>rsync://rsync.europe.gentoo.org/gentoo-portage</code>
or <code>svn://svn.pioto.org/paludis/overlay</code>. Use
- <code>paludis --list-sync-protocols</code> to see supported protocols.</li>
+ <code>paludis --list-sync-protocols</code> to see supported protocols. This
+ can be a space-separated list, in which case each will be tried in order
+ until one succeeds.</li>
+ <li><code>sync_options</code> (default: empty), which specifies additional
+ options to pass to the syncing script.</li>
<li><code>sync_exclude</code> (default: empty), which can point to a file that
contains a list of directories to exclude when syncing via
- <code>rsync://</code>.</li>
+ <code>rsync://</code>. This key is deprecated, use
+ <code>sync_options = --exclude-from=FILE</code> instead.</li>
</ul>
<h4>vdb Format Repositories</h4>
diff --git a/ebuild/syncers/dorsync.in b/ebuild/syncers/dorsync.in
index f66ba85..7389c96 100644
--- a/ebuild/syncers/dorsync.in
+++ b/ebuild/syncers/dorsync.in
@@ -49,7 +49,7 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
-
+
esac
shift
done
diff --git a/ebuild/syncers/dotar.in b/ebuild/syncers/dotar.in
index 82d38ad..8ef1573 100644
--- a/ebuild/syncers/dotar.in
+++ b/ebuild/syncers/dotar.in
@@ -7,6 +7,7 @@ REMOTE=
FETCHER_OPTIONS=( )
DOUNPACK_OPTIONS=( )
+RSYNC_OPTIONS=( )
while [[ $# -gt 0 ]]; do
case "${1}" in
@@ -15,6 +16,10 @@ while [[ $# -gt 0 ]]; do
DOUNPACK_OPTIONS+=( --tar-option="${1}" )
;;
+ --exclude-from=*)
+ RSYNC_OPTIONS+=( --exclude-from "${1#*=}" )
+ ;;
+
--fetcher-option=*)
FETCHER_OPTIONS+=( "${1#*=}" )
;;
@@ -23,6 +28,10 @@ while [[ $# -gt 0 ]]; do
DOUNPACK_OPTIONS+=( "${1}" )
;;
+ --rsync-option=*)
+ RSYNC_OPTIONS+=( "${1#*=}" )
+ ;;
+
--help)
PROTO="${0##*/do}"
if [[ "${PROTO}" == tar+file ]]; then
@@ -39,12 +48,14 @@ while [[ $# -gt 0 ]]; do
fi
echo " Options:"
+ echo " --exclude-from=FILE Use FILE as a list of exclude patterns"
echo " --strip-components=N Ignore the first N components of the"
echo " paths from the tarball"
echo " --fetcher-option=OPTION Pass OPTION to the fetcher"
echo " (The standard fetchers do not"
echo " accept any options - this is only"
echo " useful with custom fetchers)"
+ echo " --rsync-option=OPTION Pass OPTION to the local rsync"
echo " --tar-option=OPTION Pass OPTION to tar"
exit 0
;;
@@ -63,7 +74,7 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
-
+
esac
shift
done
@@ -103,20 +114,26 @@ if [[ -z "${FETCHER}" ]]; then
exit 1
fi
-TARDIR="${LOCAL%/}"
-TARDIR="${TARDIR%/*}"
+TEMP="$( mktemp -d -p /var/tmp paludis-tarsync-XXXXXX )" || exit $?
TARFILE="${URL##*/}"
-"${FETCHER}" "${FETCHER_OPTIONS[@]}" "${URL}" "${TARDIR}/${TARFILE}" || exit $?
+"${FETCHER}" "${FETCHER_OPTIONS[@]}" "${URL}" "${TEMP}/${TARFILE}" || exit $?
-[[ -d "${LOCAL}" ]] && rm -rf "${LOCAL}"
-mkdir -p "${LOCAL}"
+( cd "${TEMP}" && "${PALUDIS_EBUILD_DIR}/utils/dounpack" "${DOUNPACK_OPTIONS[@]}" "${TEMP}/${TARFILE}" ) || exit $?
-cd "${LOCAL}" && "${PALUDIS_EBUILD_DIR}/utils/dounpack" "${DOUNPACK_OPTIONS[@]}" "${TARDIR}/${TARFILE}" || exit $?
-rm "${TARDIR}/${TARFILE}"
+rm "${TEMP}/${TARFILE}"
-if [[ -z "$( ls -A )" ]]; then
+if [[ -z "$( ls -A "${TEMP}" )" ]]; then
eerror "No files were extracted (not an archive?)"
+ rmdir "${TEMP}"
exit 1
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 \
+ --exclude=/.cache --progress "${RSYNC_OPTIONS[@]}" "${TEMP}/" "${LOCAL}/" || exit $?
+
+rm -rf "${TEMP}"
+