Re: [PATCH] Quieten build & ensure API build scripts exit with non-zero status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/7/4 Daniel P. Berrange <berrange@xxxxxxxxxx>:
> The current API build scripts will continue and exit with a zero
> status even if they find problems. This has been the cause of many
> build problems, or hidden build errors, in the past. Change the
> scripts so they always exit with a non-zero status for any problems
> they do not understand. Also turn off all debug output by default
> so they respect $(AM_V_GEN)
>
> * docs/Makefile.am: Use $(AM_V_GEN) for API/HTML scripts
> * docs/apibuild.py, python/generator.py: Exit with non-zero status
>  if problems are found. Also be silent, not outputting any debug
>  messages.
> * src/Makefile.am: Use $(AM_V_GEN) for ESX generator
> * python/Makefile.am: Tweak rule
> ---
>  docs/Makefile.am    |   11 ++----
>  docs/apibuild.py    |   95 ++++++++++++++++++++++++++++++--------------------
>  python/Makefile.am  |    6 ++--
>  python/generator.py |   16 +++++---
>  src/Makefile.am     |    2 +-
>  5 files changed, 75 insertions(+), 55 deletions(-)

> diff --git a/docs/apibuild.py b/docs/apibuild.py
> index f31a853..cb273dc 100755
> --- a/docs/apibuild.py
> +++ b/docs/apibuild.py
> @@ -11,6 +11,8 @@ import os, sys
>  import string
>  import glob
>
> +quiet=1

Python has True/False, but you could also stick to 1/0 as the
generator code looks quite C-ish anyway :)

> @@ -2368,5 +2379,13 @@ if __name__ == "__main__":
>     if len(sys.argv) > 1:
>         debug = 1
>         parse(sys.argv[1])
> +        if warnings > 0:
> +            sys.exit(2)
> +        else:
> +            sys.exit(0)
>     else:
>         rebuild()
> +        if warnings > 0:
> +            sys.exit(2)
> +        else:
> +            sys.exit(0)

Why do you add the same code in the if and the else clause? You could
simplify this by adding it after the if/else clauses

>  $(libvirtmod_la_OBJECTS): $(GENERATED)
>
> diff --git a/python/generator.py b/python/generator.py
> index c27ff73..d3a3616 100755
> --- a/python/generator.py
> +++ b/python/generator.py
> @@ -11,6 +11,8 @@ import sys
>  import string
>  import re
>
> +quiet=1

Same comment about True/False.

ACK, as my comments are just about stylistic things.

-- 
Matthias Bolte
http://photron.blogspot.com

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]