Re: [OE-core] [PATCH 03/12] recipetool: Skip common source files in guess_license

2021-10-12 Thread Stefan Herbrechtsmeier

Hi Richard,

Am 08.10.2021 um 14:26 schrieb Richard Purdie:

On Fri, 2021-10-08 at 09:45 +0200, Konrad Weihmann wrote:


On 08.10.21 09:42, Stefan Herbrechtsmeier wrote:

From: Stefan Herbrechtsmeier 

Signed-off-by: Stefan Herbrechtsmeier 
---

(no changes since v1)

   scripts/lib/recipetool/create.py | 2 ++
   1 file changed, 2 insertions(+)

diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index e88a4253da..83cf25d9b7 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -1114,6 +1114,8 @@ def guess_license(srctree, d):
   licfiles = []
   for root, dirs, files in os.walk(srctree):
   for fn in files:
+if fn.endswith(".html") or fn.endswith(".js") or fn.endswith(".json") or 
fn.endswith(".svg") or fn.endswith(".ts"):


Why not

_, _ext = os.path.splitext(fn)
if _ext in [".html", ".js", ".json", ".svg", ".ts"]:


you can do fn.endswith((".html", ".js", ".json", ".svg", ".ts"))


Thanks, I will post an updated series next week.

Regards
  Stefan


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156876): 
https://lists.openembedded.org/g/openembedded-core/message/156876
Mute This Topic: https://lists.openembedded.org/mt/86165223/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH 03/12] recipetool: Skip common source files in guess_license

2021-10-08 Thread Richard Purdie
On Fri, 2021-10-08 at 09:45 +0200, Konrad Weihmann wrote:
> 
> On 08.10.21 09:42, Stefan Herbrechtsmeier wrote:
> > From: Stefan Herbrechtsmeier 
> > 
> > Signed-off-by: Stefan Herbrechtsmeier 
> > 
> > ---
> > 
> > (no changes since v1)
> > 
> >   scripts/lib/recipetool/create.py | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/scripts/lib/recipetool/create.py 
> > b/scripts/lib/recipetool/create.py
> > index e88a4253da..83cf25d9b7 100644
> > --- a/scripts/lib/recipetool/create.py
> > +++ b/scripts/lib/recipetool/create.py
> > @@ -1114,6 +1114,8 @@ def guess_license(srctree, d):
> >   licfiles = []
> >   for root, dirs, files in os.walk(srctree):
> >   for fn in files:
> > +if fn.endswith(".html") or fn.endswith(".js") or 
> > fn.endswith(".json") or fn.endswith(".svg") or fn.endswith(".ts"):
> 
> Why not
> 
> _, _ext = os.path.splitext(fn)
> if _ext in [".html", ".js", ".json", ".svg", ".ts"]:

you can do fn.endswith((".html", ".js", ".json", ".svg", ".ts"))

Cheers,

Richard


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156781): 
https://lists.openembedded.org/g/openembedded-core/message/156781
Mute This Topic: https://lists.openembedded.org/mt/86165223/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH 03/12] recipetool: Skip common source files in guess_license

2021-10-08 Thread Stefan Herbrechtsmeier

Am 08.10.2021 um 09:45 schrieb Konrad Weihmann:



On 08.10.21 09:42, Stefan Herbrechtsmeier wrote:

From: Stefan Herbrechtsmeier 

Signed-off-by: Stefan Herbrechtsmeier 


---

(no changes since v1)

  scripts/lib/recipetool/create.py | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/scripts/lib/recipetool/create.py 
b/scripts/lib/recipetool/create.py

index e88a4253da..83cf25d9b7 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -1114,6 +1114,8 @@ def guess_license(srctree, d):
  licfiles = []
  for root, dirs, files in os.walk(srctree):
  for fn in files:
+    if fn.endswith(".html") or fn.endswith(".js") or 
fn.endswith(".json") or fn.endswith(".svg") or fn.endswith(".ts"):


Why not

_, _ext = os.path.splitext(fn)
if _ext in [".html", ".js", ".json", ".svg", ".ts"]:

?

to me that would be easier to read and maintain than this ever growing 
or clause construction


Will be changed in the next version.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156770): 
https://lists.openembedded.org/g/openembedded-core/message/156770
Mute This Topic: https://lists.openembedded.org/mt/86165223/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH 03/12] recipetool: Skip common source files in guess_license

2021-10-08 Thread Konrad Weihmann



On 08.10.21 09:42, Stefan Herbrechtsmeier wrote:

From: Stefan Herbrechtsmeier 

Signed-off-by: Stefan Herbrechtsmeier 
---

(no changes since v1)

  scripts/lib/recipetool/create.py | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index e88a4253da..83cf25d9b7 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -1114,6 +1114,8 @@ def guess_license(srctree, d):
  licfiles = []
  for root, dirs, files in os.walk(srctree):
  for fn in files:
+if fn.endswith(".html") or fn.endswith(".js") or fn.endswith(".json") or 
fn.endswith(".svg") or fn.endswith(".ts"):


Why not

_, _ext = os.path.splitext(fn)
if _ext in [".html", ".js", ".json", ".svg", ".ts"]:

?

to me that would be easier to read and maintain than this ever growing 
or clause construction



+continue
  for spec in licspecs:
  if fnmatch.fnmatch(fn, spec):
  fullpath = os.path.join(root, fn)






-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156757): 
https://lists.openembedded.org/g/openembedded-core/message/156757
Mute This Topic: https://lists.openembedded.org/mt/86165223/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH 03/12] recipetool: Skip common source files in guess_license

2021-10-08 Thread Stefan Herbrechtsmeier
From: Stefan Herbrechtsmeier 

Signed-off-by: Stefan Herbrechtsmeier 
---

(no changes since v1)

 scripts/lib/recipetool/create.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index e88a4253da..83cf25d9b7 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -1114,6 +1114,8 @@ def guess_license(srctree, d):
 licfiles = []
 for root, dirs, files in os.walk(srctree):
 for fn in files:
+if fn.endswith(".html") or fn.endswith(".js") or 
fn.endswith(".json") or fn.endswith(".svg") or fn.endswith(".ts"):
+continue
 for spec in licspecs:
 if fnmatch.fnmatch(fn, spec):
 fullpath = os.path.join(root, fn)
-- 
2.20.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156745): 
https://lists.openembedded.org/g/openembedded-core/message/156745
Mute This Topic: https://lists.openembedded.org/mt/86165223/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-