'Return the textual representation of this package spec
The output should be consumable by parse() and produce the same
package specification.
We find that it\'s acceptable to put the currently set default tag
as the package explicit tag in the textual definition for completeness.
:return: package specification in a textual representation'

def to_text(self):

    default_tag = get_default_koji_tag()
    if self.build:
        if self.subpackages:
            return ('%s:%s' % (self.build, ','.join(self.subpackages)))
        else:
            return ('%s' % self.build)
    elif self.tag:
        if self.subpackages:
            return ('%s:%s:%s' % (self.tag, self.package, ','.join(self.subpackages)))
        else:
            return ('%s:%s' % (self.tag, self.package))
    elif (default_tag is not None):
        if self.subpackages:
            return ('%s:%s:%s' % (default_tag, self.package, ','.join(self.subpackages)))
        else:
            return ('%s:%s' % (default_tag, self.package))
    else:
        raise ValueError('neither    build    or    tag    is    set')
