aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-06-10 11:40:32 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-06-10 11:40:32 +0000
commit5ceb0ff235f07df3b5f057ec7f68fcdb7c774631 (patch)
tree413e49f5e1fafd4810f22ef74550cae683b529e2
parentdd747f4ffe1e672514a48be700c46c6e3d8d8aec (diff)
downloadpaludis-5ceb0ff235f07df3b5f057ec7f68fcdb7c774631.tar.gz
paludis-5ceb0ff235f07df3b5f057ec7f68fcdb7c774631.tar.xz
Support custom temp directories for tar syncers. Fixes: ticket:595
-rw-r--r--paludis/syncers/dotar.in14
1 files changed, 12 insertions, 2 deletions
diff --git a/paludis/syncers/dotar.in b/paludis/syncers/dotar.in
index 7eef6b8..8c12b7b 100644
--- a/paludis/syncers/dotar.in
+++ b/paludis/syncers/dotar.in
@@ -12,6 +12,8 @@ done
LOCAL=
REMOTE=
+TMPDIR=/var/tmp
+
FETCHER_OPTIONS=( )
UNPACK_OPTIONS=( )
RSYNC_OPTIONS=( )
@@ -33,6 +35,10 @@ while [[ $# -gt 0 ]]; do
RSYNC_OPTIONS[${#RSYNC_OPTIONS[@]}]="${1#*=}"
;;
+ --tmpdir=*)
+ TMPDIR="${1#*=}"
+ ;;
+
--fetcher-option=*)
FETCHER_OPTIONS[${#RSYNC_OPTIONS[@]}]="${1#*=}"
;;
@@ -65,6 +71,8 @@ while [[ $# -gt 0 ]]; do
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 " --tmpdir=DIR Use DIR as base directory for"
+ echo " temporary files (/var/tmp by default)"
echo " --fetcher-option=OPTION Pass OPTION to the fetcher"
echo " (The standard fetchers do not"
echo " accept any options - this is only"
@@ -128,7 +136,7 @@ if [[ -z "${FETCHER}" ]]; then
exit 1
fi
-TEMP="$( mktemp -d -p /var/tmp paludis-tarsync-XXXXXX )" || exit $?
+TEMP="$( mktemp -d -p "${TMPDIR}" paludis-tarsync-XXXXXX )" || exit $?
TARFILE="${URL##*/}"
"${FETCHER}" "${FETCHER_OPTIONS[@]}" "${URL}" "${TEMP}/${TARFILE}" || exit $?
@@ -150,7 +158,9 @@ fi
${RSYNC_WRAPPER} rsync --recursive --links --safe-links --perms --times \
--compress --force --whole-file --delete --delete-after --stats --timeout=180 \
${PALUDIS_SYNC_FILTER_FILE:+--filter "merge ${PALUDIS_SYNC_FILTER_FILE}"} \
- --exclude=/.cache --progress "${RSYNC_OPTIONS[@]}" "${UNPACKDIR}/" "${LOCAL}/" || exit $?
+ --exclude=/.cache --progress "${RSYNC_OPTIONS[@]}" "${UNPACKDIR}/" "${LOCAL}/"
+STATUS=${?}
rm -rf "${TEMP}"
+exit ${STATUS}