#NEWLINE# @ do #NEWLINE# def upload_packages( scratch_directory , target_bucket , version , build_server , top_level ) : #NEWLINE# #INDENT# "\n    The ClusterHQ yum and deb repositories contain packages for Flocker, as\n    well as the dependencies which aren't available in CentOS 7. It is\n    currently hosted on Amazon S3. When doing a release, we want to add the\n    new Flocker packages, while preserving the existing packages in the\n    repository. To do this, we download the current repository, add the new\n    package, update the metadata, and then upload the repository.\n\n    :param FilePath scratch_directory: Temporary directory to download\n        repository to.\n    :param bytes target_bucket: S3 bucket to upload repository to.\n    :param bytes version: Version to download packages for.\n    :param bytes build_server: Server to download new packages from.\n    :param FilePath top_level: The top-level of the flocker repository.\n    " #NEWLINE# distribution_names = available_distributions ( flocker_source_path = top_level ) #NEWLINE# for distribution_name in distribution_names : #NEWLINE# #INDENT# distribution = DISTRIBUTION_NAME_MAP [ distribution_name ] #NEWLINE# architecture = distribution . native_package_architecture ( ) #NEWLINE# ( yield update_repo ( package_directory = scratch_directory . child ( b'{}-{}-{}' . format ( distribution . name , distribution . version , architecture ) ) , target_bucket = target_bucket , target_key = os . path . join ( ( distribution . name + get_package_key_suffix ( version ) ) , distribution . version , architecture ) , source_repo = os . path . join ( build_server , b'results/omnibus' , version , b'{}-{}' . format ( distribution . name , distribution . version ) ) , packages = FLOCKER_PACKAGES , flocker_version = version , distribution = distribution ) )