All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] devtool: Fix file:// fetcher symlink directory structure
@ 2021-01-21 22:31 Tomasz Dziendzielski
  2021-01-21 23:03 ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Tomasz Dziendzielski @ 2021-01-21 22:31 UTC (permalink / raw)
  To: openembedded-core; +Cc: Tomasz Dziendzielski

Add relative path if file is under directory.

[YOCTO #13738]

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
---
 scripts/lib/devtool/standard.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index f7d8a82117..7b62b7e7b8 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -474,7 +474,11 @@ def symlink_oelocal_files_srctree(rd,srctree):
                 destpth = os.path.join(srctree, relpth, fn)
                 if os.path.exists(destpth):
                     os.unlink(destpth)
-                os.symlink('oe-local-files/%s' % fn, destpth)
+                if relpth != '.':
+                    back_relpth = os.path.relpath(local_files_dir, root)
+                    os.symlink('%s/oe-local-files/%s/%s' % (back_relpth, relpth, fn), destpth)
+                else:
+                    os.symlink('oe-local-files/%s' % fn, destpth)
                 addfiles.append(os.path.join(relpth, fn))
         if addfiles:
             bb.process.run('git add %s' % ' '.join(addfiles), cwd=srctree)
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH v2] devtool: Fix file:// fetcher symlink directory structure
  2021-01-21 22:31 [PATCH v2] devtool: Fix file:// fetcher symlink directory structure Tomasz Dziendzielski
@ 2021-01-21 23:03 ` Richard Purdie
  2021-01-22  8:25   ` Tomasz Dziendzielski
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2021-01-21 23:03 UTC (permalink / raw)
  To: Tomasz Dziendzielski, openembedded-core

On Thu, 2021-01-21 at 23:31 +0100, Tomasz Dziendzielski wrote:
> Add relative path if file is under directory.
> 
> [YOCTO #13738]
> 
> Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
> ---
>  scripts/lib/devtool/standard.py | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
> index f7d8a82117..7b62b7e7b8 100644
> --- a/scripts/lib/devtool/standard.py
> +++ b/scripts/lib/devtool/standard.py
> @@ -474,7 +474,11 @@ def symlink_oelocal_files_srctree(rd,srctree):
>                  destpth = os.path.join(srctree, relpth, fn)
>                  if os.path.exists(destpth):
>                      os.unlink(destpth)
> -                os.symlink('oe-local-files/%s' % fn, destpth)
> +                if relpth != '.':
> +                    back_relpth = os.path.relpath(local_files_dir, root)
> +                    os.symlink('%s/oe-local-files/%s/%s' % (back_relpth, relpth, fn), destpth)
> +                else:
> +                    os.symlink('oe-local-files/%s' % fn, destpth)
>                  addfiles.append(os.path.join(relpth, fn))
>          if addfiles:
>              bb.process.run('git add %s' % ' '.join(addfiles), cwd=srctree)

Are there some extra test cases we should be adding to account for some
of these changes? They suggest we have some missing coverage.

oe-selftest -r devtool

and see meta/lib/oeqa/selftest/cases/

Cheers,

Richard


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH v2] devtool: Fix file:// fetcher symlink directory structure
  2021-01-21 23:03 ` [OE-core] " Richard Purdie
@ 2021-01-22  8:25   ` Tomasz Dziendzielski
  0 siblings, 0 replies; 3+ messages in thread
From: Tomasz Dziendzielski @ 2021-01-22  8:25 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 853 bytes --]

>Are there some extra test cases we should be adding to account for some
>of these changes? They suggest we have some missing coverage.
>
>oe-selftest -r devtool
>
>and see meta/lib/oeqa/selftest/cases/

It seems in test_devtool_update_recipe_local_files we only check if
modifying files under oe-local-files/ will result in modified recipe files
after running "devtool update-recipe". Because recipe files are updated
based on oe-local-files/ broken symlinks under src "root" directory don't
impact this test. It's worth mentioning this test doesn't check files under
subdirectories (oe-local-files/dir/foo) - it's working correctly but it may
be good to cover it.
But there is no test checking if after "devtool modify" directory structure
in src "root" is preserved and symlinks are not broken.

Best regards,
Tomasz Dziendzielski

[-- Attachment #2: Type: text/html, Size: 1598 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-22  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 22:31 [PATCH v2] devtool: Fix file:// fetcher symlink directory structure Tomasz Dziendzielski
2021-01-21 23:03 ` [OE-core] " Richard Purdie
2021-01-22  8:25   ` Tomasz Dziendzielski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.