[Reproducible-commits] [dpkg] 12/17: dpkg: Clarify that --set-selections needs an up-to-date available db

Holger Levsen holger at layer-acht.org
Tue May 3 08:43:42 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to annotated tag 1.16.13
in repository dpkg.

commit eeec66bd2a9b103979b2bd700a0a1a723a7451d9
Author: Guillem Jover <guillem at debian.org>
Date:   Tue Apr 23 15:04:02 2013 +0200

    dpkg: Clarify that --set-selections needs an up-to-date available db
    
    Cherry picked from commit 535325ba3d607cfe816ce7cf8d91d185ab87ca9b.
    
    Document this in the man page, and warn whenever we find unknown
    packages during the --set-selections processing.
    
    Closes: #703092
---
 debian/changelog | 3 +++
 man/dpkg.1       | 5 +++++
 src/select.c     | 6 ++++++
 3 files changed, 14 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 90114e1..3168d98 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,9 @@ dpkg (1.16.13) UNRELEASED; urgency=low
     Thanks to Jeff Bailey <jeffbailey at google.com>.
   * Add OpenRISC or1k support to cputable.
     Thanks to Christian Svensson <christian at cmd.nu>. Closes: #736717
+  * Clarify that dpkg --set-selections needs an up-to-date available db,
+    by documenting it on the dpkg(1) man page, and warning whenever dpkg
+    finds unknown packages while setting the selections. Closes: #703092
 
   [ Updated scripts translations ]
   * Fix a typo in the German scripts translation.
diff --git a/man/dpkg.1 b/man/dpkg.1
index b5af9af..7c2e3ff 100644
--- a/man/dpkg.1
+++ b/man/dpkg.1
@@ -246,6 +246,11 @@ Set package selections using file read from stdin. This file should be
 in the format '\fIpackage\fP \fIstate\fP', where state is one of
 \fBinstall\fP, \fBhold\fP, \fBdeinstall\fP or \fBpurge\fP. Blank lines
 and comment lines beginning with '#' are also permitted.
+
+The available database needs to be up-to-date for this command to be
+useful, otherwise unknown packages will be ignored with a warning. See
+the \fB\-\-update\-avail\fP and \fB\-\-merge\-avail\fP commands for more
+information.
 .TP
 .B \-\-clear\-selections
 Set the requested state of every non-essential package to deinstall.
diff --git a/src/select.c b/src/select.c
index c16f50b..fc27bea 100644
--- a/src/select.c
+++ b/src/select.c
@@ -112,6 +112,7 @@ setselections(const char *const *argv)
   int c, lno;
   struct varbuf namevb = VARBUF_INIT;
   struct varbuf selvb = VARBUF_INIT;
+  bool db_possibly_outdated = false;
 
   if (*argv)
     badusage(_("--%s takes no arguments"), cipaction->olong);
@@ -163,6 +164,7 @@ setselections(const char *const *argv)
 
     if (!pkg_is_informative(pkg, &pkg->installed) &&
         !pkg_is_informative(pkg, &pkg->available)) {
+      db_possibly_outdated = true;
       warning(_("package not in database at line %d: %.250s"), lno, namevb.buf);
       continue;
     }
@@ -180,6 +182,10 @@ setselections(const char *const *argv)
   varbuf_destroy(&namevb);
   varbuf_destroy(&selvb);
 
+  if (db_possibly_outdated)
+    warning(_("found unknown packages; this might mean the available database\n"
+              "is outdated, and needs to be updated through a frontend method"));
+
   return 0;
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list