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 B33991381F3 for ; Fri, 17 May 2013 02:07:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 56C91E0838; Fri, 17 May 2013 02:07:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DD614E0838 for ; Fri, 17 May 2013 02:07:01 +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 0191E33E0B6 for ; Fri, 17 May 2013 02:07:01 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 9383BE5308 for ; Fri, 17 May 2013 02:06:59 +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: <1368756401.75a524e9a53ef4dc941947cb99d34fdf1ccab6e4.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dbapi/bintree.py X-VCS-Directories: pym/portage/dbapi/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 75a524e9a53ef4dc941947cb99d34fdf1ccab6e4 X-VCS-Branch: master Date: Fri, 17 May 2013 02:06:59 +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: 47e51705-aef1-4079-a69a-c0d76368592f X-Archives-Hash: 5c0c007480396f68c5c542a212521544 commit: 75a524e9a53ef4dc941947cb99d34fdf1ccab6e4 Author: Zac Medico gentoo org> AuthorDate: Fri May 17 02:06:41 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri May 17 02:06:41 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=75a524e9 PORTAGE_BINHOST: sftp with FETCHCOMMAND_SFTP Do not generate the sftp command for downloading the Packages file, and simply use the FETCHCOMMAND_SFTP setting. --- pym/portage/dbapi/bintree.py | 18 ++++-------------- 1 files changed, 4 insertions(+), 14 deletions(-) diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 7f2d017..14d05ad 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -911,20 +911,10 @@ class binarytree(object): path = parsed_url.path.rstrip("/") + "/Packages" - if parsed_url.scheme == 'sftp': - # The sftp command complains about 'Illegal seek' if - # we try to make it write to /dev/stdout, so use a - # temp file instead. - fd, tmp_filename = tempfile.mkstemp() - os.close(fd) - if port is not None: - port_args = ['-P', "%s" % (port,)] - proc = subprocess.Popen(['sftp'] + port_args + \ - [user_passwd + host + ":" + path, tmp_filename]) - if proc.wait() != os.EX_OK: - raise EnvironmentError("sftp failed") - f = open(tmp_filename, 'rb') - elif parsed_url.scheme == 'ssh': + if parsed_url.scheme == 'ssh': + # Use a pipe so that we can terminate the download + # early if we detect that the TIMESTAMP header + # matches that of the cached Packages file. if port is not None: port_args = ['-p', "%s" % (port,)] proc = subprocess.Popen(['ssh'] + port_args + \