Skip to contentSkip to conversation

scanpypi: write _SOURCE only when needed

PATCH New Asaf Kahlon 3 participants 3 messages Dec 22, 2018 – Dec 30, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scanpypi: write _SOURCE only when needed

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.

---
 utils/scanpypi | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
utils/scanpypi +8 -7
index 9335bedee4..a75d696222 100755
@@ -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
Signature · 1 line
2.19.1
#1 lore raw

PATCH 1/1 scanpypi: write _SOURCE only when needed

Quoted 7 lines · Asaf Kahlon

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.

It was a long requested feature. Thanks.

Yegor

Quoted 33 lines
---
 utils/scanpypi | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
utils/scanpypi +8 -8
index 9335bedee4..a75d696222 100755
@@ -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

#2 lore raw

PATCH 1/1 scanpypi: write _SOURCE only when needed

In reply to Asaf Kahlon

Hello,

Quoted 9 lines · Asaf Kahlon

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.

---
 utils/scanpypi | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com