summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/fetch2/ssh.py21
1 files changed, 7 insertions, 14 deletions
diff --git a/bitbake/lib/bb/fetch2/ssh.py b/bitbake/lib/bb/fetch2/ssh.py
index 8d6434a7eb..61db435e71 100644
--- a/bitbake/lib/bb/fetch2/ssh.py
+++ b/bitbake/lib/bb/fetch2/ssh.py
@@ -72,15 +72,14 @@ class SSH(FetchMethod):
72 def supports_checksum(self, urldata): 72 def supports_checksum(self, urldata):
73 return False 73 return False
74 74
75 def localpath(self, url, urldata, d): 75 def urldata_init(self, urldata, d):
76 m = __pattern__.match(urldata.url) 76 m = __pattern__.match(urldata.url)
77 path = m.group('path') 77 path = m.group('path')
78 host = m.group('host') 78 host = m.group('host')
79 lpath = os.path.join(data.getVar('DL_DIR', d, True), host, os.path.basename(path)) 79 urldata.localpath = os.path.join(d.getVar('DL_DIR', True), os.path.basename(path))
80 return lpath
81 80
82 def download(self, url, urldata, d): 81 def download(self, url, urldata, d):
83 dldir = data.getVar('DL_DIR', d, True) 82 dldir = d.getVar('DL_DIR', True)
84 83
85 m = __pattern__.match(url) 84 m = __pattern__.match(url)
86 path = m.group('path') 85 path = m.group('path')
@@ -89,16 +88,10 @@ class SSH(FetchMethod):
89 user = m.group('user') 88 user = m.group('user')
90 password = m.group('pass') 89 password = m.group('pass')
91 90
92 ldir = os.path.join(dldir, host)
93 lpath = os.path.join(ldir, os.path.basename(path))
94
95 if not os.path.exists(ldir):
96 os.makedirs(ldir)
97
98 if port: 91 if port:
99 port = '-P %s' % port 92 portarg = '-P %s' % port
100 else: 93 else:
101 port = '' 94 portarg = ''
102 95
103 if user: 96 if user:
104 fr = user 97 fr = user
@@ -112,9 +105,9 @@ class SSH(FetchMethod):
112 105
113 import commands 106 import commands
114 cmd = 'scp -B -r %s %s %s/' % ( 107 cmd = 'scp -B -r %s %s %s/' % (
115 port, 108 portarg,
116 commands.mkarg(fr), 109 commands.mkarg(fr),
117 commands.mkarg(ldir) 110 commands.mkarg(dldir)
118 ) 111 )
119 112
120 bb.fetch2.check_network_access(d, cmd, urldata.url) 113 bb.fetch2.check_network_access(d, cmd, urldata.url)