Преглед изворни кода

Document --yet-to-unpack, --predep-packages and --assert-<feature> commands

Both in «dpkg --help» and dpkg(1). Mark them as supported.

Prompted-by: Johannes Schauer <j.schauer@email.de>
Guillem Jover пре 11 година
родитељ
комит
41925f2a44
3 измењених фајлова са 46 додато и 7 уклоњено
  1. 2 0
      debian/changelog
  2. 36 0
      man/dpkg.1
  3. 8 7
      src/main.c

+ 2 - 0
debian/changelog

@@ -8,6 +8,8 @@ dpkg (1.18.2) UNRELEASED; urgency=low
     - Use the feature area name in the dpkg-buildflags(1) subsection title.
     - Use the feature area name in the dpkg-buildflags(1) subsection title.
     - Document DPKG_HOOK_ACTION also in dpkg(1) ENVIRONMENT section.
     - Document DPKG_HOOK_ACTION also in dpkg(1) ENVIRONMENT section.
     - Clarify when some features where added in man pages.
     - Clarify when some features where added in man pages.
+    - Document --yet-to-unpack, --predep-packages and all --assert-<feature>
+      commands as supported in both «dpkg --help» and dpkg(1).
 
 
   [ Updated programs translations ]
   [ Updated programs translations ]
   * Dutch (Frans Spiesschaert). Closes: #789097
   * Dutch (Frans Spiesschaert). Closes: #789097

+ 36 - 0
man/dpkg.1

@@ -308,6 +308,16 @@ to deinstall any packages not in list given to \fB\-\-set\-selections\fP.
 Searches for packages selected for installation, but which for some
 Searches for packages selected for installation, but which for some
 reason still haven't been installed.
 reason still haven't been installed.
 .TP
 .TP
+.B \-\-predep\-packages
+Print a single package which, is the target of one or more relevant
+pre-dependencies, and has itself no unsatisfied pre-dependencies.
+.IP
+If such a package is present, output it as a Packages file entry,
+which can be massaged as appropriate.
+.IP
+Returns 0 when a package is printed, 1 when no suitable package is
+available and 2 on error.
+.TP
 .B \-\-add\-architecture \fIarchitecture\fP
 .B \-\-add\-architecture \fIarchitecture\fP
 Add \fIarchitecture\fP to the list of architectures for which packages can
 Add \fIarchitecture\fP to the list of architectures for which packages can
 be installed without using \fB\-\-force\-architecture\fP (since dpkg 1.16.2).
 be installed without using \fB\-\-force\-architecture\fP (since dpkg 1.16.2).
