All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCHv3 1/1] utils/checkpackagelib: add function to check of the default package source variable
@ 2018-01-13 21:39 Jerzy Grzegorek
  2018-01-14 23:52 ` Ricardo Martincoski
  2018-01-15 22:27 ` Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Jerzy Grzegorek @ 2018-01-13 21:39 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Jerzy Grzegorek <jerzy.m.grzegorek@gmail.com>
Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Changes v2 -> v3
 - add missing whitespaces after ',' (Ricardo Martincoski)
 - remove value returned by the check function (Ricardo Martincoski)

Changes v1 -> v2
 - remove unused variable (Ricardo Martincoski)
 - change warning url (Ricardo Martincoski)
 - add whitelist of packages (Ricardo Martincoski)

 utils/checkpackagelib/lib_mk.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/utils/checkpackagelib/lib_mk.py b/utils/checkpackagelib/lib_mk.py
index 817e809..a6cfeb6 100644
--- a/utils/checkpackagelib/lib_mk.py
+++ b/utils/checkpackagelib/lib_mk.py
@@ -99,6 +99,30 @@ class PackageHeader(_CheckFunction):
                         text]
 
 
+class RemoveDefaultPackageSourceVariable(_CheckFunction):
+    packages_that_may_contain_default_source = ["binutils", "gcc", "gdb"]
+    PACKAGE_NAME = re.compile("/([^/]+)\.mk")
+
+    def before(self):
+        package = self.PACKAGE_NAME.search(self.filename).group(1)
+        package_upper = package.replace("-", "_").upper()
+        self.package = package
+        self.FIND_SOURCE = re.compile(
+            "^{}_SOURCE\s*=\s*{}-\$\({}_VERSION\)\.tar\.gz"
+            .format(package_upper, package, package_upper))
+
+    def check_line(self, lineno, text):
+        if self.FIND_SOURCE.search(text):
+
+            if self.package in self.packages_that_may_contain_default_source:
+                return
+
+            return ["{}:{}: remove default value of _SOURCE variable "
+                    "({}#generic-package-reference)"
+                    .format(self.filename, lineno, self.url_to_manual),
+                    text]
+
+
 class SpaceBeforeBackslash(_CheckFunction):
     TAB_OR_MULTIPLE_SPACES_BEFORE_BACKSLASH = re.compile(r"^.*(  |\t)\\$")
 
-- 
1.9.1

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

* [Buildroot] [PATCHv3 1/1] utils/checkpackagelib: add function to check of the default package source variable
  2018-01-13 21:39 [Buildroot] [PATCHv3 1/1] utils/checkpackagelib: add function to check of the default package source variable Jerzy Grzegorek
@ 2018-01-14 23:52 ` Ricardo Martincoski
  2018-01-15 22:27 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Ricardo Martincoski @ 2018-01-14 23:52 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, Jan 13, 2018 at 07:39 PM, Jerzy Grzegorek wrote:

> Signed-off-by: Jerzy Grzegorek <jerzy.m.grzegorek@gmail.com>
Reviewed-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
[https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/47905172]
Tested-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>

Note 1: the new warning added to check-package job in gitlab will be fixed by:
http://patchwork.ozlabs.org/patch/859399/
Note 2: the warnings already in the tree have fixes too:
http://patchwork.ozlabs.org/patch/860493/
http://patchwork.ozlabs.org/patch/860542/

Regards,
Ricardo

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

* [Buildroot] [PATCHv3 1/1] utils/checkpackagelib: add function to check of the default package source variable
  2018-01-13 21:39 [Buildroot] [PATCHv3 1/1] utils/checkpackagelib: add function to check of the default package source variable Jerzy Grzegorek
  2018-01-14 23:52 ` Ricardo Martincoski
@ 2018-01-15 22:27 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2018-01-15 22:27 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 13 Jan 2018 22:39:43 +0100, Jerzy Grzegorek wrote:
> Signed-off-by: Jerzy Grzegorek <jerzy.m.grzegorek@gmail.com>
> Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> Changes v2 -> v3
>  - add missing whitespaces after ',' (Ricardo Martincoski)
>  - remove value returned by the check function (Ricardo Martincoski)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2018-01-15 22:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-13 21:39 [Buildroot] [PATCHv3 1/1] utils/checkpackagelib: add function to check of the default package source variable Jerzy Grzegorek
2018-01-14 23:52 ` Ricardo Martincoski
2018-01-15 22:27 ` Thomas Petazzoni

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.