[yocto] [PATCH 05/10][AUH] upgradehelper.py: Add sanity test for ensure that git is configured.

Paul Eggleton paul.eggleton at linux.intel.com
Tue Nov 10 00:59:20 PST 2015


On Monday 09 November 2015 16:01:36 Aníbal Limón wrote:
> [YOCTO #8390]
> 
> Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
> ---
>  upgradehelper.py | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/upgradehelper.py b/upgradehelper.py
> index 9b321f6..ae40fb1 100755
> --- a/upgradehelper.py
> +++ b/upgradehelper.py
> @@ -28,6 +28,7 @@
> 
>  import argparse
>  import os
> +from subprocess import call
>  import logging as log
>  from logging import debug as D
>  from logging import info as I
> @@ -734,17 +735,22 @@ if __name__ == "__main__":
>      global settings
>      global maintainer_override
> 
> +    if not os.getenv('BUILDDIR', False):
> +        E(" You must source oe-init-build-env before running this
> script!\n") 
> +        exit(1)
> +
> +    devnull = open(os.devnull, 'wb');
> +    if call(["git", "config", "user.name"], stdout=devnull, stderr=devnull)
> or \ 
> +        call(["git", "config", "user.email"], stdout=devnull,
> stderr=devnull): 
> +        E(" Git isn't configure please configure user name and email\n") 
> +        exit(1)

"isn't configure" -> "isn't configured"

Also, we're doing an awful lot of "from xxxx import yyyy" in this code which 
for the most part seems like poor style. For this addition can you simply 
import subprocess and then use subprocess.call() ?

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list