summaryrefslogtreecommitdiff
path: root/cmdline/apt-mark.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-02-27 22:52:34 +0100
committerMichael Vogt <mvo@debian.org>2014-02-27 22:52:34 +0100
commitfce69e7a0f38299c57ef96ae1c1dd9a5379bfd5a (patch)
treebe7d18baa836e9df166ec63f6c9fe6f94bb84b40 /cmdline/apt-mark.cc
parenta5e790985752c6820e08e7a7e650e1607fa826e4 (diff)
parentfc104da6a583736223b2f941e43a05ea26b63a7d (diff)
Merge branch 'debian/sid' into debian/experimental
Conflicts: apt-private/private-list.cc configure.ac debian/apt.install.in debian/changelog
Diffstat (limited to 'cmdline/apt-mark.cc')
-rw-r--r--cmdline/apt-mark.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc
index eb3410be1..d3a3a780b 100644
--- a/cmdline/apt-mark.cc
+++ b/cmdline/apt-mark.cc
@@ -209,7 +209,7 @@ bool DoHold(CommandLine &CmdL)
dup2(nullfd, STDIN_FILENO);
dup2(nullfd, STDOUT_FILENO);
dup2(nullfd, STDERR_FILENO);
- if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0)
+ if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0 && chdir("/") != 0)
_error->WarningE("getArchitecture", "Couldn't chroot into %s for dpkg --assert-multi-arch", chrootDir.c_str());
execvp(Args[0], (char**) &Args[0]);
_error->WarningE("dpkgGo", "Can't detect if dpkg supports multi-arch!");
@@ -279,7 +279,7 @@ bool DoHold(CommandLine &CmdL)
{
close(external[1]);
std::string const chrootDir = _config->FindDir("DPkg::Chroot-Directory");
- if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0)
+ if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0 && chdir("/") != 0)
_error->WarningE("getArchitecture", "Couldn't chroot into %s for dpkg --set-selections", chrootDir.c_str());
int const nullfd = open("/dev/null", O_RDONLY);
dup2(external[0], STDIN_FILENO);
@@ -386,6 +386,11 @@ bool ShowHelp(CommandLine &CmdL)
"Commands:\n"
" auto - Mark the given packages as automatically installed\n"
" manual - Mark the given packages as manually installed\n"
+ " hold - Mark a package as held back\n"
+ " unhold - Unset a package set as held back\n"
+ " showauto - Print the list of automatically installed packages\n"
+ " showmanual - Print the list of manually installed packages\n"
+ " showhold - Print the list of package on hold\n"
"\n"
"Options:\n"
" -h This help text.\n"