diff options
| -rw-r--r-- | meta/classes/sstate.bbclass | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index ee9bf052ae..d20b62a66e 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass | |||
| @@ -304,38 +304,31 @@ python sstate_cleanall() { | |||
| 304 | def sstate_hardcode_path(d): | 304 | def sstate_hardcode_path(d): |
| 305 | # Need to remove hardcoded paths and fix these when we install the | 305 | # Need to remove hardcoded paths and fix these when we install the |
| 306 | # staging packages. | 306 | # staging packages. |
| 307 | sstate_scan_cmd = d.getVar('SSTATE_SCAN_CMD', True) | ||
| 308 | p = os.popen("%s" % sstate_scan_cmd) | ||
| 309 | file_list = p.read() | ||
| 310 | |||
| 311 | if file_list == "": | ||
| 312 | p.close() | ||
| 313 | return | ||
| 314 | 307 | ||
| 315 | staging = d.getVar('STAGING_DIR', True) | 308 | staging = d.getVar('STAGING_DIR', True) |
| 316 | staging_target = d.getVar('STAGING_DIR_TARGET', True) | 309 | staging_target = d.getVar('STAGING_DIR_TARGET', True) |
| 317 | staging_host = d.getVar('STAGING_DIR_HOST', True) | 310 | staging_host = d.getVar('STAGING_DIR_HOST', True) |
| 318 | sstate_builddir = d.getVar('SSTATE_BUILDDIR', True) | 311 | sstate_builddir = d.getVar('SSTATE_BUILDDIR', True) |
| 319 | 312 | ||
| 320 | files = " ".join(file_list.split('\n')) | ||
| 321 | |||
| 322 | if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d): | 313 | if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d): |
| 323 | cmd = "sed -i -e s:%s:FIXMESTAGINGDIR:g %s" % (staging, files) | 314 | sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIR:g'" % (staging) |
| 324 | elif bb.data.inherits_class('cross', d): | 315 | elif bb.data.inherits_class('cross', d): |
| 325 | cmd = "sed -i -e s:%s:FIXMESTAGINGDIRTARGET:g %s \ | 316 | sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRTARGET:g; s:%s:FIXMESTAGINGDIR:g'" % (staging_target, staging) |
| 326 | sed -i -e s:%s:FIXMESTAGINGDIR:g %s" % (staging_target, files, staging, files) | ||
| 327 | else: | 317 | else: |
| 328 | cmd = "sed -i -e s:%s:FIXMESTAGINGDIRHOST:g %s" % (staging_host, files) | 318 | sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRHOST:g'" % (staging_host) |
| 329 | 319 | ||
| 330 | if files: | 320 | sstate_scan_cmd = d.getVar('SSTATE_SCAN_CMD', True) |
| 331 | os.system(cmd) | 321 | sstate_filelist_cmd = "tee %sfixmepath" % (sstate_builddir) |
| 332 | fix = open("%sfixmepath" % (sstate_builddir), "w") | 322 | |
| 333 | fixme = [] | 323 | # fixmepath file needs relative paths, drop sstate_builddir prefix |
| 334 | for f in file_list.split('\n'): | 324 | sstate_filelist_relative_cmd = "sed -i -e 's:^%s::g' %sfixmepath" % (sstate_builddir, sstate_builddir) |
| 335 | fixme.append(f.replace(sstate_builddir, "")) | 325 | |
| 336 | fix.write("\n".join(fixme)) | 326 | sstate_hardcode_cmd = "%s | %s | xargs %s" % (sstate_scan_cmd, sstate_filelist_cmd, sstate_sed_cmd) |
| 337 | fix.close() | 327 | |
| 338 | p.close() | 328 | print "Removing hardcoded paths from sstate package: '%s'" % (sstate_hardcode_cmd) |
| 329 | os.system(sstate_hardcode_cmd) | ||
| 330 | print "Replacing absolute paths in fixmepath file: '%s'" % (sstate_filelist_relative_cmd) | ||
| 331 | os.system(sstate_filelist_relative_cmd) | ||
| 339 | 332 | ||
| 340 | def sstate_package(ss, d): | 333 | def sstate_package(ss, d): |
| 341 | import oe.path | 334 | import oe.path |
