From 1a4c9766e0b31795b5d9869c6a98c1bba8380faa Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 15 Apr 2011 12:52:45 +0200 Subject: * apt-pkg/policy.cc: - Allow pinning by glob() expressions, and regular expressions surrounded by slashes (the "/" character). --- doc/apt_preferences.5.xml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'doc') diff --git a/doc/apt_preferences.5.xml b/doc/apt_preferences.5.xml index 219da7cd1..55504f3e5 100644 --- a/doc/apt_preferences.5.xml +++ b/doc/apt_preferences.5.xml @@ -259,6 +259,49 @@ Pin-Priority: 500 +Regular expressions and glob() syntax + +APT also supports pinning by glob() expressions and regular +expressions surrounded by /. For example, the following +example assigns the priority 500 to all packages from +experimental where the name starts with gnome (as a glob()-like +expression or contains the word kde (as a POSIX extended regular +expression surrounded by slashes). + + + +Package: gnome* /kde/ +Pin: release n=experimental +Pin-Priority: 500 + + + +The rule for those expressions is that they can occur anywhere +where a string can occur. Those, the following pin assigns the +priority 990 to all packages from a release starting with karmic. + + + +Package: * +Pin: release n=karmic* +Pin-Priority: 990 + + +If a regular expression occurs in a Package field, +the behavior is the same as if this regular expression were replaced +with a list of all package names it matches. It is undecided whether +this will change in the future, thus you should always list wild-card +pins first, so later specific pins override it. + +The pattern "*" in a Package field is not considered +a glob() expression in itself. + + + + + + + How APT Interprets Priorities -- cgit v1.2.3-70-g09d2 From f37e6374bef41b0ce45e783fab051691c0fc9efa Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 21 Apr 2011 11:25:52 +0200 Subject: doc/apt-key.8.xml: Document apt-key net-update (LP: #192810) --- debian/changelog | 2 ++ doc/apt-key.8.xml | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) (limited to 'doc') diff --git a/debian/changelog b/debian/changelog index fabe455cb..d9e42717f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ apt (0.8.14.2) UNRELEASED; urgency=low - Really release action groups only once (Closes: #622744) * debian/apt.cron.daily: - Check power after wait, patch by manuel-soto (LP: #705269) + * doc/apt-key.8.xml: + - Document apt-key net-update (LP: #192810) -- Julian Andres Klode Mon, 18 Apr 2011 10:54:11 +0200 diff --git a/doc/apt-key.8.xml b/doc/apt-key.8.xml index f1cc3ac02..9bfab84b6 100644 --- a/doc/apt-key.8.xml +++ b/doc/apt-key.8.xml @@ -136,6 +136,22 @@ + + net-update + + + + Update the local keyring with the keys of a key server + and removes from the keyring the archive keys which are no + longer valid. This requires an installed wget and an APT + build configured to have a server to fetch from. APT in + Debian does not support this command, but Ubuntu's APT + does. + + + + + -- cgit v1.2.3-70-g09d2 From b40f2c3bd7aace2dcf1e0262b9356906be9eb272 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 21 Apr 2011 18:58:07 +0200 Subject: update the apt-mark manpage --- doc/apt-mark.8.xml | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) (limited to 'doc') diff --git a/doc/apt-mark.8.xml b/doc/apt-mark.8.xml index ec50d6f76..592a8b97d 100644 --- a/doc/apt-mark.8.xml +++ b/doc/apt-mark.8.xml @@ -18,7 +18,7 @@ &apt-email; &apt-product; - 9 August 2009 + 21 April 2011 @@ -42,12 +42,13 @@ - markauto - unmarkauto + auto + manual + showauto + showmanual package - showauto @@ -65,16 +66,16 @@ apt-get or aptitude. - markauto - markauto is used to mark a + auto + auto is used to mark a package as being automatically installed, which will cause the package to be removed when no more manually installed packages depend on this package. - unmarkauto - unmarkauto is used to mark a + manual + manual is used to mark a package as being manually installed, which will prevent the package from being automatically removed if no other packages depend on it. @@ -84,8 +85,18 @@ showauto showauto is used to print a list of automatically installed packages with each package on a new line. + All automatically installed packages will be listed if no package is given. + If packages are given only those which are automatically installed will be shown. + + showmanual + showmanual can be used in + the same way as showauto except that it will print + a list of manually installed packages instead. + + + @@ -102,23 +113,8 @@ is extended_status in the directory defined by the Configuration Item: Dir::State. - - - - Show a short usage summary. - - - - - - - - Show the program version. - - - - + &apt-commonoptions; -- cgit v1.2.3-70-g09d2 From a09e4489c7bd097d051db44b5e3487963b7a36c0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 26 Apr 2011 17:29:54 +0200 Subject: provide a 'dpkg --set-selections' wrapper to set/release holds --- cmdline/apt-mark.cc | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++ debian/changelog | 3 +- doc/apt-mark.8.xml | 23 +++++++++++ 3 files changed, 141 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index a5dc45a10..b2c664979 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -141,6 +141,115 @@ bool ShowAuto(CommandLine &CmdL) std::sort(packages.begin(), packages.end()); + for (vector::const_iterator I = packages.begin(); I != packages.end(); ++I) + std::cout << *I << std::endl; + + return true; +} + /*}}}*/ +/* DoHold - mark packages as hold by dpkg {{{*/ +bool DoHold(CommandLine &CmdL) +{ + pkgCacheFile CacheFile; + pkgCache *Cache = CacheFile.GetPkgCache(); + if (unlikely(Cache == NULL)) + return false; + + APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1); + if (pkgset.empty() == true) + return _error->Error(_("No packages found")); + + bool const MarkHold = strcasecmp(CmdL.FileList[0],"hold") == 0; + + for (APT::PackageSet::iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) + { + if ((Pkg->SelectedState == pkgCache::State::Hold) == MarkHold) + { + if (MarkHold == true) + ioprintf(c1out,_("%s was already set on hold.\n"), Pkg.FullName(true).c_str()); + else + ioprintf(c1out,_("%s was already not hold.\n"), Pkg.FullName(true).c_str()); + pkgset.erase(Pkg); + continue; + } + } + + if (pkgset.empty() == true) + return true; + + if (_config->FindB("APT::Mark::Simulate", false) == true) + { + for (APT::PackageSet::iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) + { + if (MarkHold == false) + ioprintf(c1out,_("%s set on hold.\n"), Pkg.FullName(true).c_str()); + else + ioprintf(c1out,_("Canceled hold on %s.\n"), Pkg.FullName(true).c_str()); + } + return true; + } + + string dpkgcall = _config->Find("Dir::Bin::dpkg", "dpkg"); + std::vector const dpkgoptions = _config->FindVector("DPkg::options"); + for (std::vector::const_iterator o = dpkgoptions.begin(); + o != dpkgoptions.end(); ++o) + dpkgcall.append(" ").append(*o); + dpkgcall.append(" --set-selections"); + FILE *dpkg = popen(dpkgcall.c_str(), "w"); + if (dpkg == NULL) + return _error->Errno("DoHold", "fdopen on dpkg stdin failed"); + + for (APT::PackageSet::iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) + { + if (MarkHold == true) + { + fprintf(dpkg, "%s hold\n", Pkg.FullName(true).c_str()); + ioprintf(c1out,_("%s set on hold.\n"), Pkg.FullName(true).c_str()); + } + else + { + fprintf(dpkg, "%s install\n", Pkg.FullName(true).c_str()); + ioprintf(c1out,_("Canceled hold on %s.\n"), Pkg.FullName(true).c_str()); + } + } + + int const status = pclose(dpkg); + if (status == -1) + return _error->Errno("DoHold", "dpkg execution failed in the end"); + if (WIFEXITED(status) == false || WEXITSTATUS(status) != 0) + return _error->Error(_("Executing dpkg failed. Are you root?")); + return true; +} + /*}}}*/ +/* ShowHold - show packages set on hold in dpkg status {{{*/ +bool ShowHold(CommandLine &CmdL) +{ + pkgCacheFile CacheFile; + pkgCache *Cache = CacheFile.GetPkgCache(); + if (unlikely(Cache == NULL)) + return false; + + std::vector packages; + + if (CmdL.FileList[1] == 0) + { + packages.reserve(50); // how many holds are realistic? I hope just a few… + for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; ++P) + if (P->SelectedState == pkgCache::State::Hold) + packages.push_back(P.FullName(true)); + } + else + { + APT::CacheSetHelper helper(false); // do not show errors + APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1, helper); + packages.reserve(pkgset.size()); + for (APT::PackageSet::const_iterator P = pkgset.begin(); P != pkgset.end(); ++P) + if (P->SelectedState == pkgCache::State::Hold) + packages.push_back(P.FullName(true)); + } + + std::sort(packages.begin(), packages.end()); + for (vector::const_iterator I = packages.begin(); I != packages.end(); ++I) std::cout << *I << std::endl; @@ -198,8 +307,15 @@ int main(int argc,const char *argv[]) /*{{{*/ CommandLine::Dispatch Cmds[] = {{"help",&ShowHelp}, {"auto",&DoAuto}, {"manual",&DoAuto}, + {"hold",&DoHold}, + {"unhold",&DoHold}, {"showauto",&ShowAuto}, {"showmanual",&ShowAuto}, + {"showhold",&ShowHold}, + // be nice and forgive the typo + {"showholds",&ShowHold}, + // be nice and forgive it as it is technical right + {"install",&DoHold}, // obsolete commands for compatibility {"markauto", &DoMarkAuto}, {"unmarkauto", &DoMarkAuto}, diff --git a/debian/changelog b/debian/changelog index 58b6a289d..82037ea34 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,7 @@ apt (0.8.14.2) UNRELEASED; urgency=low * cmdline/apt-mark.cc: - reimplement apt-mark in c++ - provide a 'showmanual' command (Closes: #582791) + - provide a 'dpkg --set-selections' wrapper to set/release holds * cmdline/apt-get.cc: - deprecate mostly undocumented 'markauto' in favor of 'apt-mark' * cmdline/apt-cache.cc: @@ -31,7 +32,7 @@ apt (0.8.14.2) UNRELEASED; urgency=low * apt-pkg/pkgcache.cc: - really ignore :arch in FindPkg() in non-multiarch environment - -- David Kalnischkies Mon, 25 Apr 2011 13:49:47 +0200 + -- David Kalnischkies Tue, 26 Apr 2011 17:29:14 +0200 apt (0.8.14.1) unstable; urgency=low diff --git a/doc/apt-mark.8.xml b/doc/apt-mark.8.xml index 592a8b97d..01c8665dd 100644 --- a/doc/apt-mark.8.xml +++ b/doc/apt-mark.8.xml @@ -82,6 +82,22 @@ + hold + hold is used to mark a + package as hold back, which will prevent the package from being + automatically installed, upgraded or removed. + The command is only a wrapper around dpkg --set-selections + and the state is therefore maintained by &dpkg; and not effected + by the option. + + + + unhold + unhold is used to cancel a + previously set hold on a package to allow all actions again. + + + showauto showauto is used to print a list of automatically installed packages with each package on a new line. @@ -97,6 +113,13 @@ + showhold + showhold is used to print a list + of packages on hold in the same way as for the other show commands. + + + + -- cgit v1.2.3-70-g09d2 From 160960eb83defb82b621fc1013262bc6c8e41aeb Mon Sep 17 00:00:00 2001 From: Chris Leick Date: Tue, 26 Apr 2011 17:43:15 +0200 Subject: * doc/po/de.po: - undo the translation of the command 'dump' in manpage of apt-config as report by Burghard Grossmann on debian-l10n-german, thanks! --- debian/changelog | 5 ++++- doc/po/de.po | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/debian/changelog b/debian/changelog index 82037ea34..64cba02cd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,8 +31,11 @@ apt (0.8.14.2) UNRELEASED; urgency=low - deprecate mostly undocumented 'showauto' in favor of 'apt-mark' * apt-pkg/pkgcache.cc: - really ignore :arch in FindPkg() in non-multiarch environment + * doc/po/de.po: + - undo the translation of the command 'dump' in manpage of apt-config + as report by Burghard Grossmann on debian-l10n-german, thanks! - -- David Kalnischkies Tue, 26 Apr 2011 17:29:14 +0200 + -- David Kalnischkies Tue, 26 Apr 2011 17:35:24 +0200 apt (0.8.14.1) unstable; urgency=low diff --git a/doc/po/de.po b/doc/po/de.po index 75595df07..891e69964 100644 --- a/doc/po/de.po +++ b/doc/po/de.po @@ -1912,7 +1912,7 @@ msgstr "" "apt-config shell Abbild " +"choice=\"req\"> shell dump " #. type: Content of: #: apt-config.8.xml:51 -- cgit v1.2.3-70-g09d2