}
Set<ContentSource> alreadyAssociatedContentSources = repo.getContentSources();
// Only add it if it's not already associated with this repo.
if (!alreadyAssociatedContentSources.contains(contentSource)) {
RepoContentSource repoContentSourceMapping = repo.addContentSource(contentSource);
entityManager.persist(repoContentSourceMapping);
}
Set<PackageVersion> alreadyAssociatedPackageVersions = new HashSet<PackageVersion>(
repo.getPackageVersions());