Author: jkupec
Date: Tue Oct 23 14:13:30 2007
New Revision: 7605
URL: http://svn.opensuse.org/viewcvs/zypp?rev=7605&view=rev
Log:
- --cache-dir, --raw-cache-dir, --reposd-dir global options added
Modified:
trunk/zypper/src/zypper-misc.cc
trunk/zypper/src/zypper-search.cc
trunk/zypper/src/zypper-search.h
trunk/zypper/src/zypper-sources.cc
trunk/zypper/src/zypper-updates.cc
trunk/zypper/src/zypper.cc
trunk/zypper/src/zypper.h
Modified: trunk/zypper/src/zypper-misc.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=7605&r1=7604&r2=7605&view=diff
==============================================================================
--- trunk/zypper/src/zypper-misc.cc (original)
+++ trunk/zypper/src/zypper-misc.cc Tue Oct 23 14:13:30 2007
@@ -13,7 +13,6 @@
#include
#include
-#include
#include
#include
Modified: trunk/zypper/src/zypper-search.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-search.cc?rev=7605&r1=7604&r2=7605&view=diff
==============================================================================
--- trunk/zypper/src/zypper-search.cc (original)
+++ trunk/zypper/src/zypper-search.cc Tue Oct 23 14:13:30 2007
@@ -29,7 +29,7 @@
// check for disabled repos and limit list of repos accordingly.
// "-r/--repo" will override this
try {
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
std::listzypp::RepoInfo known_repos = manager.knownRepositories();
std::listzypp::RepoInfo::const_iterator it_r;
for (it_r = known_repos.begin(); it_r != known_repos.end(); ++it_r)
@@ -77,7 +77,7 @@
const ZyppSearchOptions & options,
const vector<string> qstrings
) :
- _zypp(zypp), _options(options), _qstrings(qstrings), _query( _manager_options.repoCachePath ) {
+ _zypp(zypp), _options(options), _qstrings(qstrings), _query( gSettings.rm_options.repoCachePath ) {
#if 0 // we don't search the pool but iterate on the cache directly, hence no repos needed
// no repos warning
Modified: trunk/zypper/src/zypper-search.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-search.h?rev=7605&r1=7604&r2=7605&view=diff
==============================================================================
--- trunk/zypper/src/zypper-search.h (original)
+++ trunk/zypper/src/zypper-search.h Tue Oct 23 14:13:30 2007
@@ -226,8 +226,6 @@
InstalledCache _icache;
IdCache _idcache;
- zypp::RepoManagerOptions _manager_options;
-
zypp::cache::ResolvableQuery _query;
void setupRegexp();
Modified: trunk/zypper/src/zypper-sources.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-sources.cc?rev=7605&r1=7604&r2=7605&view=diff
==============================================================================
--- trunk/zypper/src/zypper-sources.cc (original)
+++ trunk/zypper/src/zypper-sources.cc Tue Oct 23 14:13:30 2007
@@ -42,7 +42,7 @@
try
{
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
if (!force_download)
{
@@ -154,7 +154,7 @@
try
{
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
manager.buildCache(repo, force_build ?
RepoManager::BuildForced : RepoManager::BuildIfNeeded);
}
@@ -203,7 +203,7 @@
{
// load gpg keys
cond_init_target ();
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
string specific_repo = copts.count("repo") ? copts["repo"].front() : "";
@@ -412,7 +412,7 @@
void list_repos()
{
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
list<RepoInfo> repos;
try
@@ -483,7 +483,7 @@
{
// need gpg keys when downloading (#304672)
cond_init_target();
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
list<RepoInfo> repos;
try
{
@@ -673,7 +673,7 @@
static
int add_repo(RepoInfo & repo)
{
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
bool is_cd = true;
for(RepoInfo::urls_const_iterator it = repo.baseUrlsBegin();
@@ -783,7 +783,7 @@
MIL << "going to add repository by url (alias=" << alias << ", url=" << url
<< ")" << endl;
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
RepoInfo repo;
if ( ! type.empty() )
@@ -811,7 +811,7 @@
if (!url.isValid())
return ZYPPER_EXIT_ERR_INVALID_ARGS;
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
list<RepoInfo> repos;
// read the repo file
@@ -890,7 +890,7 @@
*/
static bool do_remove_repo(const RepoInfo & repoinfo)
{
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
bool found = true;
try
{
@@ -911,7 +911,7 @@
bool remove_repo( const std::string &alias )
{
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
RepoInfo info;
info.setAlias(alias);
@@ -920,7 +920,7 @@
bool remove_repo(const Url & url, const url::ViewOption & urlview)
{
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
bool found = true;
try
{
@@ -939,7 +939,7 @@
void rename_repo(const std::string & alias, const std::string & newalias)
{
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
try
{
@@ -1013,7 +1013,7 @@
try
{
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
RepoInfo repo(manager.getRepositoryInfo(alias));
if (!indeterminate(enable))
@@ -1055,7 +1055,7 @@
void load_repo_resolvables(bool to_pool)
{
- RepoManager manager;
+ RepoManager manager(gSettings.rm_options);
for (std::list<RepoInfo>::iterator it = gData.repos.begin();
it != gData.repos.end(); ++it)
Modified: trunk/zypper/src/zypper-updates.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-updates.cc?rev=7605&r1=7604&r2=7605&view=diff
==============================================================================
--- trunk/zypper/src/zypper-updates.cc (original)
+++ trunk/zypper/src/zypper-updates.cc Tue Oct 23 14:13:30 2007
@@ -11,7 +11,6 @@
#include
#include
#include
-#include
#include
#include
#include
Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=7605&r1=7604&r2=7605&view=diff
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Tue Oct 23 14:13:30 2007
@@ -80,8 +80,12 @@
{"table-style", required_argument, 0, 's'},
{"rug-compatible", no_argument, 0, 'r'},
{"non-interactive", no_argument, 0, 'n'},
- {"no-gpg-checks", no_argument, 0, 0},
+ {"no-gpg-checks", no_argument, 0, 0 },
{"root", required_argument, 0, 'R'},
+ {"cache-dir", required_argument, 0, 'C'},
+ {"reposd-dir", required_argument, 0, 'D'},
+ {"raw-cache-dir", required_argument, 0, 0 },
+ {"zypp-dirs", required_argument, 0, 'Z'},
{"opt", optional_argument, 0, 'o'},
{"disable-system-resolvables", optional_argument, 0, 'o'},
{0, 0, 0, 0}
@@ -152,6 +156,18 @@
gSettings.root_dir = gopts["root"].front();
}
+ if (gopts.count("cache-dir")) {
+ gSettings.rm_options.repoCachePath = gopts["cache-dir"].front();
+ }
+
+ if (gopts.count("reposd-dir")) {
+ gSettings.rm_options.knownReposPath = gopts["reposd-dir"].front();
+ }
+
+ if (gopts.count("raw-cache-dir")) {
+ gSettings.rm_options.repoRawCachePath = gopts["raw-cache-dir"].front();
+ }
+
// testing option
if (gopts.count("opt")) {
cout << "Opt arg: ";
Modified: trunk/zypper/src/zypper.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.h?rev=7605&r1=7604&r2=7605&view=diff
==============================================================================
--- trunk/zypper/src/zypper.h (original)
+++ trunk/zypper/src/zypper.h Tue Oct 23 14:13:30 2007
@@ -14,6 +14,7 @@
#include
#include
#include
+#include
#include "zypper-command.h"
@@ -82,6 +83,7 @@
bool license_auto_agree;
bool machine_readable;
std::string root_dir;
+ zypp::RepoManagerOptions rm_options;
};
struct Error
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org