(#238165, F#301963).
.TP
.I \-r, \-\-rug\-compatible
Turns on rug compatibility. See compatibility notes next to affected commands.
+.TP
+.I \-R, \-\-root <dir>
+Operates on a different root directory.
.SH "FILES"
.TP
-------------------------------------------------------------------
+Thu Feb 1 14:25:29 CET 2007 - mvidner@suse.cz
+
+- Added global option --root to operate on a different directory
+ (#238165, F#301963).
+
+-------------------------------------------------------------------
Wed Jan 31 16:19:38 CET 2007 - jkupec@suse.cz
- locale support added (merged from 10.2/SP1 branch)
if (!done) {
#ifdef LIBZYPP_1xx
cerr_v << _("Initializing Target") << _(" (old way)") << endl;
- God->initTarget("/", true);
+ God->initTarget(gSettings.root_dir, true);
#else
cerr_v << _("Initializing Target") << endl;
- God->initializeTarget("/");
+ God->initializeTarget(gSettings.root_dir);
#endif
done = true;
}
try
{
cerr << _("Restoring system sources...") << endl;
- manager->restore("/");
+ manager->restore(gSettings.root_dir);
}
// catch (const SourcesAlreadyRestoredException& excpt) {
// }
try
{
#ifdef LIBZYPP_1xx
- sources = SourceManager::sourceManager()->knownSourceInfos ("/");
+ sources = SourceManager::sourceManager()->knownSourceInfos (gSettings.root_dir);
#else
zypp::storage::PersistentStorage store;
- store.init( "/" );
+ store.init( gSettings.root_dir );
sources = store.storedSources();
#endif
}
cerr_vv << "Constructing SourceManager" << endl;
SourceManager_Ptr manager = SourceManager::sourceManager();
cerr_vv << "Restoring SourceManager" << endl;
- manager->restore ("/", true /*use_cache*/);
+ manager->restore (gSettings.root_dir, true /*use_cache*/);
list<SourceManager::SourceId> sourceIds;
}
cerr_vv << "Storing source data" << endl;
- manager->store( "/", true /*metadata_cache*/ );
+ manager->store( gSettings.root_dir, true /*metadata_cache*/ );
}
template<typename T>
SourceManager_Ptr manager = SourceManager::sourceManager();
cerr_vv << "Restoring SourceManager" << endl;
try {
- manager->restore ("/", true /*use_cache*/);
+ manager->restore (gSettings.root_dir, true /*use_cache*/);
}
catch (const Exception & ex) {
// so what if sources cannot be restored
}
cerr_vv << "Storing source data" << endl;
- manager->store( "/", true /*metadata_cache*/ );
+ manager->store( gSettings.root_dir, true /*metadata_cache*/ );
}
//! rename a source, identified in any way: alias, url, id
cerr_vv << "Constructing SourceManager" << endl;
SourceManager_Ptr manager = SourceManager::sourceManager();
cerr_vv << "Restoring SourceManager" << endl;
- manager->restore ("/", true /*use_cache*/);
+ manager->restore (gSettings.root_dir, true /*use_cache*/);
Source_Ref src;
}
cerr_vv << "Storing source data" << endl;
- manager->store( "/", true /*metadata_cache*/ );
+ manager->store( gSettings.root_dir, true /*metadata_cache*/ );
#endif
}
try
{
- store.init( "/" );
+ store.init( gSettings.root_dir );
sources = store.storedSources();
}
catch ( const Exception &e )
previous_code(-1),
disable_system_sources(false),
disable_system_resolvables(false),
- is_rug_compatible(false)
+ is_rug_compatible(false),
+ root_dir("/")
{}
std::list<zypp::Url> additional_sources;
bool disable_system_sources;
bool disable_system_resolvables;
bool is_rug_compatible;
+ std::string root_dir;
};
struct Error
// define new _ macro
#define _(MSG) ::gettext(MSG)
+// Local Variables:
+// c-basic-offset: 2
+// End:
#endif
{"terse", no_argument, 0, 't'},
{"table-style", required_argument, 0, 's'},
{"rug-compatible", no_argument, 0, 'r'},
+ {"root", required_argument, 0, 'R'},
{"opt", optional_argument, 0, 'o'},
{0, 0, 0, 0}
};
"\t--verbose, -v\t\tIncrease verbosity\n"
"\t--terse, -t\t\tTerse output for machine consumption\n"
"\t--table-style, -s\tTable style (integer)\n"
- "\t--rug-compatible, -r\tTurn on rug compatibility\n");
+ "\t--rug-compatible, -r\tTurn on rug compatibility\n"
+ "\t--root, -R <dir>\tOperate on a different root directory\n");
;
if (gopts.count("verbose")) {
else
cerr << _("Invalid table style ") << s << endl;
}
+
+ if (gopts.count("root")) {
+ gSettings.root_dir = gopts["root"].front();
+ }
+
+
// testing option
if (gopts.count("opt")) {
cerr << "Opt arg: ";