[virt-tools-list] [PATCH v6 4/5] add option for snapshot-id suffix to __version__

Cole Robinson crobinso at redhat.com
Sun Apr 14 18:35:14 UTC 2013


On 04/13/2013 05:42 PM, Gene Czarcinski wrote:
> 1.  The added suffix is in the form YYYYMMDD and that is all.
> 
> 2.  Code is added to classes my_sdist and my_rpm to check and
> see is a snapshot id is requested (--snapshot) and, if
> requested, to append the id to the value of cliconfig.__version__
> 
> 3.  The added suffix only applies to the name of the sdist-tarball
> and the rpm spec file it includes ... the "internal" version
> remains unchanged.
> .
> Signed-off-by: Gene Czarcinski <gene at czarc.net>
> ---
>  setup.py             | 33 +++++++++++++++++++++++++++++----
>  virtcli/cliconfig.py |  2 ++
>  2 files changed, 31 insertions(+), 4 deletions(-)
> 
> diff --git a/setup.py b/setup.py
> index aa712c2..ace1c3e 100644
> --- a/setup.py
> +++ b/setup.py
> @@ -5,6 +5,7 @@ import fnmatch
>  import os
>  import sys
>  import unittest
> +from datetime import date
>  
>  from distutils.core import Command, setup
>  from distutils.command.sdist import sdist
> @@ -20,6 +21,10 @@ from DistUtilsExtra.command.build_icons import build_icons
>  
>  from virtcli import cliconfig
>  
> +sdist.user_options.insert(0, ("snapshot", None,
> +         "add snapshot id to version"))
> +sdist.boolean_options.insert(0, "snapshot")
> +

Why do it like this and not just add user_options to the my_sdist definition?
Look at the configure example that you edited in the previous patch.

Rest looks fine.

- Cole




More information about the virt-tools-list mailing list