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

dpkg: Update output commands to print package specifiers

This affects --audit, --yet-to-unpack and --get-selections.

Sponsored-by: Linaro Limited

[guillem@debian.org:
 - Adapt to new pkg_name API.
 - Only arch-qualify when unambiguous. ]

Signed-off-by: Guillem Jover <guillem@debian.org>
Raphaël Hertzog пре 15 година
родитељ
комит
9269cfc882
2 измењених фајлова са 10 додато и 6 уклоњено
  1. 6 3
      src/enquiry.c
  2. 4 3
      src/select.c

+ 6 - 3
src/enquiry.c

@@ -151,7 +151,7 @@ static void describebriefly(struct pkginfo *pkg) {
   pdesc = pkg_summary(pkg, &pkg->installed, &l);
   l = min(l, maxl);
 
-  printf(" %-20s %.*s\n", pkg->set->name, l, pdesc);
+  printf(" %-20s %.*s\n", pkg_name(pkg, pnaw_nonambig), l, pdesc);
 }
 
 int
@@ -280,12 +280,15 @@ unpackchk(const char *const *argv)
       while (width > 59) { putchar(' '); width--; }
       it = pkg_db_iter_new();
       while ((pkg = pkg_db_iter_next_pkg(it))) {
+        const char *pkgname;
+
         if (!yettobeunpacked(pkg,&thissect)) continue;
         if (strcasecmp(thissect,se->name)) continue;
-        width -= strlen(pkg->set->name);
+        pkgname = pkg_name(pkg, pnaw_nonambig);
+        width -= strlen(pkgname);
         width--;
         if (width < 4) { printf(" ..."); break; }
-        printf(" %s", pkg->set->name);
+        printf(" %s", pkgname);
       }
       pkg_db_iter_free(it);
       putchar('\n');

+ 4 - 3
src/select.c

@@ -42,16 +42,17 @@
 #include "main.h"
 
 static void getsel1package(struct pkginfo *pkg) {
+  const char *pkgname;
   int l;
 
   if (pkg->want == want_unknown) return;
-  l = strlen(pkg->set->name);
+  pkgname = pkg_name(pkg, pnaw_nonambig);
+  l = strlen(pkgname);
   l >>= 3;
   l = 6 - l;
   if (l < 1)
     l = 1;
-  printf("%s%.*s%s\n", pkg->set->name, l, "\t\t\t\t\t\t",
-         wantinfos[pkg->want].name);
+  printf("%s%.*s%s\n", pkgname, l, "\t\t\t\t\t\t", wantinfos[pkg->want].name);
 }
 
 int