Package commands :: Module branch_fedora
[hide private]
[frames] | no frames]

Source Code for Module commands.branch_fedora

 1  from flask_script import Command, Option 
 2  from coprs.logic import coprs_logic 
 3   
 4  from commands.create_chroot import CreateChrootCommand 
 5  from commands.rawhide_to_release import RawhideToReleaseCommand 
 6   
 7   
8 -class BranchFedoraCommand(Command):
9 """ 10 Branch fedora-rawhide-* chroots to fedora-N* and execute rawhide_to_release 11 on them 12 """ 13 14 option_list = [ 15 Option("fedora_version", 16 help="The version of Fedora to branch Rawhide into, e.g. 32", 17 type=int), 18 Option( 19 "--dist-git-branch", 20 "-b", 21 dest="branch", 22 help="Branch name for this set of new chroots"), 23 ] 24
25 - def run(self, fedora_version, branch=None):
26 rawhide_chroots = coprs_logic.MockChrootsLogic.get_from_name( 27 "fedora-rawhide", 28 active_only=True, 29 noarch=True).all() 30 31 chroot_pairs = { 32 'fedora-{}-{}'.format(fedora_version, rch.arch): 33 'fedora-rawhide-{}'.format(rch.arch) 34 for rch in rawhide_chroots 35 } 36 37 c_cmd = CreateChrootCommand() 38 c_cmd.run(chroot_pairs.keys(), branch, True) 39 40 r2r_cmd = RawhideToReleaseCommand() 41 for new_chroot, rawhide_chroot in chroot_pairs.items(): 42 r2r_cmd.run(rawhide_chroot, new_chroot)
43