[PATCH rtems-net-legacy v2] netlegacy: Use os.path instead of hardcoded Unix like path
Gedare Bloom
gedare at rtems.org
Wed Apr 14 18:16:55 UTC 2021
On Wed, Apr 14, 2021 at 12:14 PM Vijay Kumar Banerjee <vijay at rtems.org> wrote:
>
> ---
> netlegacy.py | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/netlegacy.py b/netlegacy.py
> index 05cb78a..427d6ad 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']
This is still using a bad way to get the filename extension. Please fix these.
Everything else looks good.
> + 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)
> @@ -132,17 +132,17 @@ def build(bld):
> use=['rtemsbsp', 'networking'],
> source=nfs_source)
>
> - bld.install_files(os.path.join('${PREFIX}', arch_lib_path),
> - ["libnetworking.a", 'libpppd.a', 'libtelnetd.a', 'libnfs.a'])
> - bld.install_files(os.path.join('${PREFIX}', arch_lib_path,
> + bld.install_files(os.path.join(bld.env.PREFIX, arch_lib_path),
> + ["libnetworking.a", 'libpppd.a', 'libnfs.a'])
> + bld.install_files(os.path.join(bld.env.PREFIX, arch_lib_path,
> 'include', 'libchip'),
> install_file_list('bsps', 'include', 'libchip'))
> for i in include_files:
> - if 'include' in i.split('/'):
> - bld.install_files(os.path.join('${PREFIX}',
> + if 'include' in os.path.split(i):
> + bld.install_files(os.path.join(bld.env.PREFIX,
> arch_lib_path, i),
> include_files[i])
> else:
> - bld.install_files(os.path.join('${PREFIX}',
> + bld.install_files(os.path.join(bld.env.PREFIX,
> arch_lib_path, 'include', i),
> include_files[i])
> --
> 2.26.2
>
More information about the devel
mailing list