[PATCH rtems-net-legacy] bsp_drivers: Use os.path for compatibility with non Unix host

Vijay Kumar Banerjee vijay at rtems.org
Thu Apr 15 18:01:06 UTC 2021


It has been less than 3 days, still pinging it. :)

On Tue, Apr 13, 2021 at 11:49 PM Vijay Kumar Banerjee <vijay at rtems.org> wrote:
>
> ---
>  bsp_drivers.py | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/bsp_drivers.py b/bsp_drivers.py
> index 3ca10c6..4a07847 100644
> --- a/bsp_drivers.py
> +++ b/bsp_drivers.py
> @@ -36,18 +36,18 @@ def bsp_files(bld):
>      include_dirs = {}
>      include_files = []
>
> -    special_case_dirs = {'atsamv': './bsps/arm/atsam',
> -                         'lm32_evr': './bsps/lm32',
> -                         'lpc24xx_ea': './bsps/arm/shared/'}
> +    special_case_dirs = {'atsamv': 'bsps/arm/atsam',
> +                         'lm32_evr': 'bsps/lm32',
> +                         'lpc24xx_ea': 'bsps/arm/shared/'}
>      special_case_sources = {'leon2':
> -                            ['./bsps/shared/grlib/net/network_interface_add.c',
> -                             './bsps/shared/grlib/net/greth.c'],
> +                            ['bsps/shared/grlib/net/network_interface_add.c',
> +                             'bsps/shared/grlib/net/greth.c'],
>                              'leon3':
> -                            ['./bsps/shared/grlib/net/network_interface_add.c',
> -                             './bsps/shared/grlib/net/greth.c'],
> +                            ['bsps/shared/grlib/net/network_interface_add.c',
> +                             'bsps/shared/grlib/net/greth.c'],
>                              'griscv':
> -                            ['./bsps/shared/grlib/net/network_interface_add.c',
> -                             './bsps/shared/grlib/net/greth.c']}
> +                            ['bsps/shared/grlib/net/network_interface_add.c',
> +                             'bsps/shared/grlib/net/greth.c']}
>
>      bsp_list = bld.env.RTEMS_ARCH_BSP_LIST
>
> @@ -57,9 +57,9 @@ def bsp_files(bld):
>          include_dirs[bsp] = []
>          source_files[bsp] = []
>          if bsp not in special_case_dirs:
> -            source_dir = os.walk(os.path.join('./bsps', arch, bsp))
> +            source_dir = os.walk(os.path.join('bsps', arch, bsp))
>          else:
> -            source_dir = os.walk(special_case_dirs[bsp])
> +            source_dir = os.walk(os.path.expanduser(special_case_dirs[bsp]))
>          for root, dirs, files in source_dir:
>              for name in files:
>                  ext = os.path.splitext(name)[1]
> @@ -69,6 +69,6 @@ def bsp_files(bld):
>                      if root not in include_dirs[bsp]:
>                          include_dirs[bsp].append(root)
>              if bsp in special_case_sources:
> -                source_files[bsp].extend(special_case_sources[bsp])
> -        include_dirs[bsp].append(os.path.join('./bsps', arch, bsp, 'net'))
> +                source_files[bsp].extend([os.path.expanduser(f) for f in special_case_sources[bsp]])
> +        include_dirs[bsp].append(os.path.join('bsps', arch, bsp, 'net'))
>      return (include_dirs, source_files)
> --
> 2.26.2
>


More information about the devel mailing list