summaryrefslogtreecommitdiffstats
path: root/bitbake-dev/lib/bb/fetch
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake-dev/lib/bb/fetch')
-rw-r--r--bitbake-dev/lib/bb/fetch/hg.py2
-rw-r--r--bitbake-dev/lib/bb/fetch/perforce.py24
-rw-r--r--bitbake-dev/lib/bb/fetch/svn.py4
3 files changed, 17 insertions, 13 deletions
diff --git a/bitbake-dev/lib/bb/fetch/hg.py b/bitbake-dev/lib/bb/fetch/hg.py
index 1cd5a8aa5c..b87fd0fbe5 100644
--- a/bitbake-dev/lib/bb/fetch/hg.py
+++ b/bitbake-dev/lib/bb/fetch/hg.py
@@ -79,7 +79,7 @@ class Hg(Fetch):
79 host = "/" 79 host = "/"
80 ud.host = "localhost" 80 ud.host = "localhost"
81 81
82 if ud.user == None: 82 if not ud.user:
83 hgroot = host + ud.path 83 hgroot = host + ud.path
84 else: 84 else:
85 hgroot = ud.user + "@" + host + ud.path 85 hgroot = ud.user + "@" + host + ud.path
diff --git a/bitbake-dev/lib/bb/fetch/perforce.py b/bitbake-dev/lib/bb/fetch/perforce.py
index b594d2bde2..2fb38b4190 100644
--- a/bitbake-dev/lib/bb/fetch/perforce.py
+++ b/bitbake-dev/lib/bb/fetch/perforce.py
@@ -67,14 +67,15 @@ class Perforce(Fetch):
67 doparse = staticmethod(doparse) 67 doparse = staticmethod(doparse)
68 68
69 def getcset(d, depot,host,user,pswd,parm): 69 def getcset(d, depot,host,user,pswd,parm):
70 p4opt = ""
70 if "cset" in parm: 71 if "cset" in parm:
71 return parm["cset"]; 72 return parm["cset"];
72 if user: 73 if user:
73 data.setVar('P4USER', user, d) 74 p4opt += " -u %s" % (user)
74 if pswd: 75 if pswd:
75 data.setVar('P4PASSWD', pswd, d) 76 p4opt += " -P %s" % (pswd)
76 if host: 77 if host:
77 data.setVar('P4PORT', host, d) 78 p4opt += " -p %s" % (host)
78 79
79 p4date = data.getVar("P4DATE", d, 1) 80 p4date = data.getVar("P4DATE", d, 1)
80 if "revision" in parm: 81 if "revision" in parm:
@@ -85,8 +86,8 @@ class Perforce(Fetch):
85 depot += "@%s" % (p4date) 86 depot += "@%s" % (p4date)
86 87
87 p4cmd = data.getVar('FETCHCOMMAND_p4', d, 1) 88 p4cmd = data.getVar('FETCHCOMMAND_p4', d, 1)
88 bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s changes -m 1 %s" % (p4cmd, depot)) 89 bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s%s changes -m 1 %s" % (p4cmd, p4opt, depot))
89 p4file = os.popen("%s changes -m 1 %s" % (p4cmd,depot)) 90 p4file = os.popen("%s%s changes -m 1 %s" % (p4cmd, p4opt, depot))
90 cset = p4file.readline().strip() 91 cset = p4file.readline().strip()
91 bb.msg.debug(1, bb.msg.domain.Fetcher, "READ %s" % (cset)) 92 bb.msg.debug(1, bb.msg.domain.Fetcher, "READ %s" % (cset))
92 if not cset: 93 if not cset:
@@ -146,14 +147,15 @@ class Perforce(Fetch):
146 data.update_data(localdata) 147 data.update_data(localdata)
147 148
148 # Get the p4 command 149 # Get the p4 command
150 p4opt = ""
149 if user: 151 if user:
150 data.setVar('P4USER', user, localdata) 152 p4opt += " -u %s" % (user)
151 153
152 if pswd: 154 if pswd:
153 data.setVar('P4PASSWD', pswd, localdata) 155 p4opt += " -P %s" % (pswd)
154 156
155 if host: 157 if host:
156 data.setVar('P4PORT', host, localdata) 158 p4opt += " -p %s" % (host)
157 159
158 p4cmd = data.getVar('FETCHCOMMAND', localdata, 1) 160 p4cmd = data.getVar('FETCHCOMMAND', localdata, 1)
159 161
@@ -175,8 +177,8 @@ class Perforce(Fetch):
175 177
176 os.chdir(tmpfile) 178 os.chdir(tmpfile)
177 bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc) 179 bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc)
178 bb.msg.note(1, bb.msg.domain.Fetcher, "%s files %s" % (p4cmd, depot)) 180 bb.msg.note(1, bb.msg.domain.Fetcher, "%s%s files %s" % (p4cmd, p4opt, depot))
179 p4file = os.popen("%s files %s" % (p4cmd, depot)) 181 p4file = os.popen("%s%s files %s" % (p4cmd, p4opt, depot))
180 182
181 if not p4file: 183 if not p4file:
182 bb.error("Fetch: unable to get the P4 files from %s" % (depot)) 184 bb.error("Fetch: unable to get the P4 files from %s" % (depot))
@@ -193,7 +195,7 @@ class Perforce(Fetch):
193 dest = list[0][len(path)+1:] 195 dest = list[0][len(path)+1:]
194 where = dest.find("#") 196 where = dest.find("#")
195 197
196 os.system("%s print -o %s/%s %s" % (p4cmd, module,dest[:where],list[0])) 198 os.system("%s%s print -o %s/%s %s" % (p4cmd, p4opt, module,dest[:where],list[0]))
197 count = count + 1 199 count = count + 1
198 200
199 if count == 0: 201 if count == 0:
diff --git a/bitbake-dev/lib/bb/fetch/svn.py b/bitbake-dev/lib/bb/fetch/svn.py
index 5e5b31b3ad..aead1629b3 100644
--- a/bitbake-dev/lib/bb/fetch/svn.py
+++ b/bitbake-dev/lib/bb/fetch/svn.py
@@ -114,13 +114,15 @@ class Svn(Fetch):
114 if command is "info": 114 if command is "info":
115 svncmd = "%s info %s %s://%s/%s/" % (basecmd, " ".join(options), proto, svnroot, ud.module) 115 svncmd = "%s info %s %s://%s/%s/" % (basecmd, " ".join(options), proto, svnroot, ud.module)
116 else: 116 else:
117 suffix = ""
117 if ud.revision: 118 if ud.revision:
118 options.append("-r %s" % ud.revision) 119 options.append("-r %s" % ud.revision)
120 suffix = "@%s" % (ud.revision)
119 elif ud.date: 121 elif ud.date:
120 options.append("-r {%s}" % ud.date) 122 options.append("-r {%s}" % ud.date)
121 123
122 if command is "fetch": 124 if command is "fetch":
123 svncmd = "%s co %s %s://%s/%s %s" % (basecmd, " ".join(options), proto, svnroot, ud.module, ud.module) 125 svncmd = "%s co %s %s://%s/%s%s %s" % (basecmd, " ".join(options), proto, svnroot, ud.module, suffix, ud.module)
124 elif command is "update": 126 elif command is "update":
125 svncmd = "%s update %s" % (basecmd, " ".join(options)) 127 svncmd = "%s update %s" % (basecmd, " ".join(options))
126 else: 128 else: