scanpypi: write _SOURCE only when needed
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
@@ -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
PATCH 1/1 scanpypi: write _SOURCE only when needed
Quoted 7 lines · Asaf Kahlon
For some packages, there's no need to add the
_SOURCEvariable, 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 <[email protected]>
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@@ -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
Thomas Petazzoni
AppliedPATCH 1/1 scanpypi: write _SOURCE only when needed
In reply to Asaf KahlonHello,
Quoted 9 lines · Asaf Kahlon
For some packages, there's no need to add the
_SOURCEvariable, 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 <[email protected]>--- 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