From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-497256-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id CE1F9138010
	for <garchives@archives.gentoo.org>; Sun, 19 Aug 2012 00:00:26 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 524A4E064F;
	Sun, 19 Aug 2012 00:00:11 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 20B28E064F
	for <gentoo-commits@lists.gentoo.org>; Sun, 19 Aug 2012 00:00:11 +0000 (UTC)
Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 81E0E1B403B
	for <gentoo-commits@lists.gentoo.org>; Sun, 19 Aug 2012 00:00:10 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by hornbill.gentoo.org (Postfix) with ESMTP id 3D30CE5441
	for <gentoo-commits@lists.gentoo.org>; Sun, 19 Aug 2012 00:00:09 +0000 (UTC)
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org>
Message-ID: <1345334381.9ed46667dbeee834f03c5f40d5231c0695bc4e7a.zmedico@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: bin/
X-VCS-Repository: proj/portage
X-VCS-Files: bin/emerge-webrsync
X-VCS-Directories: bin/
X-VCS-Committer: zmedico
X-VCS-Committer-Name: Zac Medico
X-VCS-Revision: 9ed46667dbeee834f03c5f40d5231c0695bc4e7a
X-VCS-Branch: master
Date: Sun, 19 Aug 2012 00:00:09 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 5bea0fe5-2d80-46a1-853b-50dd9f407368
X-Archives-Hash: 0f1421d4cfcf26797d448e33995b4f40

commit:     9ed46667dbeee834f03c5f40d5231c0695bc4e7a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 18 23:59:41 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 18 23:59:41 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9ed46667

emerge-webrsync: use ${PORTAGE_TMPDIR}/portage

For consistency with commit 83e677766650e73071813c0d46547647e5f66029.

---
 bin/emerge-webrsync |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 11d608f..5cba6b0 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -464,23 +464,23 @@ main() {
 		exit 1
 	fi
 
-	TMPDIR=${PORTAGE_TMPDIR}/emerge-webrsync
-	${keep} || DISTDIR=${TMPDIR}
+	[[ -d ${PORTAGE_TMPDIR}/portage ]] || mkdir -p "${PORTAGE_TMPDIR}/portage"
+	TMPDIR=$(mktemp -d "${PORTAGE_TMPDIR}/portage/webrsync-XXXXXX")
+	if [[ ! -w ${TMPDIR} ]] ; then
+		eecho "TMPDIR is not writable: ${TMPDIR}"
+		exit 1
+	fi
+	trap 'cd / ; rm -rf "${TMPDIR}"' EXIT
+	cd "${TMPDIR}" || exit 1
 
-	[ ! -d "${TMPDIR}" ] && mkdir -p "${TMPDIR}"
+	${keep} || DISTDIR=${TMPDIR}
 	[ ! -d "${DISTDIR}" ] && mkdir -p "${DISTDIR}"
-	cd "${TMPDIR}" || exit 1
 
 	if ${keep} && [[ ! -w ${DISTDIR} ]] ; then
 		eecho "DISTDIR is not writable: ${DISTDIR}"
 		exit 1
 	fi
 
-	if [[ ! -w ${TMPDIR} ]] ; then
-		eecho "TMPDIR is not writable: ${TMPDIR}"
-		exit 1
-	fi
-
 	# This is a sanity check to help prevent people like funtoo users
 	# from accidentally wiping out their git tree.
 	if [[ -n $SYNC && ${SYNC#rsync:} = $SYNC ]] ; then