From efc487fbd46905f5f3efc4f31d7df15625bcbecf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 7 May 2009 12:04:21 +0200 Subject: [apt-pkg] allow also codenames for specifying a release * MatchType::Release checks first for archive than for codename equality * new n= option in apt_preference to be able to pin based on a codeName --- doc/apt-get.8.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'doc/apt-get.8.xml') diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index c1b3470ef..c63b2a6c6 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -53,6 +53,9 @@ target_release_number_expression + + target_release_codename + @@ -71,6 +74,9 @@ /target_release_name + + /target_release_codename + @@ -455,7 +461,8 @@ of this option. In short, this option lets you have simple control over which distribution packages will be retrieved from. Some common examples might be - or . + , + or . Configuration Item: APT::Default-Release; see also the &apt-preferences; manual page. -- cgit v1.2.3-70-g09d2 From 55a5a46c235a30bf024fb2301066553953701cc5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 29 Jun 2009 16:55:49 +0200 Subject: support running "--simulate" as user --- cmdline/apt-get.cc | 13 ++++++++++++- debian/changelog | 1 + doc/apt-get.8.xml | 5 +++++ 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'doc/apt-get.8.xml') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 028f371b5..faad2ed6b 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2788,7 +2788,18 @@ int main(int argc,const char *argv[]) ShowHelp(CmdL); return 0; } - + + // simulate user-friendly if apt-get has no root privileges + if (getuid() != 0 && _config->FindB("APT::Get::Simulate") == true) + { + cout << _("NOTE: This is only a simulation!\n" + " apt-get needs root privileges for real execution.\n" + " Keep also in mind that locking is deactivated,\n" + " so don't depend on the relevance to the real current situation!" + ) << std::endl; + _config->Set("Debug::NoLocking",true); + } + // Deal with stdout not being a tty if (!isatty(STDOUT_FILENO) && _config->FindI("quiet",0) < 1) _config->Set("quiet","1"); diff --git a/debian/changelog b/debian/changelog index 28bc54108..f1cb7bd0c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,7 @@ apt (0.7.22) UNRELEASED; urgency=low * [ABI break] support '#' in apt.conf and /etc/apt/preferences (closes: #189866) * [ABI break] Allow pinning by codename (closes: #97564) + * support running "--simulate" as user [ Julian Andres Klode ] * apt-pkg/contrib/configuration.cc: Fix a small memory leak in diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index c63b2a6c6..e7f6d7094 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -363,6 +363,11 @@ actually change the system. Configuration Item: APT::Get::Simulate. + Simulation run as user will deactivate locking (Debug::NoLocking) + automatical and display a notice indicating that this is only a simulation. + Neigther NoLocking nor the notice will be triggered if run as root (root should know what + he is doing without further warnings by apt-get). + Simulate prints out a series of lines each one representing a dpkg operation, Configure (Conf), Remove (Remv), Unpack (Inst). Square brackets indicate broken packages with -- cgit v1.2.3-70-g09d2 From ecf59bfcf3ca573aa15a44086a7852d1308ff1ad Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 7 Jul 2009 19:23:04 +0200 Subject: [apt-get] add possibility to hide the user simulation note --- cmdline/apt-get.cc | 11 ++++++----- doc/apt-get.8.xml | 3 ++- doc/examples/configure-index | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'doc/apt-get.8.xml') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 97c83c9b0..2ca0855b6 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2793,11 +2793,12 @@ int main(int argc,const char *argv[]) /*{{{*/ // simulate user-friendly if apt-get has no root privileges if (getuid() != 0 && _config->FindB("APT::Get::Simulate") == true) { - cout << _("NOTE: This is only a simulation!\n" - " apt-get needs root privileges for real execution.\n" - " Keep also in mind that locking is deactivated,\n" - " so don't depend on the relevance to the real current situation!" - ) << std::endl; + if (_config->FindB("APT::Get::Show-User-Simulation-Note",true) == true) + cout << _("NOTE: This is only a simulation!\n" + " apt-get needs root privileges for real execution.\n" + " Keep also in mind that locking is deactivated,\n" + " so don't depend on the relevance to the real current situation!" + ) << std::endl; _config->Set("Debug::NoLocking",true); } diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index e7f6d7094..50971d0f5 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -364,7 +364,8 @@ Configuration Item: APT::Get::Simulate. Simulation run as user will deactivate locking (Debug::NoLocking) - automatical and display a notice indicating that this is only a simulation. + automatical. Also a notice will be displayed indicating that this is only a simulation, + if the option APT::Get::Show-User-Simulation-Note is set (Default: true) Neigther NoLocking nor the notice will be triggered if run as root (root should know what he is doing without further warnings by apt-get). diff --git a/doc/examples/configure-index b/doc/examples/configure-index index cea0dcc09..ce56f1563 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -55,6 +55,7 @@ APT Diff-Only "false"; Tar-Only "false"; Build-Dep-Automatic "true"; + Show-User-Simulation-Note "true"; }; Cache -- cgit v1.2.3-70-g09d2