Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] scanpypi: write _SOURCE only when needed
@ 2018-12-22 18:15 Asaf Kahlon
  2018-12-22 21:30 ` Yegor Yefremov
  2018-12-30 16:44 ` Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Asaf Kahlon @ 2018-12-22 18:15 UTC (permalink / raw)
  To: buildroot

For some packages, there's no need to add the _SOURCE variable,
since the name of the source file is the same as the name of the package
(like python-engineio).
Hence, we'll add it to the .mk file only if needed.

Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
---
 utils/scanpypi | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/utils/scanpypi b/utils/scanpypi
index 9335bedee4..a75d696222 100755
--- a/utils/scanpypi
+++ b/utils/scanpypi
@@ -354,13 +354,14 @@ class BuildrootPackage():
             version=self.version)
         lines.append(version_line)
 
-        targz = self.filename.replace(
-            self.version,
-            '$({name}_VERSION)'.format(name=self.mk_name))
-        targz_line = '{name}_SOURCE = {filename}\n'.format(
-            name=self.mk_name,
-            filename=targz)
-        lines.append(targz_line)
+        if self.buildroot_name != self.real_name:
+            targz = self.filename.replace(
+                self.version,
+                '$({name}_VERSION)'.format(name=self.mk_name))
+            targz_line = '{name}_SOURCE = {filename}\n'.format(
+                name=self.mk_name,
+                filename=targz)
+            lines.append(targz_line)
 
         if self.filename not in self.url:
             # Sometimes the filename is in the url, sometimes it's not
-- 
2.19.1

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

* [Buildroot] [PATCH 1/1] scanpypi: write _SOURCE only when needed
  2018-12-22 18:15 [Buildroot] [PATCH 1/1] scanpypi: write _SOURCE only when needed Asaf Kahlon
@ 2018-12-22 21:30 ` Yegor Yefremov
  2018-12-30 16:44 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Yegor Yefremov @ 2018-12-22 21:30 UTC (permalink / raw)
  To: buildroot

On Sat, Dec 22, 2018 at 7:15 PM Asaf Kahlon <asafka7@gmail.com> wrote:
>
> For some packages, there's no need to add the _SOURCE variable,
> since the name of the source file is the same as the name of the package
> (like python-engineio).
> Hence, we'll add it to the .mk file only if needed.
>
> Signed-off-by: Asaf Kahlon <asafka7@gmail.com>

It was a long requested feature. Thanks.

Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>

Yegor

> ---
>  utils/scanpypi | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/utils/scanpypi b/utils/scanpypi
> index 9335bedee4..a75d696222 100755
> --- a/utils/scanpypi
> +++ b/utils/scanpypi
> @@ -354,13 +354,14 @@ class BuildrootPackage():
>              version=self.version)
>          lines.append(version_line)
>
> -        targz = self.filename.replace(
> -            self.version,
> -            '$({name}_VERSION)'.format(name=self.mk_name))
> -        targz_line = '{name}_SOURCE = {filename}\n'.format(
> -            name=self.mk_name,
> -            filename=targz)
> -        lines.append(targz_line)
> +        if self.buildroot_name != self.real_name:
> +            targz = self.filename.replace(
> +                self.version,
> +                '$({name}_VERSION)'.format(name=self.mk_name))
> +            targz_line = '{name}_SOURCE = {filename}\n'.format(
> +                name=self.mk_name,
> +                filename=targz)
> +            lines.append(targz_line)
>
>          if self.filename not in self.url:
>              # Sometimes the filename is in the url, sometimes it's not
> --
> 2.19.1
>

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

* [Buildroot] [PATCH 1/1] scanpypi: write _SOURCE only when needed
  2018-12-22 18:15 [Buildroot] [PATCH 1/1] scanpypi: write _SOURCE only when needed Asaf Kahlon
  2018-12-22 21:30 ` Yegor Yefremov
@ 2018-12-30 16:44 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2018-12-30 16:44 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 22 Dec 2018 20:15:32 +0200, Asaf Kahlon wrote:
> For some packages, there's no need to add the _SOURCE variable,
> since the name of the source file is the same as the name of the package
> (like python-engineio).
> Hence, we'll add it to the .mk file only if needed.
> 
> Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
> ---
>  utils/scanpypi | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2018-12-30 16:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-22 18:15 [Buildroot] [PATCH 1/1] scanpypi: write _SOURCE only when needed Asaf Kahlon
2018-12-22 21:30 ` Yegor Yefremov
2018-12-30 16:44 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox