Author: jkupec
Date: Mon Oct 27 14:03:13 2008
New Revision: 11503
URL: http://svn.opensuse.org/viewcvs/zypp?rev=11503&view=rev
Log:
- --no-cd global option added to ignore CD/DVD repositories (bnc #336211)
- --no-remote global option added to ignore remote (downloading) repositories
Modified:
trunk/zypper/doc/zypper.8
trunk/zypper/src/Zypper.cc
trunk/zypper/src/Zypper.h
trunk/zypper/src/repos.cc
Modified: trunk/zypper/doc/zypper.8
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/doc/zypper.8?rev=11503&r1=11502&r2=11503&view=diff
==============================================================================
--- trunk/zypper/doc/zypper.8 (original)
+++ trunk/zypper/doc/zypper.8 Mon Oct 27 14:03:13 2008
@@ -1108,6 +1108,14 @@
Do not auto-refresh repositories (ignore the auto-refresh setting). Useful to save
time when doing operations like search, if there is not a need to have
a completely up to date metadata.
+.TP
+.I \ \ \ \ \-\-no\-cd
+Ignore CD/DVD repositories. When this option is specified, zypper acts as if
+the CD/DVD repositories were not defined at all.
+.TP
+.I \ \ \ \ \-\-no\-remote
+Ignore remote repositories like http, ftp, smb and similar. When this option
+is specified, zypper acts as if the remote repositories were not defined at all.
.LP
Target Options:
.TP
Modified: trunk/zypper/src/Zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/Zypper.cc?rev=11503&r1=11502&r2=11503&view=diff
==============================================================================
--- trunk/zypper/src/Zypper.cc (original)
+++ trunk/zypper/src/Zypper.cc Mon Oct 27 14:03:13 2008
@@ -168,12 +168,16 @@
"\t--raw-cache-dir <dir>\tUse alternative raw meta-data cache directory.\n"
);
- static string help_global_source_options = _(" Repository Options:\n"
+ static string help_global_repo_options = string(_(" Repository Options:\n"
"\t--no-gpg-checks\t\tIgnore GPG check failures and continue.\n"
"\t--plus-repo, -p <URI>\tUse an additional repository.\n"
"\t--disable-repositories\tDo not read meta-data from repositories.\n"
"\t--no-refresh\t\tDo not refresh the repositories.\n"
- );
+ )) + string(_(
+ // translators: these belong to Repository Options main help text
+ "\t--no-cd\t\t\tIgnore CD/DVD repositories.\n"
+ "\t--no-remote\t\tIgnore remote repositories.\n"
+ ));
static string help_global_target_options = _(" Target Options:\n"
"\t--root, -R <dir>\tOperate on a different root directory.\n"
@@ -260,7 +264,7 @@
zypper.out().info(help_usage, Out::QUIET);
zypper.out().info(help_global_options, Out::QUIET);
- zypper.out().info(help_global_source_options, Out::QUIET);
+ zypper.out().info(help_global_repo_options, Out::QUIET);
zypper.out().info(help_global_target_options, Out::QUIET);
zypper.out().info(help_commands, Out::QUIET);
zypper.out().info(help_repo_commands, Out::QUIET);
@@ -329,6 +333,8 @@
{"plus-repo", required_argument, 0, 'p'},
{"disable-repositories", no_argument, 0, 0 },
{"no-refresh", no_argument, 0, 0 },
+ {"no-cd", no_argument, 0, 0 },
+ {"no-remote", no_argument, 0, 0 },
{"xmlout", no_argument, 0, 'x'},
{0, 0, 0, 0}
};
@@ -497,6 +503,20 @@
MIL << "Autorefresh disabled." << endl;
}
+ if (gopts.count("no-cd"))
+ {
+ _gopts.no_cd = true;
+ out().info(_("CD/DVD repositories disabled."), Out::HIGH);
+ MIL << "No CD/DVD repos." << endl;
+ }
+
+ if (gopts.count("no-remote"))
+ {
+ _gopts.no_remote = true;
+ out().info(_("Remote repos disabled."), Out::HIGH);
+ MIL << "No remote repos." << endl;
+ }
+
if (gopts.count("disable-system-resolvables"))
{
MIL << "System resolvables disabled" << endl;
@@ -732,7 +752,7 @@
// runtime data
_rdata.current_repo = RepoInfo();
-
+
// cause the RepoManager to be reinitialized
_rm.reset();
@@ -1048,7 +1068,7 @@
);
break;
}
-
+
case ZypperCommand::MODIFY_SERVICE_e:
{
static struct option service_modify_options[] = {
@@ -1100,7 +1120,7 @@
"-m, --medium-type <type> Apply changes to services of specified type.\n"
), "--all|--remote|--local|--medium-type"
, "--all, --remote, --local, --medium-type");
- // ---------|---------|---------|---------|---------|---------|---------|---------
+ // ---------|---------|---------|---------|---------|---------|---------|---------
break;
}
@@ -3479,7 +3499,7 @@
}
else if (command() == ZypperCommand::LIST_PATCHES)
kinds.insert(ResKind::patch);
- else
+ else
kinds.insert(ResKind::package);
bool best_effort = copts.count( "best-effort" );
@@ -3825,9 +3845,9 @@
break;
}
-
+
// ----------------------------(utils/others)--------------------------------
-
+
case ZypperCommand::TARGET_OS_e:
{
if (runningHelp()) { out().info(_command_help, Out::QUIET); return; }
@@ -3836,7 +3856,7 @@
init_target(*this);
out().info(God->target()->targetDistribution());
-
+
break;
}
@@ -3856,7 +3876,7 @@
setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
return;
}
-
+
Edition lhs(_arguments[0]);
Edition rhs(_arguments[1]);
Modified: trunk/zypper/src/Zypper.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/Zypper.h?rev=11503&r1=11502&r2=11503&view=diff
==============================================================================
--- trunk/zypper/src/Zypper.h (original)
+++ trunk/zypper/src/Zypper.h Mon Oct 27 14:03:13 2008
@@ -17,7 +17,7 @@
#include "zypp/TriBool.h"
#include "zypp/RepoInfo.h"
-#include "zypp/RepoManager.h" // for RepoManagerOptions
+#include "zypp/RepoManager.h" // for RepoManagerOptions
#include "zypp/SrcPackage.h"
#include "Command.h"
@@ -35,7 +35,7 @@
{
GlobalOptions()
:
- verbosity(0),
+ verbosity(0),
disable_system_sources(false),
disable_system_resolvables(false),
is_rug_compatible(false),
@@ -43,6 +43,8 @@
no_gpg_checks(false),
machine_readable(false),
no_refresh(false),
+ no_cd(false),
+ no_remote(false),
root_dir("/"),
no_abbrev(false),
terse(false),
@@ -54,7 +56,7 @@
/**
* Level of the amount of output.
*
- * <ul>
+ * <ul>
* <li>-1 quiet</li>
* <li> 0 normal (default)</li>
* <li> 1 verbose</li>
@@ -70,6 +72,10 @@
bool machine_readable;
/** Whether to disable autorefresh. */
bool no_refresh;
+ /** Whether to ignore cd/dvd repos) */
+ bool no_cd;
+ /** Whether to ignore remote (http, ...) repos */
+ bool no_remote;
std::string root_dir;
zypp::RepoManagerOptions rm_options;
bool no_abbrev;
@@ -137,7 +143,7 @@
unsigned int commit_pkgs_total;
unsigned int commit_pkg_current;
-
+
bool seen_verify_hint;
bool action_rpm_download;
};
@@ -150,7 +156,7 @@
typedef zypp::RW_pointer