[PATCH] source-builder/sb/bootstrap.py: Do not reference bsp_specs to find BSPs

Joel Sherrill joel at rtems.org
Wed Nov 22 21:45:18 UTC 2017


On Wed, Nov 22, 2017 at 3:38 PM, Chris Johns <chrisj at rtems.org> wrote:

> On 23/11/2017 02:33, Joel Sherrill wrote:
> > Updates #3520.
> > ---
> >  source-builder/sb/bootstrap.py | 13 +++++++++++--
> >  1 file changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/source-builder/sb/bootstrap.py
> b/source-builder/sb/bootstrap.py
> > index 9095f3c..8fda3b8 100644
> > --- a/source-builder/sb/bootstrap.py
> > +++ b/source-builder/sb/bootstrap.py
> > @@ -34,6 +34,14 @@ import options
> >  import path
> >  import version
> >
> > +def _collect_dirs(path_, dir):
> > +    confs = []
> > +    for root, dirs, files in os.walk(path.host(path_), topdown = True):
> > +        for f in dirs:
> > +            if f == dir:
> > +                confs += [path.shell(path.join(root, f))]
> > +    return confs
> > +
> >  def _collect(path_, file):
> >      confs = []
> >      for root, dirs, files in os.walk(path.host(path_), topdown = True):
> > @@ -130,7 +138,7 @@ class autoreconf:
> >
> >      def bspopts(self):
> >          if _grep(self.configure, 'RTEMS_CHECK_BSPDIR'):
> > -            bsp_specs = _collect(self.cwd, 'bsp_specs')
> > +            bsps = _collect_dirs(self.cwd, 'custom')
> >              try:
> >                  acinclude = path.join(self.cwd, 'acinclude.m4')
> >                  b = open(path.host(acinclude), 'w')
> > @@ -138,8 +146,9 @@ class autoreconf:
> >                  b.write('AC_DEFUN([RTEMS_CHECK_BSPDIR],' + os.linesep)
> >                  b.write('[' + os.linesep)
> >                  b.write('  case "$1" in' + os.linesep)
> > -                for bs in sorted(bsp_specs):
> > +                for bs in sorted(bsps):
> >                      dir = path.dirname(bs)[len(self.cwd) + 1:]
> > +                    dir = os.path.dirname(dir)
>
> I think this should be the wrapped `path` call `path.dirname()`.
>

OK. That works and is now pushed.

I am just glad I didn't get a complete failing grade on my first Python
patch. :)

Any comments on the patches to the autotools infrastructure? Nibbling on
bsp_specs

--joel

>
> Chris
>
> >                      b.write('  %s )%s' % (dir, os.linesep))
> >                      b.write('    AC_CONFIG_SUBDIRS([%s]);;%s' % (dir,
> os.linesep))
> >                  b.write('  *)' + os.linesep)
> >
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20171122/f09d7983/attachment-0002.html>


More information about the devel mailing list