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? Libzypp is already initialized in inst-sys, I'd need to reinitialize it in the /mnt chroot, disable those sources and close the /mnt again... 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... L.