From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 688E4138010 for ; Sat, 18 Aug 2012 22:51:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 73E81E062C; Sat, 18 Aug 2012 22:51:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2C81AE062C for ; Sat, 18 Aug 2012 22:51:10 +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 3F1631B4020 for ; Sat, 18 Aug 2012 22:51:09 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id EDE77E5441 for ; Sat, 18 Aug 2012 22:51:07 +0000 (UTC) From: "Zac Medico" 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" Message-ID: <1345330253.9bf5900fb2fff77a89b91dd5f38478aaa635ef66.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: misc/ X-VCS-Repository: proj/portage X-VCS-Files: misc/emerge-delta-webrsync X-VCS-Directories: misc/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 9bf5900fb2fff77a89b91dd5f38478aaa635ef66 X-VCS-Branch: master Date: Sat, 18 Aug 2012 22:51:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: b2b75e82-cd3b-4d17-908a-363407e36ca9 X-Archives-Hash: 94b5d0fb633f2ba822ea8eed7a1fae01 commit: 9bf5900fb2fff77a89b91dd5f38478aaa635ef66 Author: Zac Medico gentoo org> AuthorDate: Sat Aug 18 22:50:53 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Aug 18 22:50:53 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9bf5900f emerge-delta-webrsync: mktemp in PORTAGE_TMPDIR This will fix bug #198362. --- misc/emerge-delta-webrsync | 43 ++++++++++++++++++++----------------------- 1 files changed, 20 insertions(+), 23 deletions(-) diff --git a/misc/emerge-delta-webrsync b/misc/emerge-delta-webrsync index 8c43bdc..0b282d9 100755 --- a/misc/emerge-delta-webrsync +++ b/misc/emerge-delta-webrsync @@ -38,7 +38,6 @@ eval $("${portageq}" envvar -v DISTDIR EPREFIX FEATURES \ PORTAGE_RSYNC_OPTS PORTAGE_TMPDIR PORTDIR \ USERLAND http_proxy ftp_proxy) export http_proxy ftp_proxy -TMPDIR=${PORTAGE_TMPDIR}/snapshots source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 @@ -116,7 +115,8 @@ if [[ ! -w ${DISTDIR} ]] ; then exit 1 fi -[[ -d ${TMPDIR} ]] || mkdir -p "${TMPDIR}" +[[ -d ${PORTAGE_TMPDIR}/portage ]] || mkdir -p "${PORTAGE_TMPDIR}/portage" +TMPDIR=$(mktemp -d "${PORTAGE_TMPDIR}/portage/delta-webrsync-XXXXXX") if [[ ! -w ${TMPDIR} ]] ; then eecho "TMPDIR is not writable: ${TMPDIR}" exit 1 @@ -261,7 +261,7 @@ sync_local() { exit 6 fi else - cd ${TMPDIR} || die "couldn't cd to tmpdir, $TMPDIR!?" + cd "${TMPDIR}" || die "couldn't cd to tmpdir, ${TMPDIR}!?" flags="xf" if [ "${FILE%.bz2}" != "${FILE}" ]; then flags="jxf" @@ -517,19 +517,16 @@ if [[ ${WEBSYNC_VERIFY_SIGNATURE} == 1 && ! -e portage-${final_date}.tar.bz2.gpg exit 5 fi -# generate tmp dir. -TEMPDIR=$(mktemp -d /tmp/delta-webrsync-XXXXXX) # got our patches. -if ! patcher -v "${dfile}" ${patches} "${TEMPDIR}/portage-${final_date}.tar"; then +if ! patcher -v "${dfile}" ${patches} "${TMPDIR}/portage-${final_date}.tar"; then echo "reconstruction failed (contact the author with the error from the reconstructor please)" - rm -f "${TEMPDIR}/portage-${final_date}.tar" - rmdir ${TEMPDIR} + rm -f "${TMPDIR}/portage-${final_date}.tar" full_version_attempt fi verified=0 if [[ -n $got_umd5 ]]; then echo "verifying uncompressed md5" - if ! verify_md5_file "${TEMPDIR}/portage-${final_date}.tar" "${DISTDIR}/portage-${final_date}.tar.bz2.umd5sum"; then + if ! verify_md5_file "${TMPDIR}/portage-${final_date}.tar" "${DISTDIR}/portage-${final_date}.tar.bz2.umd5sum"; then echo "uncompressed verification failed. This means either you found a bug in diffball, or something odd is going on" echo "with upstream patch generation" echo "trying md5sum next, which probably will fail." @@ -546,26 +543,26 @@ if [ "$verified" == "1" ]; then # BUG: Signature verification will fail if the local bzip2 # program does not produce output that is perfectly identical # to the bzip2 program used to compress the signed tar file. - bzip2 -vk9 "${TEMPDIR}/portage-${final_date}.tar" - check_file_signature "${DISTDIR}/portage-${final_date}.tar.bz2.gpgsig" "${TEMPDIR}/portage-${final_date}.tar.bz2" || exit 1 + bzip2 -vk9 "${TMPDIR}/portage-${final_date}.tar" + check_file_signature "${DISTDIR}/portage-${final_date}.tar.bz2.gpgsig" "${TMPDIR}/portage-${final_date}.tar.bz2" || exit 1 else - bzip2 -vk9 "${TEMPDIR}/portage-${final_date}.tar" & + bzip2 -vk9 "${TMPDIR}/portage-${final_date}.tar" & fi echo "beginning update to the tree" - sync_local "${TEMPDIR}/portage-${final_date}.tar" + sync_local "${TMPDIR}/portage-${final_date}.tar" echo "doing final md5 stuff" wait # bzip2 is finished now. - rm -f "${TEMPDIR}/portage-${final_date}.tar" + rm -f "${TMPDIR}/portage-${final_date}.tar" else echo "recompressing." - bzip2 -v9 "${TEMPDIR}/portage-${final_date}.tar.bz2" + bzip2 -v9 "${TMPDIR}/portage-${final_date}.tar.bz2" fi echo "verifying generated tarball" -if ! verify_md5_file "${TEMPDIR}/portage-${final_date}.tar.bz2" "${DISTDIR}/portage-${final_date}.tar.bz2.md5sum"; then +if ! verify_md5_file "${TMPDIR}/portage-${final_date}.tar.bz2" "${DISTDIR}/portage-${final_date}.tar.bz2.md5sum"; then if [[ -z $verified ]]; then echo "couldn't verify the generated tarball. bug, most likely." exit 5 @@ -574,21 +571,20 @@ if ! verify_md5_file "${TEMPDIR}/portage-${final_date}.tar.bz2" "${DISTDIR}/port echo "compressed md5 differs, but uncompressed md5 says it right. bzip2 version incompatability in other words" echo "saving the md5" if type -p md5sum &> /dev/null; then - md5sum ${TEMPDIR}/portage-${final_date}.tar.bz2 | sed -e "s:${TEMPDIR}/\?::" > \ - ${STATE_DIR}/portage-${final_date}.tar.bz2.md5sum + md5sum "${TMPDIR}/portage-${final_date}.tar.bz2" | sed -e "s:${TMPDIR}/\?::" > \ + "${STATE_DIR}/portage-${final_date}.tar.bz2.md5sum" elif type -p md5 &> /dev/null; then - echo "$(md5 -q ${TEMPDIR}/portage-${final_date}.tar.bz2) portage-${final_date}.tar.bz2" > \ - ${STATE_DIR}/portage-${final_date}.tar.bz2.md5sum + echo "$(md5 -q "${TMPDIR}/portage-${final_date}.tar.bz2") portage-${final_date}.tar.bz2" > \ + "${STATE_DIR}/portage-${final_date}.tar.bz2.md5sum" else echo "couldn't find either md5 or md5sum. something is screwed... (bailing, sorry)" exit 7 fi - mv "${DISTDIR}/portage-${final_date}.tar.bz2.umd5sum" "${TEMPDIR}/portage-${final_date}.tar.bz2" ${STATE_DIR}/ - rmdir ${TEMPDIR} + mv "${DISTDIR}/portage-${final_date}.tar.bz2.umd5sum" "${TMPDIR}/portage-${final_date}.tar.bz2" "${STATE_DIR}/" dfile="${STATE_DIR}/portage-${final_date}.tar.bz2" else dfile="${DISTDIR}/portage-${final_date}.tar.bz2" - mv "${TEMPDIR}/portage-${final_date}.tar.bz2" ${DISTDIR}/ + mv "${TMPDIR}/portage-${final_date}.tar.bz2" "${DISTDIR}/" fi if [ -z "${need_last_sync}" ]; then @@ -607,5 +603,6 @@ if [[ -z $KEEP_OLDIES ]]; then rm -f "${STATE_DIR}/${x}"{,.md5sum,.umd5sum} &> /dev/null done fi +rm -rf "${TMPDIR}" echo "done."