All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] insane: add qa check for uppercase recipe name
@ 2017-08-28 19:02 Yeoh Ee Peng
  2017-08-29  8:20 ` Anders Darander
  0 siblings, 1 reply; 4+ messages in thread
From: Yeoh Ee Peng @ 2017-08-28 19:02 UTC (permalink / raw)
  To: openembedded-core

Since we disabled uppercase characters in overrides a few releases
ago, uppercase characters in recipe names (and for that matter, distro
and machine names) cannot be supported due to their reliance upon
overrides including the name.

QA check will produce an warning message when it verify that recipe
name is uppercase.

[YOCTO# 11592]

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
---
 meta/classes/insane.bbclass | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index b7177c9..fe0d744 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -16,7 +16,7 @@
 #   into exec_prefix
 #  -Check that scripts in base_[bindir|sbindir|libdir] do not reference
 #   files under exec_prefix
-
+#  -Check if the package name is upper case
 
 QA_SANE = "True"
 
@@ -27,7 +27,7 @@ WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \
             installed-vs-shipped compile-host-path install-host-path \
             pn-overrides infodir build-deps \
             unknown-configure-option symlink-to-sysroot multilib \
-            invalid-packageconfig host-user-contaminated \
+            invalid-packageconfig host-user-contaminated uppercase-pn \
             "
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -1248,6 +1248,8 @@ do_configure[postfuncs] += "do_qa_configure "
 do_unpack[postfuncs] += "do_qa_unpack"
 
 python () {
+    import re
+    
     tests = d.getVar('ALL_QA').split()
     if "desktop" in tests:
         d.appendVar("PACKAGE_DEPENDS", " desktop-file-utils-native")
@@ -1274,6 +1276,9 @@ python () {
     if pn in overrides:
         msg = 'Recipe %s has PN of "%s" which is in OVERRIDES, this can result in unexpected behaviour.' % (d.getVar("FILE"), pn)
         package_qa_handle_error("pn-overrides", msg, d)
+    prog = re.compile('[A-Z]')
+    if prog.search(pn):
+        package_qa_handle_error("uppercase-pn", 'PN: %s is upper case, this can result in unexpected behavior.' % pn, d)
 
     issues = []
     if (d.getVar('PACKAGES') or "").split():
-- 
2.7.4



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

* Re: [PATCH] insane: add qa check for uppercase recipe name
  2017-08-28 19:02 [PATCH] insane: add qa check for uppercase recipe name Yeoh Ee Peng
@ 2017-08-29  8:20 ` Anders Darander
  2017-08-29 10:30   ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Anders Darander @ 2017-08-29  8:20 UTC (permalink / raw)
  To: Yeoh Ee Peng; +Cc: openembedded-core

Hi,

* Yeoh Ee Peng <ee.peng.yeoh@intel.com> [170829 04:11]:

> Since we disabled uppercase characters in overrides a few releases
> ago, uppercase characters in recipe names (and for that matter, distro
> and machine names) cannot be supported due to their reliance upon
> overrides including the name.

> QA check will produce an warning message when it verify that recipe
> name is uppercase.

> [YOCTO# 11592]

Could you add QA checks also for uppercase in machine and distro names?

When giving an on-site training last winter (using Morty), I helped the
customer solve quite a few issues stemming from the fact that they had a
machine name with uppercase letters in.

I know that the bug in question specifically talks about recipe name,
though adding checks for them all would be even better, IMHO.

Cheers,
Anders

-- 
Anders Darander, Senior System Architect
ChargeStorm AB / eStorm AB


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

* Re: [PATCH] insane: add qa check for uppercase recipe name
  2017-08-29  8:20 ` Anders Darander
@ 2017-08-29 10:30   ` Richard Purdie
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2017-08-29 10:30 UTC (permalink / raw)
  To: Anders Darander, Yeoh Ee Peng; +Cc: openembedded-core

On Tue, 2017-08-29 at 10:20 +0200, Anders Darander wrote:
> Hi,
> 
> * Yeoh Ee Peng <ee.peng.yeoh@intel.com> [170829 04:11]:
> 
> > 
> > Since we disabled uppercase characters in overrides a few releases
> > ago, uppercase characters in recipe names (and for that matter,
> > distro
> > and machine names) cannot be supported due to their reliance upon
> > overrides including the name.
> > 
> > QA check will produce an warning message when it verify that recipe
> > name is uppercase.
> > 
> > [YOCTO# 11592]
> Could you add QA checks also for uppercase in machine and distro
> names?
> 
> When giving an on-site training last winter (using Morty), I helped
> the
> customer solve quite a few issues stemming from the fact that they
> had a
> machine name with uppercase letters in.
> 
> I know that the bug in question specifically talks about recipe name,
> though adding checks for them all would be even better, IMHO.

I'd just note that such checks would belong somewhere else like
sanity.bbclass rather than here (we can check once per config, not per
recipe).

Cheers,

Richard


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

* [PATCH] insane: add qa check for uppercase recipe name
@ 2017-08-17 20:40 Yeoh Ee Peng
  0 siblings, 0 replies; 4+ messages in thread
From: Yeoh Ee Peng @ 2017-08-17 20:40 UTC (permalink / raw)
  To: openembedded-core

Since we disabled uppercase characters in overrides a few releases
ago, uppercase characters in recipe names (and for that matter, distro
and machine names) cannot be supported due to their reliance upon
overrides including the name.

QA check will produce an warning message when it verify that recipe
name is uppercase.

[YOCTO# 11592]

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
---
 meta/classes/insane.bbclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index b7177c9..86237a8 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -16,7 +16,7 @@
 #   into exec_prefix
 #  -Check that scripts in base_[bindir|sbindir|libdir] do not reference
 #   files under exec_prefix
-
+#  -Check if the package name is upper case
 
 QA_SANE = "True"
 
@@ -27,7 +27,7 @@ WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \
             installed-vs-shipped compile-host-path install-host-path \
             pn-overrides infodir build-deps \
             unknown-configure-option symlink-to-sysroot multilib \
-            invalid-packageconfig host-user-contaminated \
+            invalid-packageconfig host-user-contaminated uppercase-pn \
             "
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -1248,6 +1248,8 @@ do_configure[postfuncs] += "do_qa_configure "
 do_unpack[postfuncs] += "do_qa_unpack"
 
 python () {
+    import re
+    
     tests = d.getVar('ALL_QA').split()
     if "desktop" in tests:
         d.appendVar("PACKAGE_DEPENDS", " desktop-file-utils-native")
@@ -1274,6 +1276,8 @@ python () {
     if pn in overrides:
         msg = 'Recipe %s has PN of "%s" which is in OVERRIDES, this can result in unexpected behaviour.' % (d.getVar("FILE"), pn)
         package_qa_handle_error("pn-overrides", msg, d)
+    if re.search('[A-Z]', pn):
+        package_qa_handle_error("uppercase-pn", 'PN: %s is upper case, this can result in unexpected behavior.' % pn, d)
 
     issues = []
     if (d.getVar('PACKAGES') or "").split():
-- 
2.7.4



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

end of thread, other threads:[~2017-08-29 10:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-28 19:02 [PATCH] insane: add qa check for uppercase recipe name Yeoh Ee Peng
2017-08-29  8:20 ` Anders Darander
2017-08-29 10:30   ` Richard Purdie
  -- strict thread matches above, loose matches on Subject: below --
2017-08-17 20:40 Yeoh Ee Peng

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.