On Thu, Feb 23, 2012 at 04:50:27PM +0100, Martin Jansa wrote: > * also fixes replacing paths for perl where cmd line was probably > too long for os.system(cmd) (it had 560410 characters because a lot of > files from sstate_scan_cmd). > * also print those 2 commands so we can find them in log.do_package > > Signed-off-by: Martin Jansa <[email protected]> > --- > 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 ee9bf05..6883843 100644 > --- a/meta/classes/sstate.bbclass > +++ b/meta/classes/sstate.bbclass > @@ -304,38 +304,31 @@ python sstate_cleanall() { > def sstate_hardcode_path(d): > # Need to remove hardcoded paths and fix these when we install the > # staging packages. > - sstate_scan_cmd = d.getVar('SSTATE_SCAN_CMD', True) > - p = os.popen("%s" % sstate_scan_cmd) > - file_list = p.read() > - > - if file_list == "": > - p.close() > - return > > staging = d.getVar('STAGING_DIR', True) > staging_target = d.getVar('STAGING_DIR_TARGET', True) > staging_host = d.getVar('STAGING_DIR_HOST', True) > sstate_builddir = d.getVar('SSTATE_BUILDDIR', True) > > - files = " ".join(file_list.split('\n')) > - > 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): > - cmd = "sed -i -e s:%s:FIXMESTAGINGDIR:g %s" % (staging, files) > + sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIR:g'" % > (staging) > elif bb.data.inherits_class('cross', d): > - cmd = "sed -i -e s:%s:FIXMESTAGINGDIRTARGET:g %s \ > - sed -i -e s:%s:FIXMESTAGINGDIR:g %s" % (staging_target, > files, staging, files) > + sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRTARGET:g; > s:%s:FIXMESTAGINGDIR:g'" % (staging_target, staging) > else: > - cmd = "sed -i -e s:%s:FIXMESTAGINGDIRHOST:g %s" % > (staging_host, files) > - > - if files: > - os.system(cmd) > - fix = open("%sfixmepath" % (sstate_builddir), "w") > - fixme = [] > - for f in file_list.split('\n'): > - fixme.append(f.replace(sstate_builddir, "")) > - fix.write("\n".join(fixme)) > - fix.close() > - p.close() > + sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRHOST:g'" % > (staging_host) > + > + sstate_scan_cmd = d.getVar('SSTATE_SCAN_CMD', True) > + sstate_filelist_cmd = "tee %sfixmepath" % (sstate_builddir) > + > + # fixmepath file needs relative paths, drop sstate_builddir prefix
Ah.. forgot to squash small fix before sending, but it's correct in jansa/pull branch: - sstate_filelist_relative_cmd = "sed -i -e 's:^%s::g %sfixmepath'" % (sstate_builddir, sstate_builddir) + sstate_filelist_relative_cmd = "sed -i -e 's:^%s::g' %sfixmepath'" % (sstate_builddir, sstate_builddir) Cheers, > + > + sstate_hardcode_cmd = "%s | %s | xargs %s" % (sstate_scan_cmd, > sstate_filelist_cmd, sstate_sed_cmd) > + > + print "Removing hardcoded paths from sstate package: '%s'" % > (sstate_hardcode_cmd) > + os.system(sstate_hardcode_cmd) > + print "Replacing absolute paths in fixmepath file: '%s'" % > (sstate_filelist_relative_cmd) > + os.system(sstate_filelist_relative_cmd) > > def sstate_package(ss, d): > import oe.path > -- > 1.7.8.4 > -- Martin 'JaMa' Jansa jabber: [email protected]
signature.asc
Description: Digital signature
_______________________________________________ Openembedded-core mailing list [email protected] http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
