[zypp-devel] Initialisation of Target
Hi, I am stuck at trying to initialise the target, so as to proceed with the installation of packages. I am getting a null zypp::ui::Selectable::Ptr, when I use zypp::ui::Selectable::get(). Because of this, I am not able to carry out installation of packages. Also, I did not understand what parameter is to be passed ti initialiseTarget. My Code : https://github.com/openSUSE/one-click-installer/blob/master/playground/parse... Regards,. Saurabh -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org
On Sunday 03 June 2012 13:43:05 Saurabh Sood wrote:
Hi, I am stuck at trying to initialise the target, so as to proceed with the installation of packages. I am getting a null zypp::ui::Selectable::Ptr, when I use zypp::ui::Selectable::get().
Then the name 'packageList.at( 0 )->name().toStdString()' you are looking for is not available in the pool. You can list your pools content e.g. using: for ( const zypp::PoolItem & pi : zypp::ResPool::instance() ) { std::cout << pi << endl; }
Because of this, I am not able to carry out installation of packages. Also, I did not understand what parameter is to be passed ti initialiseTarget.
The 'Target' represents the system and the packages already installed on it.
initializeTarget() takes your systems root directory as argument. Usually this
is "/" (unless you prepare some system chroot).
Remember the Target does _not_ provide the packages available for
installation. This is done by Repositories.
Unless '( addrepo == true )' your code seems to load the installed packages
only. But you probably you want to load all enabled repositories (probably
plus some temp. repo defined by the ymp file). Otherwise it might be hard to
install or resolve dependencies.
When adding your (temp.?) ymp file repos:
(- consider using RepoManager::makeStupidAlias to derive an alias from the url
string.)
- rman.addRepository(repoinfo): This call makes the repoinfo persistent; i.e.
it's written to /etc/zypp/repos.d. Don't call it if your repo is just
temporary. But this does not load the repos data into the pool.
- rman.refreshMetadata/buildCache/loadFromCache(repoinfo): This loads a
repoinfos data into the pool, so they are available for installation.
- Remember one of the first mails I sent. defaultLoadSystem initializes the
target and all per default enabled repositories:
#include
participants (2)
-
Michael Andres
-
Saurabh Sood