_objinst->name().c_str(), cmdhint.str().c_str());
}
+ case NOT_IN_REPOS:
+ {
+ return str::form(
+ _("Package '%s' is not available in your repositories."
+ " Cannot reinstall, upgrade, or downgrade."),
+ _objinst->name().c_str());
+ }
+
case SELECTED_IS_OLDER:
{
ostringstream cmdhint;
case UPD_CANDIDATE_CHANGES_VENDOR:
case UPD_CANDIDATE_HAS_LOWER_PRIO:
case UPD_CANDIDATE_IS_LOCKED:
+ case NOT_IN_REPOS:
case SELECTED_IS_OLDER:
case PATCH_NOT_NEEDED:
case PATCH_UNWANTED:
PoolItem instobj = get_installed_obj(s);
if (instobj)
{
+ if (s->availableEmpty())
+ {
+ if (!_opts.force)
+ addFeedback(Feedback::ALREADY_INSTALLED, pkg, instobj, instobj);
+ addFeedback(Feedback::NOT_IN_REPOS, pkg, instobj, instobj);
+ MIL << s->name() << " not in repos, can't (re)install" << endl;
+ return;
+ }
+
// whether user requested specific repo/version/arch
bool userconstraints =
pkg.parsed_cap.detail().isVersioned()
PoolItem best;
if (userconstraints)
updateTo(pkg, *sit);
+ else if (_opts.force)
+ updateTo(pkg, s->highestAvailableVersionObj());
else if ((best = s->updateCandidateObj()))
updateTo(pkg, best);
else if (changes_vendor && !_opts.allow_vendor_change)
UPD_CANDIDATE_IS_LOCKED,
/**
+ * The installed package is no longer available in repositories.
+ * => can't reinstall, can't update/downgrade..
+ */
+ NOT_IN_REPOS,
+
+ /**
* Selected object is not the highest available, because of user
* restrictions like repo(s), version, architecture.
*/
Out & out();
Config & config() { return _config; }
const GlobalOptions & globalOpts() const { return _gopts; }
+ GlobalOptions & globalOptsNoConst() { return _gopts; }
const parsed_opts & cOpts() const { return _copts; }
const ZypperCommand & command() const { return _command; }
const std::string & commandHelp() const { return _command_help; }
sr.install(rawargs);
BOOST_CHECK(sr.hasFeedback(SolverRequester::Feedback::ALREADY_INSTALLED));
- BOOST_CHECK(sr.hasFeedback(SolverRequester::Feedback::NO_UPD_CANDIDATE));
+ BOOST_CHECK(sr.hasFeedback(SolverRequester::Feedback::NOT_IN_REPOS));
}
// request : install diffutils
#include "zypp/Target.h"
#include "zypp/ResPool.h"
+#include "Zypper.h"
+
using std::cin;
using std::cout;
using std::cerr;
filesystem::clean_dir( _rootdir );
}
+
+ Zypper & zypper = *Zypper::instance();
+ zypper.globalOptsNoConst().root_dir = _rootdir.asString();
+ zypper.globalOptsNoConst().rm_options = zypp::RepoManagerOptions(_rootdir.asString());
+ zypper.globalOptsNoConst().rm_options.knownReposPath = _rootdir / "repos.d";
+
+
if ( ! sysarch_r.empty() )
ZConfig::instance().setSystemArchitecture( sysarch_r );
USR << "CREATED TESTSETUP below " << _rootdir << endl;