[U-Boot] [PATCH 1/2] WIP: Changes to patman libraries

Simon Glass sjg at chromium.org
Thu Nov 1 21:59:36 CET 2012


Hi Wolfgang,

On Wed, Oct 31, 2012 at 5:04 PM, Simon Glass <sjg at chromium.org> wrote:
> Hi Wolfgang,
>
> On Wed, Oct 31, 2012 at 4:40 PM, Wolfgang Denk <wd at denx.de> wrote:
>> Dear Simon,
>>
>> In message <CAPnjgZ3us4yoeqOHxozQ6VPHXhaKJdLWfb0HPWHWvnnUaZ0Ghg at mail.gmail.com> you wrote:
>>>
>>> >> These changes are required to the patman libraries. This is not a proper
>>> >> patch yet, just sometime to try out.
>>> >
>>> > ...are required.  So.  And why exactly?  Or what is the purpose of
>>> > these changes?
>>>
>>> Just so that people can try the builder if they want to. The patches
>>> enhance functions in patman, mostly on the git side, so that the
>>> builder can do its job. For example it needs to clone a repo, checkout
>>> code into a different directory and work with branches a bit more.
>>>
>>> This is not a useful patch for any other purpose (e.g. review) - it is
>>> just a lump of code. If there is interest in this it will need to be
>>> turned into proper patches.
>>
>> Hm...  I apologize, but I'm just an old man, and a bit slow of wits
>> these days.  I cannot review any such code without knowing what it is
>> suppose to acchieve.  Maybe you should add such explanations to the
>> commit message, even if it's only a WIP patch?  I would definitely
>> appreciate this (as it would help me to understand what this is all
>> about).

Here are the notes for the changes. When I split this into commits I
will put these comments with each commit.

checkpatch.py:
- remove two commented-out lines which are no-longer needed

command.py:

Change these functions to return a CommandResult class instead of just
a return code.
This allows us to capture output, errors and return codes. Should we
need to expand
the functionality in the future, it will be fairly easy - just add new
members to the class.

Also provide an option to raise an exception on error (non-zero return
code), rather than
always just returning the return code. This can make it easier to
handle unforseen
errors.

Provide a back-door way of killing all tasks (although this needs further work).

cros_subprocess.py:

This is a slight enhancement of the build-in python subprocess module.
It permits
access to command output while it is in progress. This is important if
we want to
filter it for errors, etc., while still displaying it on the terminal.
Since some tasks can
take a minute to complete, it is not acceptable to show no output
during this time.

gitutils.py:

Several functions are enhanced so that you can specify a --git-dir
with the command,
and also a --work-tree. This allows us to work with git repositories outside the
current directory. This is needed for buildman, since it has multiple
threads working
in their own place with their own checked-out commit.

New methods are added to clone a repo, fetch updates from a repo, checkout a
commit, and obtain an expression for the list of commits in a branch.

patchstream.py

GetMetaDataForList() now supports --git-dir, and also allows an
existing Series to be
added too. This allows us to call it twice with different commit
ranges and get a single,
unified series. The old GetMetaData() function now calls this.

terminal.py:

This now supports both bright and normal ANSI colours.

Colours are automatically supressed if the stdout is not a terminal.
The avoids getting
ANSI characters in piped output.

Regards,
Simon


More information about the U-Boot mailing list