@@ -331,6 +341,32 @@ Print architecture of packages \fBdpkg\fP installs (for example, \(lqi386\(rq).
 Print a newline-separated list of the extra architectures \fBdpkg\fP is
 Print a newline-separated list of the extra architectures \fBdpkg\fP is
 configured to allow packages to be installed for (since dpkg 1.16.2).
 configured to allow packages to be installed for (since dpkg 1.16.2).
 .TP
 .TP
+.BI \-\-assert\- feature
+Asserts that \fBdpkg\fP supports the requested feature.
+Returns 0 if the feature is fully supported, 1 if the feature is known but
+\fBdpkg\fP cannot provide support for it yet, and 2 if the feature is unknown.
+The current list of assertable features is:
+.RS
+.TP
+.B support\-predepends
+Supports the \fBPre\-Depends\fP field (since dpkg 1.1.0).
+.TP
+.B working\-epoch
+Supports epochs in version strings (since dpkg 1.4.0.7).
+.TP
+.B long\-filenames
+Supports long filenames in \fBdeb\fP(5) archives (since dpkg 1.4.1.17).
+.TP
+.B multi\-conrep
+Supports multiple \fBConflicts\fP and \fBReplaces\fP (since dpkg 1.4.1.19).
+.TP
+.B multi\-arch
+Supports multi-arch fields and semantics (since dpkg 1.16.2).
+.TP
+.B versioned\-provides
+Supports versioned \fBProvides\fP (since dpkg 1.17.11).
+.RE
+.TP
 .B \-\-compare\-versions \fIver1 op ver2\fP
 .B \-\-compare\-versions \fIver1 op ver2\fP
 Compare version numbers, where \fIop\fP is a binary operator. \fBdpkg\fP
 Compare version numbers, where \fIop\fP is a binary operator. \fBdpkg\fP
 returns success (zero result) if the specified condition is satisfied,
 returns success (zero result) if the specified condition is satisfied,

+ 8 - 7
src/main.c

@@ -71,7 +71,6 @@ printversion(const struct cmdinfo *ci, const char *value)
 
 
 /*
 /*
  * FIXME: Options that need fixing:
  * FIXME: Options that need fixing:
- * dpkg --yet-to-unpack
  * dpkg --command-fd
  * dpkg --command-fd
  */
  */
 
 
@@ -105,10 +104,13 @@ usage(const struct cmdinfo *ci, const char *value)
 "  -l|--list [<pattern> ...]        List packages concisely.\n"
 "  -l|--list [<pattern> ...]        List packages concisely.\n"
 "  -S|--search <pattern> ...        Find package(s) owning file(s).\n"
 "  -S|--search <pattern> ...        Find package(s) owning file(s).\n"
 "  -C|--audit [<package> ...]       Check for broken package(s).\n"
 "  -C|--audit [<package> ...]       Check for broken package(s).\n"
+"  --yet-to-unpack                  Print packages selected for installation.\n"
+"  --predep-packages                Print pre-dependencies to unpack.\n"
 "  --add-architecture <arch>        Add <arch> to the list of architectures.\n"
 "  --add-architecture <arch>        Add <arch> to the list of architectures.\n"
 "  --remove-architecture <arch>     Remove <arch> from the list of architectures.\n"
 "  --remove-architecture <arch>     Remove <arch> from the list of architectures.\n"
 "  --print-architecture             Print dpkg architecture.\n"
 "  --print-architecture             Print dpkg architecture.\n"
 "  --print-foreign-architectures    Print allowed foreign architectures.\n"
 "  --print-foreign-architectures    Print allowed foreign architectures.\n"
+"  --assert-<feature>               Assert support for the specified feature.\n"
 "  --compare-versions <a> <op> <b>  Compare version numbers - see below.\n"
 "  --compare-versions <a> <op> <b>  Compare version numbers - see below.\n"
 "  --force-help                     Show help on forcing.\n"
 "  --force-help                     Show help on forcing.\n"
 "  -Dh|--debug=help                 Show help on debugging.\n"
 "  -Dh|--debug=help                 Show help on debugging.\n"
@@ -117,6 +119,11 @@ usage(const struct cmdinfo *ci, const char *value)
   printf(_(
   printf(_(
 "  -?, --help                       Show this help message.\n"
 "  -?, --help                       Show this help message.\n"
 "      --version                    Show the version.\n"
 "      --version                    Show the version.\n"
+"\n"));
+
+  printf(_(
+"Assertable features: support-predepends, working-epoch, long-filenames,\n"
+"  multi-conrep, multi-arch, versioned-provides.\n"
 "\n"));
 "\n"));
 
 
   printf(_(
   printf(_(
@@ -125,12 +132,6 @@ usage(const struct cmdinfo *ci, const char *value)
 "on archives (type %s --help).\n"
 "on archives (type %s --help).\n"
 "\n"), BACKEND);
 "\n"), BACKEND);
 
 
-  printf(_(
-"For internal use: dpkg --assert-support-predepends | --predep-package |\n"
-"  --assert-working-epoch | --assert-long-filenames | --assert-multi-conrep |\n"
-"  --assert-multi-arch | --assert-versioned-provides.\n"
-"\n"));
-
   printf(_(
   printf(_(
 "Options:\n"
 "Options:\n"
 "  --admindir=<directory>     Use <directory> instead of %s.\n"
 "  --admindir=<directory>     Use <directory> instead of %s.\n"