Commit Graph

14 Commits

Author SHA1 Message Date
Richard Purdie 53d2563ff1 bitbake: perforce: Fix path subdirectory issues
With a SRC_URI = " \
p4://depot/folder/...;module=localfolder/localsubfolder;changeslist=${P4CHANGELIST} \
"

the subfolders of //depot/folder/... get renamed when mapped to the
local folder structure. They lose the first 3 letters. This
patch fixes that.

Issue reported by and patch sent from katutxakurra@gmail.com

[YOCTO #5380]

(Bitbake master rev: 40e06dc459d9c0b5d42d65b2d2c846196fd36b1f)

(Bitbake rev: df0f92cdc925fe7f3bb2e6afe76cf10b0656ead6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-03 17:51:31 +00:00
Robert Yang 35ed979019 bitbake: perforce.py: fix the perforce fetcher
The bb.process.run() will return one tuple, e.g:

p4file = ('strA\nStrB\nstrC\n'), then there will be an iteration on p4file:

for i in p4file:
	[snip]

The i will be 's t r A ...', this is incorrect. use splitlines() to fix
the problem.

[YOCTO #3619]

(Bitbake rev: b7440fb36b419996046f607e66434ce34722272b)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-25 05:58:20 -08:00
Robert Yang 094742bed2 replace os.popen with subprocess.Popen
Replace os.popen with subprocess.Popen since the older function would
fail (more or less) silently if the executed program cannot be found

There is a bb.process.run() which will invoke the Popen to run command,
use it for simplify the code.

For the:
p4file = os.popen("%s%s files %s" % (p4cmd, p4opt, depot))
...
for file in p4file:
    list = file.split()

in bitbake/lib/bb/fetch2/perforce.py, it should be an error in the past,
since it didn't use readline() to read the pipe, but directly used the
split() for the pipe. Use the bb.process.run would fix the problem since
bb.process.run will return strings.

More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements

[YOCTO #2075]

(Bitbake rev: 8d6700255a6d4dda403c89b171a6d4a1883e5aae)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-23 11:35:11 +01:00
Robert Yang 10a0f9ed92 replace os.system with subprocess.call
Replace os.system with subprocess.call since the older function would
fail (more or less) silently if the executed program cannot be found

More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements

[YOCTO #2075]

(Bitbake rev: f5b3bf115dc1ffbfb241a49cec0fc3654cb71021)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-23 11:35:11 +01:00
Khem Raj 54e10127c4 fetch, fetch2: Get rid of DeprecationWarning notice
* This patch fixes a cosmetic issue currently we get with master

WARNING: /home/kraj/work/bitbake/lib/bb/fetch2/__init__.py:733:
DeprecationWarning: Call to deprecated function bb.mkdirhier: Please use bb.utils.mkdirhier instead.  bb.mkdirhier("%s/%s" % (rootdir, destdir))

(Bitbake rev: 36fe59ce314c295d239b76de34c8714def2c32d5)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-03 22:51:33 +00:00
Saul Wold 232b6f3c92 fetch2: add runfetchcmd to import for fetchers
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-02-07 16:28:35 -08:00
Richard Purdie 7202a77134 bitbake/fetch2: Use True instead of integer values
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:37 +00:00
Richard Purdie ab0dd13974 bitbake/fetch2: Rename Fetch class to FetchMethod
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:36 +00:00
Richard Purdie d08397ba4d bitbake/fetch2: Rewrite and improve exception handling, reusing core functions for common operations where possible
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:36 +00:00
Richard Purdie 5a52cb80d6 bitbake/fetch2: Define a sane localpath function and remove code duplication
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:35 +00:00
Richard Purdie 972eb5faba bitbake/fetch2: Move ud.localfile setup into urldata_init
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:35 +00:00
Yu Ke e05918937c bb.fetch2: rename "go" with "download" to better reflect its functionality
no functional change

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-25 12:25:47 +00:00
Yu Ke c64b445f38 bb.fetch2: replace bb.fetch with bb.fetch2 in the bb.fetch
bb.fetch2 is copied from bb.fetch, and has many bb.fetch referrence.
Fix these referrence with bb.fetch2 referrence

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 18:05:07 +00:00
Yu Ke 4dccd92439 bitbake: copy bb.fetch to bb.fetch2 as initial code base for fetcher overhaul
Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 14:23:36 +00:00