All of lore.kernel.org
 help / color / mirror / Atom feed
From: cyril Romain <c.romain@laposte.net>
To: Using the OpenEmbedded metadata to build Linux Distributions
	<openembedded-devel@lists.openembedded.org>
Cc: Using the OpenEmbedded metadata to build Linux Distributions
	<openembedded-devel@openembedded.org>
Subject: Re: Improving consistency
Date: Tue, 05 Sep 2006 16:16:31 +0200	[thread overview]
Message-ID: <44FD86BF.2070200@laposte.net> (raw)
In-Reply-To: <44FC2E10.2020807@dominion.kabel.utwente.nl>

[-- Attachment #1: Type: text/plain, Size: 2419 bytes --]

Koen Kooi wrote:
>>> Is it possible to have a 'bitbake sanitize <provider>' command that will output a
>>> sanitized .bb? It doesn't have to be perfect, but some aid in this tedious task would be
>>> helpfull.
>>>       
>> That depends. I have been thinking about this for quite some time,
>> because
>> I really would like to have such a thing. We already have a bit of the
>> infrastructure
>> in place, but the one thing missing is that once the metadata is parsed,
>> we lose
>> a) order and b) source statements (pointers to a .bb or even better the
>> textual entity
>> that was the source for a certain statement).
>>     
>
> What about a simple script that sorts DESCRIPTION, LICENSE, do_install(), etc? That would
> make an excellent addition to the contrib/ dir in the repo.
>   

Ok.
In attachment is a first attempt for such a script. It is a 
quick-and-dirty written script that don't write any file yet. It only 
dumps the sanitized file into the console.
Since Python does not have ordered dictionary, I used this one (also in 
attachment): http://www.voidspace.org.uk/python/odict.html

To test it:
./sanitize.py yourBitbakeFile.bb

To create a sanitized file and a patch e.g. for gcc_4.1.1.bb:
./sanitize.py gcc_4.1.1.bb > gcc_4.1.1.bb.sanitized; diff -u 
gcc_4.1.1.bb  gcc_4.1.1.bb.sanitized > gcc_4.1.1.bb.patch

There is still many things to do, but if you find it useful I can 
improve and finalize it.
As you will see, the script dumps warnings on unknown variables, i.e. 
the variables that are used in .bb file that are not listed in the Style 
Guidelines.
Can anyone please update the Style Guidelines with the complete list of 
variables ?
Hum... maybe I'd rather using the script to grep for all the unknown 
variables and add them to the wiki, so that you (Mickey or anyone else) 
can sort them.

I suggest to add in the Style Guidelines a rule that recommend to put 
comments into do_ routines or into VARIABLE="... " sections, otherwise 
it is tricky or even not possible to correctly handle comments.

I don't know how bitbake internally handles data from a .bb file, but 
maybe it is better to handle the sanitization from bitbake, especially 
because bitbake knows how to read (and therefore to write) a .bb file. 
Any thought on that ?

Feel free to answer for any requests, bugs or suggestions.

Best regards,

  Cyril



  reply	other threads:[~2006-09-05 15:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1GKCrb-0005hO-P4@linuxtogo.org>
2006-09-04 12:41 ` Improving consistency Michael 'Mickey' Lauer
2006-09-04 13:18   ` Øyvind Repvik
2006-09-04 13:22     ` Michael 'Mickey' Lauer
2006-09-04 13:23   ` Koen Kooi
2006-09-04 13:38     ` Michael 'Mickey' Lauer
2006-09-04 13:45       ` Koen Kooi
2006-09-05 14:16         ` cyril Romain [this message]
2006-09-06 17:45           ` Koen Kooi
2006-09-06  7:55   ` cyril Romain
     [not found] <mailman.580.1157393016.22819.openembedded-devel@lists.openembedded.org>
2006-09-05  6:47 ` Frans Meulenbroeks
2006-09-05  7:35   ` Koen Kooi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44FD86BF.2070200@laposte.net \
    --to=c.romain@laposte.net \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=openembedded-devel@openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.