// ---------------------------------------------------------------------------
-static int do_init_repos(const Zypper & zypper)
+static void do_init_repos(Zypper & zypper)
{
// load gpg keys
cond_init_target ();
{
cerr << format(_("Repository '%s' not found.")) % specific_repo << endl;
ERR << specific_repo << " not found";
- return ZYPPER_EXIT_ERR_INVALID_ARGS;
+ zypper.setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ return;
}
catch (const Exception & ex)
{
% specific_repo << endl;
cerr_v << _("Reason: ") << ex.asUserString() << endl;
ZYPP_CAUGHT(ex);
- return ZYPPER_EXIT_ERR_ZYPP;
+ zypper.setExitCode(ZYPPER_EXIT_ERR_ZYPP);
+ return;
}
}
else
}
}
}
-
- return ZYPPER_EXIT_OK;
}
// ----------------------------------------------------------------------------
-int init_repos(const Zypper & zypper)
+void init_repos(Zypper & zypper)
{
static bool done = false;
//! \todo this has to be done so that it works in zypper shell
if (done)
- return ZYPPER_EXIT_OK;
+ return;
if ( !gSettings.disable_system_sources )
{
- return do_init_repos(zypper);
+ do_init_repos(zypper);
}
done = true;
- return ZYPPER_EXIT_OK;
}
// ----------------------------------------------------------------------------
* Reads known enabled repositories and stores them in gData.
* This command also refreshes repos with auto-refresh enabled.
*
- * \return ZYPPER_EXIT_ERR_INVALID_ARGS if --repo does not specify a valid repository,
- * ZYPPER_EXIT_ERR_ZYPP on error, ZYPPER_EXIT_OK otherwise.
+ * sets exit status to
+ * - ZYPPER_EXIT_ERR_INVALID_ARGS if --repo does not specify a valid repository,
+ * - ZYPPER_EXIT_ERR_ZYPP on error
*/
-int init_repos(const Zypper & zypper);
+void init_repos(Zypper & zypper);
/**
* List defined repositories.
return;
}
- int initret = init_repos(*this);
- if (initret != ZYPPER_EXIT_OK)
- {
- setExitCode(initret);
+ init_repos(*this);
+ if (exitCode() != ZYPPER_EXIT_OK)
return;
- }
//! \todo support temporary additional repos
/*
return;
}
- int initret = init_repos(*this);
- if (initret != ZYPPER_EXIT_OK)
- {
- setExitCode(initret);
+ init_repos(*this);
+ if (exitCode() != ZYPPER_EXIT_OK)
return;
- }
+
cond_init_target();
// load only repo resolvables, we don't need the installed ones
load_repo_resolvables(*this, false /* don't load to pool */);
options.resolveConflicts();
- int initret = init_repos(*this);
- if (initret != ZYPPER_EXIT_OK)
- {
- setExitCode(initret);
+ init_repos(*this);
+ if (exitCode() != ZYPPER_EXIT_OK)
return;
- }
+
cond_init_target(); // calls ZYpp::initializeTarget("/");
establish();
cond_init_target ();
- int initret = init_repos(*this);
- if (initret != ZYPPER_EXIT_OK)
- {
- setExitCode(initret);
+ init_repos(*this);
+ if (exitCode() != ZYPPER_EXIT_OK)
return;
- }
// TODO additional_sources
// TODO warn_no_sources
}
cond_init_target ();
- int initret = init_repos(*this);
- if (initret != ZYPPER_EXIT_OK)
- {
- setExitCode(initret);
+ init_repos(*this);
+ if (exitCode() != ZYPPER_EXIT_OK)
return;
- }
cond_load_resolvables(*this);
establish ();
show_patches ();
cerr << _("Running as 'rug', can't do 'best-effort' approach to update.") << endl;
}
cond_init_target ();
- int initret = init_repos(*this);
- if (initret != ZYPPER_EXIT_OK)
- {
- setExitCode(initret);
+ init_repos(*this);
+ if (exitCode() != ZYPPER_EXIT_OK)
return;
- }
cond_load_resolvables(*this);
establish ();
}
cond_init_target ();
- int initret = init_repos(*this);
- if (initret != ZYPPER_EXIT_OK)
- {
- setExitCode(initret);
+ init_repos(*this);
+ if (exitCode() != ZYPPER_EXIT_OK)
return;
- }
cond_load_resolvables(*this);
establish ();
cerr << _("Running as 'rug', can't do 'best-effort' approach to update.") << endl;
}
cond_init_target ();
- int initret = init_repos(*this);
- if (initret != ZYPPER_EXIT_OK)
- {
- setExitCode(initret);
+ init_repos(*this);
+ if (exitCode() != ZYPPER_EXIT_OK)
return;
- }
cond_load_resolvables(*this);
establish ();
gSettings.license_auto_agree = true;
cond_init_target ();
- int initret = init_repos(*this);
- if (initret != ZYPPER_EXIT_OK)
- {
- setExitCode(initret);
+ init_repos(*this);
+ if (exitCode() != ZYPPER_EXIT_OK)
return;
- }
cond_load_resolvables(*this);
establish ();
zypp::UpgradeStatistics opt_stats;
}
cond_init_target ();
- int initret = init_repos(*this);
- if (initret != ZYPPER_EXIT_OK)
- {
- setExitCode(initret);
+ init_repos(*this);
+ if (exitCode() != ZYPPER_EXIT_OK)
return;
- }
cond_load_resolvables(*this);
establish ();