Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 120600 Details for
Bug 175891
sftp not suported as transport for PORTAGE_BINHOST
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
use the paramiko library to add sftp support for PORTAGE_BINHOST
sftp.patch (text/plain), 1.51 KB, created by
Zac Medico
on 2007-05-29 09:14:42 UTC
(
hide
)
Description:
use the paramiko library to add sftp support for PORTAGE_BINHOST
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2007-05-29 09:14:42 UTC
Size:
1.51 KB
patch
obsolete
>Index: pym/getbinpkg.py >=================================================================== >--- pym/getbinpkg.py (revision 6656) >+++ pym/getbinpkg.py (working copy) >@@ -135,6 +135,15 @@ > conn.login(username) > conn.set_pasv(passive) > conn.set_debuglevel(0) >+ elif protocol == "sftp": >+ try: >+ import paramiko >+ except ImportError: >+ raise NotImplementedError( >+ "paramiko must be installed for sftp support") >+ t = paramiko.Transport(host) >+ t.connect(username=username, password=password) >+ conn = paramiko.SFTPClient.from_transport(t) > else: > raise NotImplementedError, "%s is not a supported protocol." % protocol > >@@ -301,6 +310,8 @@ > del olddir > else: > listing = conn.nlst(address) >+ elif protocol == "sftp": >+ listing = conn.listdir(address) > else: > raise TypeError, "Unknown protocol. '%s'" % protocol > >@@ -326,6 +337,13 @@ > data,rc,msg = make_http_request(conn, address, params, headers) > elif protocol in ["ftp"]: > data,rc,msg = make_ftp_request(conn, address, -chunk_size) >+ elif protocol == "sftp": >+ f = conn.open(address) >+ try: >+ f.seek(-chunk_size, 2) >+ data = f.read() >+ finally: >+ f.close() > else: > raise TypeError, "Unknown protocol. '%s'" % protocol > >@@ -403,6 +421,8 @@ > data,rc,msg = make_http_request(conn, address, params, headers, dest=dest) > elif protocol in ["ftp"]: > data,rc,msg = make_ftp_request(conn, address, dest=dest) >+ elif protocol == "sftp": >+ conn.get(address, dest) > else: > raise TypeError, "Unknown protocol. '%s'" % protocol >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 175891
:
120600
|
123003
|
123020
|
123021