[PATCH] include variant in the name for .treeinfo when it exists

Brian C. Lane bcl at redhat.com
Thu Mar 5 01:27:28 UTC 2015


On Fri, Feb 27, 2015 at 11:37:09PM -0600, Dennis Gilmore wrote:
> if there is a variant set include that in the name, otherwise
> all the variants end up having the same name set.
> 
> Signed-off-by: Dennis Gilmore <dennis at ausil.us>
> ---
>  src/pylorax/treeinfo.py | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/pylorax/treeinfo.py b/src/pylorax/treeinfo.py
> index 6f3f620..ac9806c 100644
> --- a/src/pylorax/treeinfo.py
> +++ b/src/pylorax/treeinfo.py
> @@ -33,11 +33,16 @@ class TreeInfo(object):
>  
>          self.c = ConfigParser.ConfigParser()
>  
> +        if variant:
> +            name = "%s-%s-%s" % (name, variant, version)
> +        else:
> +            name = "%s-%s" % (name, version)
> +
>          section = "general"
>          data = {"timestamp": time.time(),
>                  "family": product,
>                  "version": version,
> -                "name": "%s-%s" % (product, version),
> +                "name": name,
>                  "variant": variant or "",
>                  "arch": basearch,
>                  "packagedir": packagedir}
> -- 
> 2.3.0

After looking at this again I think there's an additional problem --
treeinfo already includes variant in it if set. I don't have a
specification for what .treeinfo should contain or what tools use it so I
don't think it's safe to put variant into name. Actually, name really
ought to just be the name since version is also already there. Users of
.treeinfo ought to be the ones to combine them however they want to.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list