[PATCH rtems-net-legacy] netlegacy: Use os.path instead of hardcoded Unix like path

Gedare Bloom gedare at rtems.org
Wed Apr 14 06:18:59 UTC 2021


On Wed, Apr 14, 2021 at 12:18 AM Gedare Bloom <gedare at rtems.org> wrote:
>
> this one looks good, but unrelated to the direct changes, is
> '${PREFIX}' well-defined or is there a way to grab that as a variable
> from something like bld.env?
>
> On Wed, Apr 14, 2021 at 12:04 AM Vijay Kumar Banerjee <vijay at rtems.org> wrote:
> >
> > Ping :)
> >
> > On Wed, Apr 7, 2021 at 10:52 AM Vijay Kumar Banerjee <vijay at rtems.org> wrote:
> > >
> > > ---
> > >  netlegacy.py | 16 ++++++++--------
> > >  1 file changed, 8 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/netlegacy.py b/netlegacy.py
> > > index 05cb78a..ddd1db3 100644
> > > --- a/netlegacy.py
> > > +++ b/netlegacy.py
> > > @@ -37,7 +37,7 @@ exclude_headers = ['rtems-bsd-user-space.h', 'rtems-bsd-kernel-space.h']
> > >
> > >  for root, dirs, files in os.walk("."):
> > >      [dirs.remove(d) for d in list(dirs) if d in exclude_dirs]
> > > -    dirs.append('./bsps/shared/net')
> > > +    dirs.append(os.path.join('bsps', 'shared', 'net'))
> > >      include_files[root[2:]] = []
> > >      for name in files:
> > >          ext = os.path.splitext(name)[1]
> > > @@ -59,9 +59,9 @@ def build(bld):
> > >      include_path = []
> > >      ip = ''
> > >      bsp = bld.env.RTEMS_ARCH_BSP.split('-')[-1]
> > > -    pppd_source = [os.path.join('./pppd', s)
> > > -                   for s in os.listdir('./pppd') if s[-2:] == '.c']
> > > -    telnetd_source = [os.path.join('./telnetd', s)
> > > +    pppd_source = [os.path.join('pppd', s)
> > > +                   for s in os.listdir('pppd') if s[-2:] == '.c']
> > > +    telnetd_source = [os.path.join('telnetd', s)
> > >                        for s in os.listdir('telnetd') if s[-2:] == '.c']
> > >      nfs_source = []
> > >      for root, dirs, files in os.walk('nfsclient'):
> > > @@ -74,12 +74,12 @@ def build(bld):
> > >      bsp_dirs, bsp_sources = bsp_drivers.bsp_files(bld)
> > >
> > >      include_path.extend(['.',
> > > -                         './include',
> > > +                         'include',
> > >                           os.path.relpath(bld.env.PREFIX),
> > > -                         './testsuites/include',
> > > +                         os.path.join('testsuites', 'include'),
> > >                           os.path.relpath(os.path.join(bld.env.PREFIX,
> > >                                                        'include')),
> > > -                         './bsps/include'])
> > > +                         os.path.join('bsps', 'include')])
> > >      arch_lib_path = rtems.arch_bsp_lib_path(bld.env.RTEMS_VERSION,
> > >                                              bld.env.RTEMS_ARCH_BSP)
> > >      lib_path = os.path.join(bld.env.PREFIX, arch_lib_path)
> > > @@ -138,7 +138,7 @@ def build(bld):
> > >                                     'include', 'libchip'),
> > >                        install_file_list('bsps', 'include', 'libchip'))
> > >      for i in include_files:
> > > -        if 'include' in i.split('/'):
> > > +        if 'include' in os.path.split(i):
> > >              bld.install_files(os.path.join('${PREFIX}',
for clarity, I meant here. This should probably be bld.env.PREFIX

> > >                                             arch_lib_path, i),
> > >                                include_files[i])
> > > --
> > > 2.26.2
> > >
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list