[OE-core] [PATCH] yocto-compat-layer.py: Add script to YP Compatible Layer validation

Aníbal Limón anibal.limon at linux.intel.com
Mon Feb 20 17:32:23 UTC 2017



On 02/17/2017 04:41 PM, Christopher Larson wrote:
> On Fri, Feb 17, 2017 at 3:39 PM, Christopher Larson <kergoth at gmail.com>
> wrote:
> 
>> On Fri, Feb 17, 2017 at 2:26 PM, Aníbal Limón <
>> anibal.limon at linux.intel.com> wrote:
>>
>>> +    parser.add_argument('-l', '--layer', metavar='LAYER_DIR',
>>> +            help='Layer to test compatibility with Yocto Project',
>>> +            action='store', required=True)
>>>
>>
>> The behavior of this argument is quite unintuitive. First, this path isn’t
>> actually used as the layer directory, detect_layers searches down from that
>> path to *find* layers in that subdirectory, so the argument isn’t what it
>> says it is. Second, why are you making an option mandatory rather than just
>> using arguments?
>>
>> That is, why `layer-compat-layer.py -l layerpath` rather than
>> `layer-compat-layer.py layerpath`. If you change the call to
>> `parser.add_argument(‘layer’, …)` it’d change to the latter behavior.
>>
> 
> Worth noting that you could, and probably should, also use nargs=‘+’ to let
> the user specify multiple layers to check, rather than a single path, if
> you go the latter route, and if not, you could change it to an append style
> (for the ‘action’) argument to accomplish the same.

Yes, it's better to change the -l option to use a positional argument
with nargs +.

The detect_layers functionality is used because i want to cover cases
when the user clones a repository that comes with multiple layers like
meta-openembedded.


Best regards,
	alimon


> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20170220/cb39cd5e/attachment-0002.sig>


More information about the Openembedded-core mailing list