Copy packages between repos

          copy SOURCE DESTINATION

        Where SOURCE can be either LOCAL-FILE or REPO:PACKAGE-SPEC
        DESTINATION can be either a REPO: or a directory.

def do_copy(self, line):
        '''
        Copy packages between repos

          copy SOURCE DESTINATION

        Where SOURCE can be either LOCAL-FILE or REPO:PACKAGE-SPEC
        DESTINATION can be either a REPO: or a directory.
        '''
        words = line.split()
        source, destination = words
        destination_repo = self._get_destination_repo(destination)
        local_file_source = ':' not in source

        if local_file_source:
            destination_repo.upload_packages([source])
        else:
            source_repo_name, _, package_spec = source.partition(':')
            try:
                source_repo = self.network.get_repo(source_repo_name)
            except UnknownRepoError:
                raise ShellError(
                    'Unknown repository {}'.format(source_repo_name)
                )

            # copy between repos with the help of temporary storage
            try:
                source_repo.download_packages(package_spec, self.__temp_dir)
                destination_repo.upload_packages(self.__temp_dir.files)
            finally:
                self.__temp_dir.clear()