Patchwork [2/2,v2] blacklist.bbclass: Refactor, use PNBLACKLIST[pn]

login
register
mail settings
Submitter Mark Hatle
Date May 9, 2012, 8 p.m.
Message ID <583198c49fc63d31fd0f15484983032b50b2ce8a.1336593352.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/27389/
State Accepted
Commit 0893457465e184550906844fbab2dec397201835
Headers show

Comments

Mark Hatle - May 9, 2012, 8 p.m.
Revise the handling from ANGSTROM_BLACKLIST to PNBLACKLIST[pn].

Refactor the code to eliminate references to the distribution and recipe
name in the message.

Change the skipPackage message message from:

ERROR: <recipe> was skipped: <distro> DOES NOT support <recipe> because <reason>

to:

ERROR: <recipe> was skipped: Recipe is blacklisted: <reason>

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/classes/blacklist.bbclass |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)
Koen Kooi - May 9, 2012, 8:45 p.m.
Op 9 mei 2012, om 22:00 heeft Mark Hatle het volgende geschreven:

> Revise the handling from ANGSTROM_BLACKLIST to PNBLACKLIST[pn].
> 
> Refactor the code to eliminate references to the distribution and recipe
> name in the message.
> 
> Change the skipPackage message message from:
> 
> ERROR: <recipe> was skipped: <distro> DOES NOT support <recipe> because <reason>
> 
> to:
> 
> ERROR: <recipe> was skipped: Recipe is blacklisted: <reason>
> 
> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
> ---
> meta/classes/blacklist.bbclass |   22 +++++++++++-----------
> 1 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/meta/classes/blacklist.bbclass b/meta/classes/blacklist.bbclass
> index 7bf4a73..75abd99 100644
> --- a/meta/classes/blacklist.bbclass
> +++ b/meta/classes/blacklist.bbclass
> @@ -1,20 +1,20 @@
> -# anonymous support class from angstrom
> +# anonymous support class from originally from angstrom
> # 
> +# To use the blacklist, a distribution should include this
> +# class in the INHERIT_DISTRO

INHERIT works just fine as well
Mark Hatle - May 9, 2012, 9:16 p.m.
On 5/9/12 3:45 PM, Koen Kooi wrote:
>
> Op 9 mei 2012, om 22:00 heeft Mark Hatle het volgende geschreven:
>
>> Revise the handling from ANGSTROM_BLACKLIST to PNBLACKLIST[pn].
>>
>> Refactor the code to eliminate references to the distribution and recipe
>> name in the message.
>>
>> Change the skipPackage message message from:
>>
>> ERROR:<recipe>  was skipped:<distro>  DOES NOT support<recipe>  because<reason>
>>
>> to:
>>
>> ERROR:<recipe>  was skipped: Recipe is blacklisted:<reason>
>>
>> Signed-off-by: Mark Hatle<mark.hatle@windriver.com>
>> ---
>> meta/classes/blacklist.bbclass |   22 +++++++++++-----------
>> 1 files changed, 11 insertions(+), 11 deletions(-)
>>
>> diff --git a/meta/classes/blacklist.bbclass b/meta/classes/blacklist.bbclass
>> index 7bf4a73..75abd99 100644
>> --- a/meta/classes/blacklist.bbclass
>> +++ b/meta/classes/blacklist.bbclass
>> @@ -1,20 +1,20 @@
>> -# anonymous support class from angstrom
>> +# anonymous support class from originally from angstrom
>> #
>> +# To use the blacklist, a distribution should include this
>> +# class in the INHERIT_DISTRO
>
> INHERIT works just fine as well

Happy to change the comment, but my intention was that a blacklist is specified 
by a distribution, thus the inherit_distro comment.

--Mark

>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/classes/blacklist.bbclass b/meta/classes/blacklist.bbclass
index 7bf4a73..75abd99 100644
--- a/meta/classes/blacklist.bbclass
+++ b/meta/classes/blacklist.bbclass
@@ -1,20 +1,20 @@ 
-# anonymous support class from angstrom
+# anonymous support class from originally from angstrom
 # 
+# To use the blacklist, a distribution should include this
+# class in the INHERIT_DISTRO
+#
+# No longer use ANGSTROM_BLACKLIST, instead use a table of
+# recipes in PNBLACKLIST
+#
 # Features:
 #
-# * blacklist handling, set ANGSTROM_BLACKLIST_pn-blah = "message"
+# * To add a package to the blacklist, set:
+#   PNBLACKLIST[pn] = "message"
 #
 
 python () {
-    import bb
-
-    blacklist = bb.data.getVar("ANGSTROM_BLACKLIST", d, 1)
-    pkgnm = bb.data.getVar("PN", d, 1)
-    distro = bb.data.getVar("DISTRO", d, 1)
+    blacklist = d.getVarFlag('PNBLACKLIST', d.getVar('PN', True), True)
 
     if blacklist:
-	bb.note("%s DOES NOT support %s because %s" % (distro,pkgnm, blacklist))
-        raise bb.parse.SkipPackage("%s DOES NOT support %s because %s" % (distro,pkgnm, blacklist))
-
+        raise bb.parse.SkipPackage("Recipe is blacklisted: %s" % (blacklist))
 }
-