[zypp-devel] repo modification use cases
- rename repository (alias, i.e. identifier) (if it is the only repo in the .repo file, rename also the repo file) - disable/enable the repo - disable/enable autorefresh for the repo - set long name (description) - disable/enable gpg check, specify signature location - add/remove a baseUrl - add/remove a mirror URL - ...anything else? - since we support more repositories defined within a single .repo file this will need to be considered if we decide to implement the modifications by removing old repo file and replacing it with a new (modified) one. I think an additional API would be handy for this task (covering all of the above) at last. Something like: RepoManager::modifyRepository(const std::string & repo_alias, const RepoInfo & new); Client just creates it's own modified RepoInfo object and leaves all what's needed on zypp. Of course we need to provide methods for modifying the RepoInfo that we currently don't provide (if any). Also RepoManager::getRepoInfo(const std::string & repo_alias) would be nice so that clients don't need to extract the RepoInfo file from knownRepositories() themselves, if they want to create modified RepoInfo out of the original one. This would be a very simple convenience method. So the client code could look like: RepoManager manager; RepoInfo repo = manager.getRepoInfo(alias); repo.setAlias(new_alias); repo.setEnabled(false); repo.removeMirror(url); // whatever manager.modifyRepository(alias, repo); Cheers, Jano -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Wednesday 20 June 2007 13:27, Jan Kupec wrote:
RepoManager manager; RepoInfo repo = manager.getRepoInfo(alias); repo.setAlias(new_alias); repo.setEnabled(false); repo.removeMirror(url); // whatever manager.modifyRepository(alias, repo);
I like this one. However, no need to pass the alias, as it should be in the repoinfo itself (??) -- Duncan Mac-Vicar Prett Novell :: SUSE R&D, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Duncan Mac-Vicar wrote:
On Wednesday 20 June 2007 13:27, Jan Kupec wrote:
RepoManager manager; RepoInfo repo = manager.getRepoInfo(alias); repo.setAlias(new_alias); repo.setEnabled(false); repo.removeMirror(url); // whatever manager.modifyRepository(alias, repo);
I like this one. However, no need to pass the alias, as it should be in the repoinfo itself (??)
not for the case where you want to rename it :O) j. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (2)
-
Duncan Mac-Vicar
-
Jan Kupec