diff options
Diffstat (limited to 'bitbake/lib/bb/fetch/perforce.py')
| -rw-r--r-- | bitbake/lib/bb/fetch/perforce.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/bitbake/lib/bb/fetch/perforce.py b/bitbake/lib/bb/fetch/perforce.py index b594d2bde2..2fb38b4190 100644 --- a/bitbake/lib/bb/fetch/perforce.py +++ b/bitbake/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: |
