sanity-check build target before running a chain-build

This commit is contained in:
Mike Bonnet 2007-05-31 16:28:14 -04:00
parent 6f8e9bf4ab
commit 2d052475c2

View file

@ -643,6 +643,14 @@ def handle_chain_build(options, session, args):
if dest_tag['locked']:
parser.error(_("Destination tag %s is locked" % dest_tag['name']))
# check that the destination tag is in the inheritance tree of the build tag
# otherwise there is no way that a chain-build can work
ancestors = session.getFullInheritance(build_target['build_tag'])
if dest_tag['id'] not in [ancestor['parent_id'] for ancestor in ancestors]:
print _("Packages in destination tag %(dest_tag_name)s are not inherited by build tag %(build_tag_name)s" % build_target)
print _("Target %s is not usable for a chain-build" % build_target['name'])
return 1
sources = args[1:]
srpms = {}