On Thu, Sep 27, Lukas Ocilka wrote:
Michael Andres wrote:
On Wed, Sep 26, Lukas Ocilka wrote:
Solution? A very quick but very dirty hack would be to remove all sources from /etc/zypp/repos.d/ before storing the actual set of sources to the target.
AFAIK we always just disabled the sources located on the old system. Until we are able to make some intelligent guess we should leave it to the user to finaly delete them.
// old system root Pathname mgrdir_r( "/mnt" );
// prefix paths with /mnt // (we should add a convenience ctor for that) RepoManagerOptions mgropt; mgropt.repoCachePath = mgrdir_r/mgropt.repoCachePath; mgropt.repoRawCachePath = mgrdir_r/mgropt.repoRawCachePath; mgropt.knownReposPath = mgrdir_r/mgropt.knownReposPath";
// load old systems repos... RepoManager oldrepoManager( mgropt ); RepoInfoList oldrepos = oldrepoManager.knownRepositories();
// ...and disable them. for_( it, oldrepos.begin(), oldrepos.end() ) { oldrepoManager.modifyRepository( it->alias(), it->setEnabled( false ) ); }
Thanks,
Hmm, and are Pkg Bindings able to do that?
Why not.
This would be partly a solution, but it doesn't solve the whole problem. Imagine the situation:
* There are old sources in /mnt -> now disabled (as MA suggests) * Newly added sources (the same as found in /mnt) will be stored after SaveAll function call (some enabled, the other disabled).
This leads into having the old sources twice...
..i.e. two repos with the same alias? Only if you avoid using the RepoManager interface and do it on your own. If you use a RepoManager like the above, you know about the old systems repos, you can adapt their status as needed and you can inject new repos avoiding alias clashes. (and if something is misssing or inconvenient we can improve. just ask.) -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org