Przeglądaj źródła

Switch from pkginfo->name to pkginfo->set->name

Remove now unused struct pkginfo name member.
Guillem Jover 15 lat temu
rodzic
commit
9235d163ef

+ 5 - 4
dpkg-deb/build.c

@@ -334,8 +334,8 @@ check_new_pkg(const char *dir)
   m_asprintf(&controlfile, "%s/%s/%s", dir, BUILDCONTROLDIR, CONTROLFILE);
   parsedb(controlfile, pdb_recordavailable | pdb_rejectstatus, &pkg);
 
-  if (strspn(pkg->name, "abcdefghijklmnopqrstuvwxyz0123456789+-.") !=
-      strlen(pkg->name))
+  if (strspn(pkg->set->name, "abcdefghijklmnopqrstuvwxyz0123456789+-.") !=
+      strlen(pkg->set->name))
     ohshit(_("package name has characters that aren't lowercase alphanums or `-+.'"));
   if (pkg->priority == pri_other)
     warning(_("'%s' contains user-defined Priority value '%s'"),
@@ -375,7 +375,7 @@ pkg_get_pathname(const char *dir, struct pkginfo *pkg)
 
   versionstring = versiondescribe(&pkg->available.version, vdew_never);
   arch_sep = pkg->available.arch->type == arch_none ? "" : "_";
-  m_asprintf(&path, "%s/%s_%s%s%s%s", dir, pkg->name, versionstring,
+  m_asprintf(&path, "%s/%s_%s%s%s%s", dir, pkg->set->name, versionstring,
              arch_sep, pkg->available.arch->name, DEBEXT);
 
   return path;
@@ -436,7 +436,8 @@ do_build(const char *const *argv)
     pkg = check_new_pkg(dir);
     if (subdir)
       debar = pkg_get_pathname(debar, pkg);
-    printf(_("dpkg-deb: building package `%s' in `%s'.\n"), pkg->name, debar);
+    printf(_("dpkg-deb: building package `%s' in `%s'.\n"), pkg->set->name,
+           debar);
   }
   m_output(stdout, _("<standard output>"));
 

+ 13 - 11
dselect/pkgcmds.cc

@@ -60,13 +60,13 @@ packagelist::affectedmatches(struct pkginfo *pkg, struct pkginfo *comparewith) {
 }
 
 void packagelist::affectedrange(int *startp, int *endp) {
-  if (table[cursorline]->pkg->name) {
+  if (table[cursorline]->pkg->set->name) {
     *startp= cursorline;
     *endp= cursorline+1;
     return;
   }
   int index = cursorline;
-  while (index < nitems && !table[index]->pkg->name)
+  while (index < nitems && !table[index]->pkg->set->name)
     index++;
   if (index >= nitems) {
     *startp= *endp= cursorline;
@@ -113,7 +113,8 @@ void packagelist::setwant(pkginfo::pkgwant nwarg) {
 
     affectedrange(&top,&bot);
     for (index= top; index < bot; index++) {
-      if (!table[index]->pkg->name) continue;
+      if (!table[index]->pkg->set->name)
+        continue;
       nw= reallywant(nwarg,table[index]);
       if (table[index]->selected == nw ||
           (table[index]->selected == pkginfo::want_purge &&
@@ -144,7 +145,7 @@ void packagelist::kd_purge()    { setwant(pkginfo::want_purge);     }
 int would_like_to_install(pkginfo::pkgwant wantvalue, pkginfo *pkg) {
   /* Returns: 1 for yes, 0 for no, -1 for if they want to preserve an error condition. */
   debug(dbg_general, "would_like_to_install(%d, %s) status %d",
-        wantvalue, pkg->name, pkg->status);
+        wantvalue, pkg->set->name, pkg->status);
 
   if (wantvalue == pkginfo::want_install) return 1;
   if (wantvalue != pkginfo::want_hold) return 0;
@@ -155,7 +156,7 @@ int would_like_to_install(pkginfo::pkgwant wantvalue, pkginfo *pkg) {
 }
 
 const char *packagelist::itemname(int index) {
-  return table[index]->pkg->name;
+  return table[index]->pkg->set->name;
 }
 
 void packagelist::kd_swapstatorder() {
@@ -181,14 +182,15 @@ void packagelist::kd_swaporder() {
 }
 
 void packagelist::resortredisplay() {
-  const char *oldname= table[cursorline]->pkg->name;
+  const char *oldname = table[cursorline]->pkg->set->name;
   sortmakeheads();
   int newcursor;
   newcursor= 0;
   if (oldname) {
     int index;
     for (index=0; index<nitems; index++) {
-      if (table[index]->pkg->name && !strcasecmp(oldname,table[index]->pkg->name)) {
+      if (table[index]->pkg->set->name &&
+          !strcasecmp(oldname, table[index]->pkg->set->name)) {
         newcursor= index;
         break;
       }
@@ -238,7 +240,7 @@ void packagelist::kd_quit_noop() { }
 void packagelist::kd_revert_abort() {
   int index;
   for (index=0; index<nitems; index++) {
-    if (table[index]->pkg->name)
+    if (table[index]->pkg->set->name)
       table[index]->selected= table[index]->original;
     ldrawnstart= ldrawnend= -1;
   }
@@ -248,7 +250,7 @@ void packagelist::kd_revert_abort() {
 void packagelist::kd_revertdirect() {
   int index;
   for (index=0; index<nitems; index++) {
-    if (table[index]->pkg->name)
+    if (table[index]->pkg->set->name)
       table[index]->selected= table[index]->direct;
     ldrawnstart= ldrawnend= -1;
   }
@@ -258,7 +260,7 @@ void packagelist::kd_revertdirect() {
 void packagelist::kd_revertsuggest() {
   int index;
   for (index=0; index<nitems; index++) {
-    if (table[index]->pkg->name)
+    if (table[index]->pkg->set->name)
       table[index]->selected= table[index]->suggested;
     ldrawnstart= ldrawnend= -1;
   }
@@ -271,7 +273,7 @@ packagelist::kd_revertinstalled()
   int i;
 
   for (i = 0; i < nitems; i++) {
-    if (table[i]->pkg->name)
+    if (table[i]->pkg->set->name)
       table[i]->selected = reallywant(pkginfo::want_sentinel, table[i]);
     ldrawnstart = ldrawnend = -1;
   }

+ 14 - 12
dselect/pkgdepcon.cc

@@ -52,7 +52,7 @@ packagelist::find_pkgbin(pkginfo *pkg)
   pkgbin *r;
   r= useavailable(pkg) ? &pkg->available : &pkg->installed;
   debug(dbg_general, "packagelist[%p]::find_pkgbin(%s) useavailable=%d",
-        this, pkg->name, useavailable(pkg));
+        this, pkg->set->name, useavailable(pkg));
 
   return r;
 }
@@ -85,9 +85,10 @@ int packagelist::resolvesuggest() {
     changemade= 0;
     int index;
     for (index=0; index<nitems; index++) {
-      if (!table[index]->pkg->name) continue;
+      if (!table[index]->pkg->set->name)
+        continue;
       debug(dbg_depcon, "packagelist[%p]::resolvesuggest() loop[%i] %s / %d",
-            this, index, table[index]->pkg->name, changemade);
+            this, index, table[index]->pkg->set->name, changemade);
       dependency *depends;
       for (depends = find_pkgbin(table[index]->pkg)->depends;
            depends;
@@ -102,7 +103,7 @@ int packagelist::resolvesuggest() {
         changemade = checkdependers(&depends->list->ed->pkg, changemade);
       }
       debug(dbg_depcon, "packagelist[%p]::resolvesuggest() loop[%i] %s / -> %d",
-            this, index, table[index]->pkg->name, changemade);
+            this, index, table[index]->pkg->set->name, changemade);
     }
     if (!changemade) break;
     maxchangemade = max(maxchangemade, changemade);
@@ -117,8 +118,8 @@ static int dep_update_best_to_change_stop(perpackagestate *& best, pkginfo *tryt
   if (!trythis->clientdata) return 0;
 
   debug(dbg_depcon, "update_best_to_change(best=%s{%d}, test=%s{%d});",
-        best ? best->pkg->name : "", best ? (int)best->spriority : -1,
-        trythis->name, trythis->clientdata->spriority);
+        best ? best->pkg->set->name : "", best ? (int)best->spriority : -1,
+        trythis->set->name, trythis->clientdata->spriority);
 
   // If the problem is caused by us deselecting one of these packages
   // we should not try to select another one instead.
@@ -169,7 +170,8 @@ packagelist::deselect_one_of(pkginfo *per, pkginfo *ped, dependency *dep)
 
   debug(dbg_depcon,
         "packagelist[%p]::deselect_one_of(): er %s{%d} ed %s{%d} [%p]",
-        this, er->pkg->name, er->spriority, ed->pkg->name, ed->spriority, dep);
+        this, er->pkg->set->name, er->spriority,
+        ed->pkg->set->name, ed->spriority, dep);
 
   perpackagestate *best;
 
@@ -188,7 +190,7 @@ packagelist::deselect_one_of(pkginfo *per, pkginfo *ped, dependency *dep)
   else best= ed;                                      // ... failing that, the second
 
   debug(dbg_depcon, "packagelist[%p]::deselect_one_of(): best %s{%d}",
-        this, best->pkg->name, best->spriority);
+        this, best->pkg->set->name, best->spriority);
 
   if (best->spriority >= sp_deselecting) return 0;
   best->suggested=
@@ -215,7 +217,7 @@ int packagelist::resolvedepcon(dependency *depends) {
 
     debug(dbg_depcon,
           "packagelist[%p]::resolvedepcon([%p] %s --%s-->%s); (ing)->want=%s",
-          this, depends, depends->up->name, relatestrings[depends->type],
+          this, depends, depends->up->set->name, relatestrings[depends->type],
           pkg_names.string(), depends->up->clientdata ?
           wantstrings[depends->up->clientdata->suggested] : "(no clientdata)");
   }
@@ -261,7 +263,7 @@ int packagelist::resolvedepcon(dependency *depends) {
     if (fixbyupgrade) {
       debug(dbg_depcon,
             "packagelist[%p]::resolvedepcon([%p]): fixbyupgrade %s",
-            this, depends, fixbyupgrade->pkg->name);
+            this, depends, fixbyupgrade->pkg->set->name);
       best= fixbyupgrade;
     } else {
       best= 0;
@@ -291,7 +293,7 @@ int packagelist::resolvedepcon(dependency *depends) {
     }
     debug(dbg_depcon,
           "packagelist[%p]::resolvedepcon([%p]): select best=%s{%d}",
-          this, depends, best->pkg->name, best->spriority);
+          this, depends, best->pkg->set->name, best->spriority);
     if (best->spriority >= sp_selecting) return r;
     /* Always select depends. Only select recommends if we got here because
      * of a manually-initiated install request. */
@@ -305,7 +307,7 @@ int packagelist::resolvedepcon(dependency *depends) {
     best= depends->up->clientdata;
     debug(dbg_depcon,
           "packagelist[%p]::resolvedepcon([%p]): mustdeselect best=%s{%d}",
-          this, depends, best->pkg->name, best->spriority);
+          this, depends, best->pkg->set->name, best->spriority);
 
     if (best->spriority >= sp_deselecting) return r;
     /* Always remove depends, but never remove recommends. */

+ 5 - 5
dselect/pkginfo.cc

@@ -92,7 +92,7 @@ void packagelist::severalinfoblurb()
 void packagelist::itd_relations() {
   whatinfovb(_("Interrelationships"));
 
-  if (table[cursorline]->pkg->name) {
+  if (table[cursorline]->pkg->set->name) {
     debug(dbg_general, "packagelist[%p]::idt_relations(); '%s'",
           this, table[cursorline]->relations.string());
     waddstr(infopad,table[cursorline]->relations.string());
@@ -104,7 +104,7 @@ void packagelist::itd_relations() {
 void packagelist::itd_description() {
   whatinfovb(_("Description"));
 
-  if (table[cursorline]->pkg->name) {
+  if (table[cursorline]->pkg->set->name) {
     const char *m= table[cursorline]->pkg->available.description;
     if (!m || !*m)
       m = table[cursorline]->pkg->installed.description;
@@ -113,7 +113,7 @@ void packagelist::itd_description() {
     const char *p= strchr(m,'\n');
     int l= p ? (int)(p-m) : strlen(m);
     wattrset(infopad,info_headattr);
-    waddstr(infopad, table[cursorline]->pkg->name);
+    waddstr(infopad, table[cursorline]->pkg->set->name);
     waddstr(infopad," - ");
     waddnstr(infopad,m,l);
     wattrset(infopad,info_attr);
@@ -130,7 +130,7 @@ void packagelist::itd_statuscontrol() {
   whatinfovb(_("Installed control file information"));
 
   werase(infopad);
-  if (!table[cursorline]->pkg->name) {
+  if (!table[cursorline]->pkg->set->name) {
     severalinfoblurb();
   } else {
     varbuf vb;
@@ -146,7 +146,7 @@ void packagelist::itd_availablecontrol() {
   whatinfovb(_("Available control file information"));
 
   werase(infopad);
-  if (!table[cursorline]->pkg->name) {
+  if (!table[cursorline]->pkg->set->name) {
     severalinfoblurb();
   } else {
     varbuf vb;

+ 19 - 15
dselect/pkglist.cc

@@ -51,9 +51,11 @@ int packagelist::compareentries(const struct perpackagestate *a,
   }
 
   const char *asection= a->pkg->section;
-  if (!asection && a->pkg->name) asection= "";
+  if (!asection && a->pkg->set->name)
+    asection = "";
   const char *bsection= b->pkg->section;
-  if (!bsection && b->pkg->name) bsection= "";
+  if (!bsection && b->pkg->set->name)
+    bsection = "";
   int c_section=
     !asection || !bsection ?
       (!bsection) - (!asection) :
@@ -65,9 +67,9 @@ int packagelist::compareentries(const struct perpackagestate *a,
   if (!c_priority && a->pkg->priority == pkginfo::pri_other)
     c_priority= strcasecmp(a->pkg->otherpriority, b->pkg->otherpriority);
   int c_name=
-    a->pkg->name && b->pkg->name ?
-      strcasecmp(a->pkg->name, b->pkg->name) :
-    (!b->pkg->name) - (!a->pkg->name);
+    a->pkg->set->name && b->pkg->set->name ?
+      strcasecmp(a->pkg->set->name, b->pkg->set->name) :
+    (!b->pkg->set->name) - (!a->pkg->set->name);
 
   switch (sortorder) {
   case so_section:
@@ -87,7 +89,7 @@ int packagelist::compareentries(const struct perpackagestate *a,
 void packagelist::discardheadings() {
   int a,b;
   for (a=0, b=0; a<nitems; a++) {
-    if (table[a]->pkg->name) {
+    if (table[a]->pkg->set->name) {
       table[b++]= table[a];
     }
   }
@@ -97,7 +99,7 @@ void packagelist::discardheadings() {
   head= headings;
   while (head) {
     next= head->uprec;
-    delete head->pkg;
+    delete head->pkg->set;
     delete head;
     head= next;
   }
@@ -123,8 +125,10 @@ void packagelist::addheading(enum ssavailval ssavail,
         otherpriority ? otherpriority : "<null>",
         section ? section : "<null>");
 
-  struct pkginfo *newhead= new pkginfo;
-  newhead->name= 0;
+  struct pkgset *newset = new pkgset;
+  newset->name = NULL;
+  struct pkginfo *newhead = &newset->pkg;
+  newhead->set = newset;
   newhead->priority= priority;
   newhead->otherpriority= otherpriority;
   newhead->section= section;
@@ -174,7 +178,7 @@ void packagelist::ensurestatsortinfo() {
     if (calcssadone) return;
     for (index=0; index < nitems; index++) {
       debug(dbg_general, "packagelist[%p]::ensurestatsortinfos() i=%d pkg=%s",
-            this, index, table[index]->pkg->name);
+            this, index, table[index]->pkg->set->name);
       pkg= table[index]->pkg;
       switch (pkg->status) {
       case pkginfo::stat_unpacked:
@@ -224,7 +228,7 @@ void packagelist::ensurestatsortinfo() {
     if (calcsssdone) return;
     for (index=0; index < nitems; index++) {
       debug(dbg_general, "packagelist[%p]::ensurestatsortinfos() i=%d pkg=%s",
-            this, index, table[index]->pkg->name);
+            this, index, table[index]->pkg->set->name);
       switch (table[index]->pkg->status) {
       case pkginfo::stat_unpacked:
       case pkginfo::stat_halfconfigured:
@@ -281,7 +285,7 @@ void packagelist::sortmakeheads() {
   int a;
   for (a=0; a<nrealitems; a++) {
     thispkg= table[a]->pkg;
-    assert(thispkg->name);
+    assert(thispkg->set->name);
     int ssdiff= 0;
     ssavailval ssavail= ssa_none;
     ssstateval ssstate= sss_none;
@@ -311,7 +315,7 @@ void packagelist::sortmakeheads() {
     debug(dbg_general,
           "packagelist[%p]::sortmakeheads() pkg=%s  state=%d avail=%d %s  "
           "priority=%d otherpriority=%s %s  section=%s %s",
-          this, thispkg->name,
+          this, thispkg->set->name,
           thispkg->clientdata->ssavail, thispkg->clientdata->ssstate,
           ssdiff ? "*diff" : "same",
           thispkg->priority,
@@ -440,7 +444,7 @@ packagelist::packagelist(keybindings *kb, pkginfo **pkgltab) : baselist(kb) {
 }
 
 void perpackagestate::free(int recursive) {
-  if (pkg->name) {
+  if (pkg->set->name) {
     if (readwrite) {
       if (uprec) {
         assert(recursive);
@@ -604,7 +608,7 @@ pkginfo **packagelist::display() {
   } else {
     packagelist *sub= new packagelist(bindings,0);
     for (index=0; index < nitems; index++)
-      if (table[index]->pkg->name)
+      if (table[index]->pkg->set->name)
         sub->add(table[index]->pkg);
     repeatedlydisplay(sub,dp_must);
     debug(dbg_general,

+ 6 - 6
dselect/pkgsublist.cc

@@ -33,13 +33,13 @@
 #include "bindings.h"
 
 void packagelist::add(pkginfo *pkg) {
-  debug(dbg_general, "packagelist[%p]::add(pkginfo %s)", this, pkg->name);
+  debug(dbg_general, "packagelist[%p]::add(pkginfo %s)", this, pkg->set->name);
   if (!recursive ||  // never add things to top level
       !pkg->clientdata ||  // don't add pure virtual packages
       pkg->clientdata->uprec)  // don't add ones already in the recursive list
     return;
   debug(dbg_general, "packagelist[%p]::add(pkginfo %s) adding",
-        this, pkg->name);
+        this, pkg->set->name);
   perpackagestate *state= &datatable[nitems];
   state->pkg= pkg;
   state->direct= state->original= pkg->clientdata->selected;
@@ -54,21 +54,21 @@ void packagelist::add(pkginfo *pkg) {
 
 void packagelist::add(pkginfo *pkg, pkginfo::pkgwant nw) {
   debug(dbg_general, "packagelist[%p]::add(pkginfo %s, %s)",
-        this, pkg->name, wantstrings[nw]);
+        this, pkg->set->name, wantstrings[nw]);
   add(pkg);  if (!pkg->clientdata) return;
   pkg->clientdata->direct= nw;
   selpriority np;
   np= would_like_to_install(nw,pkg) ? sp_selecting : sp_deselecting;
   if (pkg->clientdata->spriority > np) return;
   debug(dbg_general, "packagelist[%p]::add(pkginfo %s, %s) setting",
-        this, pkg->name, wantstrings[nw]);
+        this, pkg->set->name, wantstrings[nw]);
   pkg->clientdata->suggested= pkg->clientdata->selected= nw;
   pkg->clientdata->spriority= np;
 }
 
 void packagelist::add(pkginfo *pkg, const char *extrainfo, showpriority showimp) {
   debug(dbg_general, "packagelist[%p]::add(pkginfo %s, ..., showpriority %d)",
-        this, pkg->name, showimp);
+        this, pkg->set->name, showimp);
   add(pkg);  if (!pkg->clientdata) return;
   if (pkg->clientdata->dpriority < showimp) pkg->clientdata->dpriority= showimp;
   pkg->clientdata->relations(extrainfo);
@@ -117,7 +117,7 @@ packagelist::add(dependency *depends, showpriority displayimportance)
 
   const char *comma= "";
   varbuf info;
-  info(depends->up->name);
+  info(depends->up->set->name);
   info(' ');
   info(gettext(relatestrings[depends->type]));
   info(' ');

+ 6 - 6
dselect/pkgtop.cc

@@ -108,16 +108,16 @@ void packagelist::redrawthisstate() {
   const char *section= table[cursorline]->pkg->section;
   const char *priority= pkgprioritystring(table[cursorline]->pkg);
   char *buf= new char[500+
-                      max((table[cursorline]->pkg->name ?
-                           strlen(table[cursorline]->pkg->name) : 0),
+                      max((table[cursorline]->pkg->set->name ?
+                           strlen(table[cursorline]->pkg->set->name) : 0),
                           (section ? strlen(section) : 0) +
                           (priority ? strlen(priority) : 0))];
 
-  if (table[cursorline]->pkg->name) {
+  if (table[cursorline]->pkg->set->name) {
     sprintf(buf,
             _("%-*s %s%s%s;  %s (was: %s).  %s"),
             package_width,
-            table[cursorline]->pkg->name,
+            table[cursorline]->pkg->set->name,
             gettext(statusstrings[table[cursorline]->pkg->status]),
             ((eflagstrings[table[cursorline]->pkg->eflag][0]==' ') &&
               (eflagstrings[table[cursorline]->pkg->eflag][1]=='\0'))  ? "" : " - ",
@@ -144,7 +144,7 @@ void packagelist::redraw1itemsel(int index, int selected) {
 
   wattrset(listpad, selected ? listsel_attr : list_attr);
 
-  if (pkg->name) {
+  if (pkg->set->name) {
     if (verbose) {
       mvwprintw(listpad, screenline, 0, "%-*.*s ",
                 status_hold_width, status_hold_width,
@@ -199,7 +199,7 @@ void packagelist::redraw1itemsel(int index, int selected) {
               pkg->section ? pkg->section : "?");
 
     mvwprintw(listpad, screenline, package_column - 1, " %-*.*s ",
-              package_width, package_width, pkg->name);
+              package_width, package_width, pkg->set->name);
 
     if (versioninstalled_width)
       mvwprintw(listpad, screenline, versioninstalled_column, "%-*.*s ",

+ 9 - 8
lib/dpkg/dbmodify.c

@@ -344,18 +344,19 @@ modstatdb_note_core(struct pkginfo *pkg)
   varbufrecord(&uvb, pkg, &pkg->installed);
 
   if (fwrite(uvb.buf, 1, uvb.used, importanttmp) != uvb.used)
-    ohshite(_("unable to write updated status of `%.250s'"), pkg->name);
+    ohshite(_("unable to write updated status of `%.250s'"), pkg->set->name);
   if (fflush(importanttmp))
-    ohshite(_("unable to flush updated status of `%.250s'"), pkg->name);
+    ohshite(_("unable to flush updated status of `%.250s'"), pkg->set->name);
   if (ftruncate(fileno(importanttmp), uvb.used))
-    ohshite(_("unable to truncate for updated status of `%.250s'"), pkg->name);
+    ohshite(_("unable to truncate for updated status of `%.250s'"),
+            pkg->set->name);
   if (fsync(fileno(importanttmp)))
-    ohshite(_("unable to fsync updated status of `%.250s'"), pkg->name);
+    ohshite(_("unable to fsync updated status of `%.250s'"), pkg->set->name);
   if (fclose(importanttmp))
-    ohshite(_("unable to close updated status of `%.250s'"), pkg->name);
+    ohshite(_("unable to close updated status of `%.250s'"), pkg->set->name);
   sprintf(updatefnrest, IMPORTANTFMT, nextupdate);
   if (rename(importanttmpfile, updatefnbuf))
-    ohshite(_("unable to install updated status of `%.250s'"), pkg->name);
+    ohshite(_("unable to install updated status of `%.250s'"), pkg->set->name);
 
   dir_sync_path(updatesdir);
 
@@ -396,9 +397,9 @@ void modstatdb_note(struct pkginfo *pkg) {
     pkg->trigaw.head = pkg->trigaw.tail = NULL;
   }
 
-  log_message("status %s %s %s", statusinfos[pkg->status].name, pkg->name,
+  log_message("status %s %s %s", statusinfos[pkg->status].name, pkg->set->name,
 	      versiondescribe(&pkg->installed.version, vdew_nonambig));
-  statusfd_send("status: %s: %s", pkg->name, statusinfos[pkg->status].name);
+  statusfd_send("status: %s: %s", pkg->set->name, statusinfos[pkg->status].name);
 
   if (cstatus >= msdbrw_write)
     modstatdb_note_core(pkg);

+ 0 - 1
lib/dpkg/dpkg-db.h

@@ -164,7 +164,6 @@ struct pkginfo {
   struct pkgset *set;
   struct pkginfo *arch_next;
 
-  const char *name;
   enum pkgwant {
     want_unknown, want_install, want_hold, want_deinstall, want_purge,
     /* Not allowed except as special sentinel value in some places. */

+ 6 - 6
lib/dpkg/dump.c

@@ -50,10 +50,10 @@ w_name(struct varbuf *vb,
        const struct pkginfo *pigp, const struct pkgbin *pifp,
        enum fwriteflags flags, const struct fieldinfo *fip)
 {
-  assert(pigp->name);
+  assert(pigp->set->name);
   if (flags&fw_printheader)
     varbuf_add_str(vb, "Package: ");
-  varbuf_add_str(vb, pigp->name);
+  varbuf_add_str(vb, pigp->set->name);
   if (flags&fw_printheader)
     varbuf_add_char(vb, '\n');
 }
@@ -402,7 +402,7 @@ w_trigaw(struct varbuf *vb,
     varbuf_add_str(vb, "Triggers-Awaited:");
   for (ta = pigp->trigaw.head; ta; ta = ta->sameaw.next) {
     varbuf_add_char(vb, ' ');
-    varbuf_add_str(vb, ta->pend->name);
+    varbuf_add_str(vb, ta->pend->set->name);
   }
   if (flags & fw_printheader)
     varbuf_add_char(vb, '\n');
@@ -435,8 +435,8 @@ writerecord(FILE *file, const char *filename,
   varbufrecord(&vb,pigp,pifp);
   varbuf_end_str(&vb);
   if (fputs(vb.buf,file) < 0)
-    ohshite(_("failed to write details of `%.50s' to `%.250s'"), pigp->name,
-	    filename);
+    ohshite(_("failed to write details of `%.50s' to `%.250s'"),
+            pigp->set->name, filename);
    varbuf_destroy(&vb);
 }
 
@@ -478,7 +478,7 @@ writedb(const char *filename, enum writedb_flags flags)
     varbuf_end_str(&vb);
     if (fputs(vb.buf,file) < 0)
       ohshite(_("failed to write %s database record about '%.50s' to '%.250s'"),
-              which, pigp->name, filename);
+              which, pigp->set->name, filename);
     varbuf_reset(&vb);
   }
   pkg_db_iter_free(it);

+ 1 - 1
lib/dpkg/fields.c

@@ -89,7 +89,7 @@ f_name(struct pkginfo *pigp, struct pkgbin *pifp,
   if (e != NULL)
     parse_error(ps, _("invalid package name (%.250s)"), e);
   /* We use the new name, as pkg_db_find() may have done a tolower for us. */
-  pigp->name = pkg_db_find(value)->name;
+  pigp->set->name = pkg_db_find(value)->set->name;
 }
 
 void

+ 2 - 2
lib/dpkg/parse.c

@@ -170,7 +170,7 @@ static void
 pkg_parse_verify(struct parsedb_state *ps,
                  struct pkginfo *pkg, struct pkgbin *pkgbin)
 {
-  parse_must_have_field(ps, pkg->name, "package name");
+  parse_must_have_field(ps, pkg->set->name, "package name");
 
   /* XXX: We need to check for status != stat_halfinstalled as while
    * unpacking an unselected package, it will not have yet all data in
@@ -550,7 +550,7 @@ int parsedb(const char *filename, enum parsedbflags flags,
 
     pkg_parse_verify(&ps, new_pkg, new_pkgbin);
 
-    db_pkg = pkg_db_find(new_pkg->name);
+    db_pkg = pkg_db_find(new_pkg->set->name);
     if (flags & pdb_recordavailable)
       db_pkgbin = &db_pkg->available;
     else

+ 2 - 2
lib/dpkg/parsehelp.c

@@ -42,9 +42,9 @@ parse_error_msg(struct parsedb_state *ps, const char *fmt)
 
   str_escape_fmt(filename, ps->filename, sizeof(filename));
 
-  if (ps->pkg && ps->pkg->name)
+  if (ps->pkg && ps->pkg->set->name)
     sprintf(msg, _("parsing file '%.255s' near line %d package '%.255s':\n"
-                   " %.255s"), filename, ps->lno, ps->pkg->name, fmt);
+                   " %.255s"), filename, ps->lno, ps->pkg->set->name, fmt);
   else
     sprintf(msg, _("parsing file '%.255s' near line %d:\n"
                    " %.255s"), filename, ps->lno, fmt);

+ 0 - 1
lib/dpkg/pkg-db.c

@@ -78,7 +78,6 @@ pkg_db_find(const char *inname)
   pkgset_blank(newpkg);
   newpkg->name= nfstrsave(name);
   newpkg->next= NULL;
-  newpkg->pkg.name = newpkg->name;
   *pointerp= newpkg;
   npackages++;
 

+ 1 - 2
lib/dpkg/pkg.c

@@ -50,7 +50,6 @@ pkg_blank(struct pkginfo *pkg)
 {
 	pkg->set = NULL;
 	pkg->arch_next = NULL;
-	pkg->name = NULL;
 	pkg->status = stat_notinstalled;
 	pkg->eflag = eflag_ok;
 	pkg->want = want_unknown;
@@ -133,5 +132,5 @@ pkg_sorter_by_name(const void *a, const void *b)
 	const struct pkginfo *pa = *(const struct pkginfo **)a;
 	const struct pkginfo *pb = *(const struct pkginfo **)b;
 
-	return strcmp(pa->name, pb->name);
+	return strcmp(pa->set->name, pb->set->name);
 }

+ 6 - 6
lib/dpkg/triglib.c

@@ -221,7 +221,7 @@ trk_unknown_interest_change(const char *trig, struct pkginfo *pkg, int signum,
 {
 	ohshit(_("invalid or unknown syntax in trigger name `%.250s'"
 	         " (in trigger interests for package `%.250s')"),
-	       trig, pkg->name);
+	       trig, pkg->set->name);
 }
 
 static const struct trigkindinfo tki_unknown = {
@@ -362,15 +362,15 @@ trk_explicit_interest_change(const char *trig,  struct pkginfo *pkg, int signum,
 	push_cleanup(cu_closestream, ~ehflag_normaltidy, NULL, 0, 1, nf);
 
 	while (trk_explicit_f && trk_explicit_fgets(buf, sizeof(buf)) >= 0) {
-		int len = strlen(pkg->name);
-		if (strncmp(buf, pkg->name, len) == 0 &&
+		int len = strlen(pkg->set->name);
+		if (strncmp(buf, pkg->set->name, len) == 0 &&
 		    (buf[len] == '\0' || buf[len] == '/'))
 			continue;
 		fprintf(nf, "%s\n", buf);
 		empty = false;
 	}
 	if (signum > 0) {
-		fprintf(nf, "%s%s\n", pkg->name,
+		fprintf(nf, "%s%s\n", pkg->set->name,
 		        (opts == trig_noawait) ? "/noawait" : "");
 		empty = false;
 	}
@@ -454,7 +454,7 @@ found:
 	tfi->options = opts;
 	if (signum > 1)
 		ohshit(_("duplicate file trigger interest for filename `%.250s' "
-		         "and package `%.250s'"), trig, pkg->name);
+		         "and package `%.250s'"), trig, pkg->set->name);
 	if (signum > 0)
 		return;
 
@@ -486,7 +486,7 @@ trig_file_interests_update(void)
 
 	for (tfi = filetriggers.head; tfi; tfi = tfi->inoverall.next)
 		fprintf(nf, "%s %s%s\n", trigh.namenode_name(tfi->fnn),
-		        tfi->pkg->name,
+		        tfi->pkg->set->name,
 		        (tfi->options == trig_noawait) ? "/noawait" : "");
 
 	if (ferror(nf))

+ 35 - 33
src/archives.c

@@ -117,7 +117,7 @@ filesavespackage(struct fileinlist *file,
   struct pkginfo *divpkg, *thirdpkg;
 
   debug(dbg_eachfiledetail,"filesavespackage file `%s' package %s",
-        file->namenode->name,pkgtobesaved->name);
+        file->namenode->name, pkgtobesaved->set->name);
 
   /* If the file is a contended one and it's overridden by either
    * the package we're considering disappearing or the package
@@ -140,7 +140,7 @@ filesavespackage(struct fileinlist *file,
   iter = filepackages_iter_new(file->namenode);
   while ((thirdpkg = filepackages_iter_next(iter))) {
     debug(dbg_eachfiledetail, "filesavespackage ... also in %s",
-          thirdpkg->name);
+          thirdpkg->set->name);
 
     /* Is this not the package being installed or the one being
      * checked for disappearance? */
@@ -215,8 +215,8 @@ does_replace(struct pkginfo *newpigp, struct pkgbin *newpifp,
 {
   struct dependency *dep;
 
-  debug(dbg_depcon,"does_replace new=%s old=%s (%s)",newpigp->name,
-        oldpigp->name, versiondescribe(&oldpifp->version, vdew_always));
+  debug(dbg_depcon,"does_replace new=%s old=%s (%s)", newpigp->set->name,
+        oldpigp->set->name, versiondescribe(&oldpifp->version, vdew_always));
   for (dep= newpifp->depends; dep; dep= dep->next) {
     if (dep->type != dep_replaces || dep->list->ed != oldpigp->set)
       continue;
@@ -476,7 +476,7 @@ tarobject(void *ctx, struct tar_entry *ti)
                   _("trying to overwrite `%.250s', which is the "
                     "diverted version of `%.250s' (package: %.100s)"),
                   nifd->namenode->name, nifd->namenode->divert->camefrom->name,
-                  divpkg->name);
+                  divpkg->set->name);
     } else {
       forcibleerr(fc_overwritediverted,
                   _("trying to overwrite `%.250s', which is the "
@@ -571,7 +571,7 @@ tarobject(void *ctx, struct tar_entry *ti)
     while ((otherpkg = filepackages_iter_next(iter))) {
       if (otherpkg == tc->pkg)
         continue;
-      debug(dbg_eachfile, "tarobject ... found in %s", otherpkg->name);
+      debug(dbg_eachfile, "tarobject ... found in %s", otherpkg->set->name);
 
       if (nifd->namenode->divert && nifd->namenode->divert->useinstead) {
         /* Right, so we may be diverting this file. This makes the conflict
@@ -579,7 +579,7 @@ tarobject(void *ctx, struct tar_entry *ti)
          * check for both being the diverting package, obviously). */
         divpkg = nifd->namenode->divert->pkg;
         debug(dbg_eachfile, "tarobject ... diverted, divpkg=%s",
-              divpkg ? divpkg->name : "<none>");
+              divpkg ? divpkg->set->name : "<none>");
         if (otherpkg == divpkg || tc->pkg == divpkg)
           continue;
       }
@@ -639,12 +639,13 @@ tarobject(void *ctx, struct tar_entry *ti)
 
       if (does_replace(tc->pkg, &tc->pkg->available,
                        otherpkg, &otherpkg->installed)) {
-        printf(_("Replacing files in old package %s ...\n"),otherpkg->name);
+        printf(_("Replacing files in old package %s ...\n"),
+               otherpkg->set->name);
         otherpkg->clientdata->replacingfilesandsaid = 1;
       } else if (does_replace(otherpkg, &otherpkg->installed,
                               tc->pkg, &tc->pkg->available)) {
         printf(_("Replaced by files in installed package %s ...\n"),
-               otherpkg->name);
+               otherpkg->set->name);
         otherpkg->clientdata->replacingfilesandsaid = 2;
         nifd->namenode->flags &= ~fnnf_new_inarchive;
         keepexisting = true;
@@ -654,14 +655,14 @@ tarobject(void *ctx, struct tar_entry *ti)
           forcibleerr(fc_overwritedir,
                       _("trying to overwrite directory '%.250s' "
                         "in package %.250s %.250s with nondirectory"),
-                      nifd->namenode->name, otherpkg->name,
+                      nifd->namenode->name, otherpkg->set->name,
                       versiondescribe(&otherpkg->installed.version,
                                       vdew_nonambig));
         } else {
           forcibleerr(fc_overwrite,
                       _("trying to overwrite '%.250s', "
                         "which is also in package %.250s %.250s"),
-                      nifd->namenode->name, otherpkg->name,
+                      nifd->namenode->name, otherpkg->set->name,
                       versiondescribe(&otherpkg->installed.version,
                                       vdew_nonambig));
         }
@@ -1004,11 +1005,11 @@ try_deconfigure_can(bool (*force_p)(struct deppossi *), struct pkginfo *pkg,
     if (pkg->installed.essential) {
       if (fc_removeessential) {
         warning(_("considering deconfiguration of essential\n"
-                  " package %s, to enable %s."), pkg->name, action);
+                  " package %s, to enable %s."), pkg->set->name, action);
       } else {
         fprintf(stderr, _("dpkg: no, %s is essential, will not deconfigure\n"
                           " it in order to enable %s.\n"),
-                pkg->name, action);
+                pkg->set->name, action);
         return 0;
       }
     }
@@ -1030,7 +1031,7 @@ static int try_remove_can(struct deppossi *pdep,
                           struct pkginfo *fixbyrm,
                           const char *why) {
   char action[512];
-  sprintf(action, _("removal of %.250s"), fixbyrm->name);
+  sprintf(action, _("removal of %.250s"), fixbyrm->set->name);
   return try_deconfigure_can(force_depends, pdep->up->up, pdep,
                              action, fixbyrm, why);
 }
@@ -1055,20 +1056,20 @@ void check_breaks(struct dependency *dep, struct pkginfo *pkg,
     ensure_package_clientdata(fixbydeconf);
     assert(fixbydeconf->clientdata->istobe == itb_normal);
 
-    sprintf(action, _("installation of %.250s"), pkg->name);
+    sprintf(action, _("installation of %.250s"), pkg->set->name);
     fprintf(stderr, _("dpkg: considering deconfiguration of %s,"
                       " which would be broken by %s ...\n"),
-            fixbydeconf->name, action);
+            fixbydeconf->set->name, action);
 
     ok= try_deconfigure_can(force_breaks, fixbydeconf, dep->list,
                             action, NULL, why.buf);
     if (ok == 1) {
       fprintf(stderr, _("dpkg: yes, will deconfigure %s (broken by %s).\n"),
-              fixbydeconf->name, pkg->name);
+              fixbydeconf->set->name, pkg->set->name);
     }
   } else {
     fprintf(stderr, _("dpkg: regarding %s containing %s:\n%s"),
-            pfilename, pkg->name, why.buf);
+            pfilename, pkg->set->name, why.buf);
     ok= 0;
   }
   varbuf_destroy(&why);
@@ -1082,10 +1083,10 @@ void check_breaks(struct dependency *dep, struct pkginfo *pkg,
   if (fixbydeconf && !f_autodeconf) {
     ohshit(_("installing %.250s would break %.250s, and\n"
              " deconfiguration is not permitted (--auto-deconfigure might help)"),
-           pkg->name, fixbydeconf->name);
+           pkg->set->name, fixbydeconf->set->name);
   } else {
     ohshit(_("installing %.250s would break existing software"),
-           pkg->name);
+           pkg->set->name);
   }
 }
 
@@ -1115,13 +1116,13 @@ void check_conflict(struct dependency *dep, struct pkginfo *pkg,
       assert(fixbyrm->clientdata->istobe == itb_normal || fixbyrm->clientdata->istobe == itb_deconfigure);
       fixbyrm->clientdata->istobe= itb_remove;
       fprintf(stderr, _("dpkg: considering removing %s in favour of %s ...\n"),
-              fixbyrm->name, pkg->name);
+              fixbyrm->set->name, pkg->set->name);
       if (!(fixbyrm->status == stat_installed ||
             fixbyrm->status == stat_triggerspending ||
             fixbyrm->status == stat_triggersawaited)) {
         fprintf(stderr,
                 _("%s is not properly installed - ignoring any dependencies on it.\n"),
-                fixbyrm->name);
+                fixbyrm->set->name);
         pdep = NULL;
       } else {
         for (pdep = fixbyrm->set->depended.installed;
@@ -1151,7 +1152,7 @@ void check_conflict(struct dependency *dep, struct pkginfo *pkg,
               varbuf_end_str(&removalwhy);
               fprintf(stderr, _("dpkg"
                       ": may have trouble removing %s, as it provides %s ...\n"),
-                      fixbyrm->name, providecheck->list->ed->name);
+                      fixbyrm->set->name, providecheck->list->ed->name);
               if (!try_remove_can(pdep,fixbyrm,removalwhy.buf))
                 goto break_from_both_loops_at_once;
             }
@@ -1165,10 +1166,10 @@ void check_conflict(struct dependency *dep, struct pkginfo *pkg,
       if (!pdep && (fixbyrm->eflag & eflag_reinstreq)) {
         if (fc_removereinstreq) {
           fprintf(stderr, _("dpkg: package %s requires reinstallation, but will"
-                  " remove anyway as you requested.\n"), fixbyrm->name);
+                  " remove anyway as you requested.\n"), fixbyrm->set->name);
         } else {
           fprintf(stderr, _("dpkg: package %s requires reinstallation, "
-                  "will not remove.\n"), fixbyrm->name);
+                  "will not remove.\n"), fixbyrm->set->name);
           pdep= &flagdeppossi;
         }
       }
@@ -1177,7 +1178,7 @@ void check_conflict(struct dependency *dep, struct pkginfo *pkg,
         push_conflictor(pkg, fixbyrm);
         varbuf_destroy(&conflictwhy); varbuf_destroy(&removalwhy);
         fprintf(stderr, _("dpkg: yes, will remove %s in favour of %s.\n"),
-                fixbyrm->name, pkg->name);
+                fixbyrm->set->name, pkg->set->name);
         return;
       }
       /* Put it back. */
@@ -1186,9 +1187,9 @@ void check_conflict(struct dependency *dep, struct pkginfo *pkg,
   }
   varbuf_end_str(&conflictwhy);
   fprintf(stderr, _("dpkg: regarding %s containing %s:\n%s"),
-          pfilename, pkg->name, conflictwhy.buf);
+          pfilename, pkg->set->name, conflictwhy.buf);
   if (!force_conflicts(dep->list))
-    ohshit(_("conflicting packages - not installing %.250s"),pkg->name);
+    ohshit(_("conflicting packages - not installing %.250s"), pkg->set->name);
   warning(_("ignoring conflict, may proceed anyway!"));
   varbuf_destroy(&conflictwhy);
 
@@ -1365,11 +1366,12 @@ wanttoinstall(struct pkginfo *pkg)
 
   if (pkg->want != want_install && pkg->want != want_hold) {
     if (f_alsoselect) {
-      printf(_("Selecting previously unselected package %s.\n"), pkg->name);
+      printf(_("Selecting previously unselected package %s.\n"),
+             pkg->set->name);
       pkg->want = want_install;
       return true;
     } else {
-      printf(_("Skipping unselected package %s.\n"), pkg->name);
+      printf(_("Skipping unselected package %s.\n"), pkg->set->name);
       return false;
     }
   }
@@ -1388,20 +1390,20 @@ wanttoinstall(struct pkginfo *pkg)
       fprintf(stderr, _("Version %.250s of %.250s already installed, "
                         "skipping.\n"),
               versiondescribe(&pkg->installed.version, vdew_nonambig),
-              pkg->name);
+              pkg->set->name);
       return false;
     } else {
       return true;
     }
   } else {
     if (fc_downgrade) {
-      warning(_("downgrading %.250s from %.250s to %.250s."), pkg->name,
+      warning(_("downgrading %.250s from %.250s to %.250s."), pkg->set->name,
               versiondescribe(&pkg->installed.version, vdew_nonambig),
               versiondescribe(&pkg->available.version, vdew_nonambig));
       return true;
     } else {
       fprintf(stderr, _("Will not downgrade %.250s from version %.250s "
-                        "to %.250s, skipping.\n"), pkg->name,
+                        "to %.250s, skipping.\n"), pkg->set->name,
               versiondescribe(&pkg->installed.version, vdew_nonambig),
               versiondescribe(&pkg->available.version, vdew_nonambig));
       return false;

+ 4 - 4
src/cleanup.c

@@ -144,16 +144,16 @@ void cu_prermdeconfigure(int argc, void **argv) {
 
   if (conflictor) {
     maintainer_script_postinst(deconf, "abort-deconfigure",
-                               "in-favour", infavour->name,
+                               "in-favour", infavour->set->name,
                                versiondescribe(&infavour->available.version,
                                                vdew_nonambig),
-                               "removing", conflictor->name,
+                               "removing", conflictor->set->name,
                                versiondescribe(&conflictor->installed.version,
                                                vdew_nonambig),
                                NULL);
   } else {
     maintainer_script_postinst(deconf, "abort-deconfigure",
-                               "in-favour", infavour->name,
+                               "in-favour", infavour->set->name,
                                versiondescribe(&infavour->available.version,
                                                vdew_nonambig),
                                NULL);
@@ -168,7 +168,7 @@ void cu_prerminfavour(int argc, void **argv) {
 
   if (cleanup_conflictor_failed++) return;
   maintainer_script_postinst(conflictor, "abort-remove",
-                             "in-favour", infavour->name,
+                             "in-favour", infavour->set->name,
                              versiondescribe(&infavour->available.version,
                                              vdew_nonambig),
                              NULL);

+ 18 - 18
src/configure.c

@@ -166,7 +166,7 @@ deferred_configure_conffile(struct pkginfo *pkg, struct conffile *conff)
 		strcpy(cdr2rest, DPKGOLDEXT);
 		if (unlink(cdr2.buf) && errno != ENOENT)
 			warning(_("%s: failed to remove old backup '%.250s': %s"),
-			        pkg->name, cdr2.buf, strerror(errno));
+			        pkg->set->name, cdr2.buf, strerror(errno));
 
 		varbuf_add_str(&cdr, DPKGDISTEXT);
 		varbuf_end_str(&cdr);
@@ -174,27 +174,27 @@ deferred_configure_conffile(struct pkginfo *pkg, struct conffile *conff)
 		trig_file_activate(usenode, pkg);
 		if (rename(cdr2.buf, cdr.buf))
 			warning(_("%s: failed to rename '%.250s' to '%.250s': %s"),
-			        pkg->name, cdr2.buf, cdr.buf, strerror(errno));
+			        pkg->set->name, cdr2.buf, cdr.buf, strerror(errno));
 		break;
 	case cfo_keep:
 		strcpy(cdr2rest, DPKGNEWEXT);
 		if (unlink(cdr2.buf))
 			warning(_("%s: failed to remove '%.250s': %s"),
-			        pkg->name, cdr2.buf, strerror(errno));
+			        pkg->set->name, cdr2.buf, strerror(errno));
 		break;
 	case cfo_install | cfof_backup:
 		strcpy(cdr2rest, DPKGDISTEXT);
 		if (unlink(cdr2.buf) && errno != ENOENT)
 			warning(_("%s: failed to remove old distributed version '%.250s': %s"),
-			        pkg->name, cdr2.buf, strerror(errno));
+			        pkg->set->name, cdr2.buf, strerror(errno));
 		strcpy(cdr2rest, DPKGOLDEXT);
 		if (unlink(cdr2.buf) && errno != ENOENT)
 			warning(_("%s: failed to remove '%.250s' (before overwrite): %s"),
-			        pkg->name, cdr2.buf, strerror(errno));
+			        pkg->set->name, cdr2.buf, strerror(errno));
 		if (!(what & cfof_userrmd))
 			if (link(cdr.buf, cdr2.buf))
 				warning(_("%s: failed to link '%.250s' to '%.250s': %s"),
-				        pkg->name, cdr.buf, cdr2.buf, strerror(errno));
+				        pkg->set->name, cdr.buf, cdr2.buf, strerror(errno));
 		/* Fall through. */
 	case cfo_install:
 		printf(_("Installing new version of config file %s ...\n"),
@@ -255,14 +255,14 @@ deferred_configure(struct pkginfo *pkg)
 
 	if (pkg->status == stat_notinstalled)
 		ohshit(_("no package named `%s' is installed, cannot configure"),
-		       pkg->name);
+		       pkg->set->name);
 	if (pkg->status == stat_installed)
 		ohshit(_("package %.250s is already installed and configured"),
-		       pkg->name);
+		       pkg->set->name);
 	if (pkg->status != stat_unpacked && pkg->status != stat_halfconfigured)
 		ohshit(_("package %.250s is not ready for configuration\n"
 		         " cannot configure (current status `%.250s')"),
-		       pkg->name, statusinfos[pkg->status].name);
+		       pkg->set->name, statusinfos[pkg->status].name);
 
 	if (dependtry > 1)
 		if (findbreakcycle(pkg))
@@ -292,14 +292,14 @@ deferred_configure(struct pkginfo *pkg)
 		varbuf_end_str(&aemsgs);
 		fprintf(stderr,
 		        _("dpkg: dependency problems prevent configuration of %s:\n%s"),
-		        pkg->name, aemsgs.buf);
+		        pkg->set->name, aemsgs.buf);
 		varbuf_destroy(&aemsgs);
 		ohshit(_("dependency problems - leaving unconfigured"));
 	} else if (aemsgs.used) {
 		varbuf_end_str(&aemsgs);
 		fprintf(stderr,
 		        _("dpkg: %s: dependency problems, but configuring anyway as you requested:\n%s"),
-		        pkg->name, aemsgs.buf);
+		        pkg->set->name, aemsgs.buf);
 	}
 	varbuf_destroy(&aemsgs);
 	sincenothing = 0;
@@ -309,7 +309,7 @@ deferred_configure(struct pkginfo *pkg)
 		            _("Package is in a very bad inconsistent state - you should\n"
 		              " reinstall it before attempting configuration."));
 
-	printf(_("Setting up %s (%s) ...\n"), pkg->name,
+	printf(_("Setting up %s (%s) ...\n"), pkg->set->name,
 	       versiondescribe(&pkg->installed.version, vdew_nonambig));
 	log_action("configure", pkg);
 
@@ -395,7 +395,7 @@ conffderef(struct pkginfo *pkg, struct varbuf *result, const char *in)
 			if (errno != ENOENT)
 				warning(_("%s: unable to stat config file '%s'\n"
 				          " (= '%s'): %s"),
-				        pkg->name, in, result->buf, strerror(errno));
+				        pkg->set->name, in, result->buf, strerror(errno));
 			debug(dbg_conffdetail, "conffderef nonexistent");
 			return 0;
 		} else if (S_ISREG(stab.st_mode)) {
@@ -407,7 +407,7 @@ conffderef(struct pkginfo *pkg, struct varbuf *result, const char *in)
 			      loopprotect);
 			if (loopprotect++ >= 25) {
 				warning(_("%s: config file '%s' is a circular link\n"
-				          " (= '%s')"), pkg->name, in, result->buf);
+				          " (= '%s')"), pkg->set->name, in, result->buf);
 				return -1;
 			}
 
@@ -417,7 +417,7 @@ conffderef(struct pkginfo *pkg, struct varbuf *result, const char *in)
 			if (r < 0) {
 				warning(_("%s: unable to readlink conffile '%s'\n"
 				          " (= '%s'): %s"),
-				        pkg->name, in, result->buf, strerror(errno));
+				        pkg->set->name, in, result->buf, strerror(errno));
 				return -1;
 			} else if (r != stab.st_size) {
 				warning(_("symbolic link '%.250s' size has "
@@ -443,7 +443,7 @@ conffderef(struct pkginfo *pkg, struct varbuf *result, const char *in)
 				if (r < 0) {
 					warning(_("%s: conffile '%.250s' resolves to degenerate filename\n"
 					          " ('%s' is a symlink to '%s')"),
-					        pkg->name, in, result->buf,
+					        pkg->set->name, in, result->buf,
 					        target.buf);
 					return -1;
 				}
@@ -458,7 +458,7 @@ conffderef(struct pkginfo *pkg, struct varbuf *result, const char *in)
 			varbuf_end_str(result);
 		} else {
 			warning(_("%s: conffile '%.250s' is not a plain file or symlink (= '%s')"),
-			        pkg->name, in, result->buf);
+			        pkg->set->name, in, result->buf);
 			return -1;
 		}
 	}
@@ -490,7 +490,7 @@ md5hash(struct pkginfo *pkg, char *hashbuf, const char *fn)
 		strcpy(hashbuf, NONEXISTENTFLAG);
 	} else {
 		warning(_("%s: unable to open conffile %s for hash: %s"),
-		        pkg->name, fn, strerror(errno));
+		        pkg->set->name, fn, strerror(errno));
 		strcpy(hashbuf, "-");
 	}
 }

+ 9 - 9
src/depcon.c

@@ -84,7 +84,7 @@ foundcyclebroken(struct cyclesofarlink *thislink, struct cyclesofarlink *sofar,
   sol->possi->cyclebreak = true;
 
   debug(dbg_depcon, "cycle broken at %s -> %s",
-        sol->possi->up->up->name, sol->possi->ed->name);
+        sol->possi->up->up->set->name, sol->possi->ed->name);
 
   return true;
 }
@@ -112,10 +112,10 @@ findbreakcyclerecursive(struct pkginfo *pkg, struct cyclesofarlink *sofar)
 
     for (sol = sofar; sol; sol = sol->prev) {
       varbuf_add_str(&str_pkgs, " <- ");
-      varbuf_add_str(&str_pkgs, sol->pkg->name);
+      varbuf_add_str(&str_pkgs, sol->pkg->set->name);
     }
     varbuf_end_str(&str_pkgs);
-    debug(dbg_depcondetail, "findbreakcyclerecursive %s %s", pkg->name,
+    debug(dbg_depcondetail, "findbreakcyclerecursive %s %s", pkg->set->name,
           str_pkgs.buf);
     varbuf_destroy(&str_pkgs);
   }
@@ -199,7 +199,7 @@ void describedepcon(struct varbuf *addto, struct dependency *dep) {
   varbufdependency(&depstr, dep);
   varbuf_end_str(&depstr);
 
-  varbuf_printf(addto, fmt, dep->up->name, depstr.buf);
+  varbuf_printf(addto, fmt, dep->up->set->name, depstr.buf);
   varbuf_destroy(&depstr);
 }
 
@@ -387,11 +387,11 @@ depisok(struct dependency *dep, struct varbuf *whynot,
             continue;
           case itb_remove:
             sprintf(linebuf, _("  %.250s provides %.250s but is to be removed.\n"),
-                    provider->up->up->name, possi->ed->name);
+                    provider->up->up->set->name, possi->ed->name);
             break;
           case itb_deconfigure:
             sprintf(linebuf, _("  %.250s provides %.250s but is to be deconfigured.\n"),
-                    provider->up->up->name, possi->ed->name);
+                    provider->up->up->set->name, possi->ed->name);
             break;
           case itb_normal: case itb_preinstall:
             if (provider->up->up->status == stat_installed ||
@@ -400,7 +400,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
             if (provider->up->up->status == stat_triggersawaited)
               *canfixbytrigaw = provider->up->up;
             sprintf(linebuf, _("  %.250s provides %.250s but is %s.\n"),
-                    provider->up->up->name, possi->ed->name,
+                    provider->up->up->set->name, possi->ed->name,
                     gettext(statusstrings[provider->up->up->status]));
             break;
           default:
@@ -496,7 +496,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
         if (provider->up->up == dep->up)
           continue; /* Conflicts and provides the same. */
         sprintf(linebuf, _("  %.250s provides %.250s and is to be installed.\n"),
-                provider->up->up->name, possi->ed->name);
+                provider->up->up->set->name, possi->ed->name);
         varbuf_add_str(whynot, linebuf);
         /* We can't remove the one we're about to install: */
         if (canfixbyremove)
@@ -538,7 +538,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
           case stat_triggersawaited:
             sprintf(linebuf,
                     _("  %.250s provides %.250s and is present and %s.\n"),
-                    provider->up->up->name, possi->ed->name,
+                    provider->up->up->set->name, possi->ed->name,
                     gettext(statusstrings[provider->up->up->status]));
             varbuf_add_str(whynot, linebuf);
             if (!canfixbyremove)

+ 3 - 3
src/divertcmd.c

@@ -270,7 +270,7 @@ diversion_pkg_name(struct diversion *d)
 	if (d->pkg == NULL)
 		return ":";
 	else
-		return d->pkg->name;
+		return d->pkg->set->name;
 }
 
 static const char *
@@ -335,7 +335,7 @@ diversion_describe(struct diversion *d)
 	if (d->pkg == NULL)
 		pkgname = NULL;
 	else
-		pkgname = d->pkg->name;
+		pkgname = d->pkg->set->name;
 
 	return varbuf_diversion(&str, pkgname, name_from, name_to);
 }
@@ -640,7 +640,7 @@ diversion_listpackage(const char *const *argv)
 		 * namespace. */
 		printf("LOCAL\n");
 	else
-		printf("%s\n", namenode->divert->pkg->name);
+		printf("%s\n", namenode->divert->pkg->set->name);
 
 	return 0;
 }

+ 6 - 5
src/enquiry.c

@@ -119,13 +119,13 @@ static void describebriefly(struct pkginfo *pkg) {
   const char *pdesc;
 
   maxl= 57;
-  l= strlen(pkg->name);
+  l= strlen(pkg->set->name);
   if (l>20) maxl -= (l-20);
 
   pdesc = pkg_summary(pkg, &l);
   l = min(l, maxl);
 
-  printf(" %-20s %.*s\n",pkg->name,l,pdesc);
+  printf(" %-20s %.*s\n", pkg->set->name, l, pdesc);
 }
 
 int
@@ -256,9 +256,10 @@ unpackchk(const char *const *argv)
       while ((pkg = pkg_db_iter_next(it))) {
         if (!yettobeunpacked(pkg,&thissect)) continue;
         if (strcasecmp(thissect,se->name)) continue;
-        width -= strlen(pkg->name); width--;
+        width -= strlen(pkg->set->name);
+        width--;
         if (width < 4) { printf(" ..."); break; }
-        printf(" %s",pkg->name);
+        printf(" %s", pkg->set->name);
       }
       pkg_db_iter_free(it);
       putchar('\n');
@@ -434,7 +435,7 @@ predeppackage(const char *const *argv)
       varbuf_end_str(&vb);
       fprintf(stderr, _("dpkg: cannot see how to satisfy pre-dependency:\n %s\n"),vb.buf);
       ohshit(_("cannot satisfy pre-dependencies for %.250s (wanted due to %.250s)"),
-             dep->up->name,startpkg->name);
+             dep->up->set->name, startpkg->set->name);
     }
     pkg->clientdata->istobe= itb_preinstall;
     for (dep= pkg->available.depends; dep; dep= dep->next) {

+ 2 - 2
src/errors.c

@@ -103,11 +103,11 @@ skip_due_to_hold(struct pkginfo *pkg)
     return false;
   if (fc_hold) {
     fprintf(stderr, _("Package %s was on hold, processing it anyway as you requested\n"),
-            pkg->name);
+            pkg->set->name);
     return false;
   }
   printf(_("Package %s is on hold, not touching it.  Use --force-hold to override.\n"),
-         pkg->name);
+         pkg->set->name);
   return true;
 }
 

+ 23 - 14
src/filesdb.c

@@ -84,7 +84,7 @@ pkgadminfile(struct pkginfo *pkg, const char *filetype)
   varbuf_reset(&vb);
   varbuf_add_str(&vb, infodir);
   varbuf_add_char(&vb, '/');
-  varbuf_add_str(&vb, pkg->name);
+  varbuf_add_str(&vb, pkg->set->name);
   varbuf_add_char(&vb, '.');
   varbuf_add_str(&vb, filetype);
   varbuf_end_str(&vb);
@@ -305,12 +305,13 @@ ensure_packagefiles_available(struct pkginfo *pkg)
 
   if (fd==-1) {
     if (errno != ENOENT)
-      ohshite(_("unable to open files list file for package `%.250s'"),pkg->name);
+      ohshite(_("unable to open files list file for package `%.250s'"),
+              pkg->set->name);
     onerr_abort--;
     if (pkg->status != stat_configfiles) {
       if (saidread == 1) putc('\n',stderr);
       warning(_("files list file for package `%.250s' missing, assuming "
-                "package has no files currently installed."), pkg->name);
+                "package has no files currently installed."), pkg->set->name);
     }
     pkg->clientdata->files = NULL;
     pkg->clientdata->fileslistvalid = true;
@@ -321,28 +322,29 @@ ensure_packagefiles_available(struct pkginfo *pkg)
 
    if(fstat(fd, &stat_buf))
      ohshite(_("unable to stat files list file for package '%.250s'"),
-             pkg->name);
+             pkg->set->name);
 
    if (stat_buf.st_size) {
      loaded_list = nfmalloc(stat_buf.st_size);
      loaded_list_end = loaded_list + stat_buf.st_size;
 
     if (fd_read(fd, loaded_list, stat_buf.st_size) < 0)
-      ohshite(_("reading files list for package '%.250s'"), pkg->name);
+      ohshite(_("reading files list for package '%.250s'"), pkg->set->name);
 
     lendp= &pkg->clientdata->files;
     thisline = loaded_list;
     while (thisline < loaded_list_end) {
       if (!(ptr = memchr(thisline, '\n', loaded_list_end - thisline)))
         ohshit(_("files list file for package '%.250s' is missing final newline"),
-               pkg->name);
+               pkg->set->name);
       /* Where to start next time around. */
       nextline = ptr + 1;
       /* Strip trailing ‘/’. */
       if (ptr > thisline && ptr[-1] == '/') ptr--;
       /* Add the file to the list. */
       if (ptr == thisline)
-        ohshit(_("files list file for package `%.250s' contains empty filename"),pkg->name);
+        ohshit(_("files list file for package `%.250s' contains empty filename"),
+               pkg->set->name);
       *ptr = '\0';
       lendp = pkg_files_add_file(pkg, thisline, fnn_nocopy, lendp);
       thisline = nextline;
@@ -350,7 +352,8 @@ ensure_packagefiles_available(struct pkginfo *pkg)
   }
   pop_cleanup(ehflag_normaltidy); /* fd = open() */
   if (close(fd))
-    ohshite(_("error closing files list file for package `%.250s'"),pkg->name);
+    ohshite(_("error closing files list file for package `%.250s'"),
+            pkg->set->name);
 
   onerr_abort--;
 
@@ -515,7 +518,8 @@ write_filelist_except(struct pkginfo *pkg, struct fileinlist *list,
 
   file= fopen(newvb.buf,"w+");
   if (!file)
-    ohshite(_("unable to create updated files list file for package %s"),pkg->name);
+    ohshite(_("unable to create updated files list file for package %s"),
+            pkg->set->name);
   push_cleanup(cu_closestream, ehflag_bombout, NULL, 0, 1, (void *)file);
   while (list) {
     if (!(mask && (list->namenode->flags & mask))) {
@@ -525,16 +529,21 @@ write_filelist_except(struct pkginfo *pkg, struct fileinlist *list,
     list= list->next;
   }
   if (ferror(file))
-    ohshite(_("failed to write to updated files list file for package %s"),pkg->name);
+    ohshite(_("failed to write to updated files list file for package %s"),
+            pkg->set->name);
   if (fflush(file))
-    ohshite(_("failed to flush updated files list file for package %s"),pkg->name);
+    ohshite(_("failed to flush updated files list file for package %s"),
+            pkg->set->name);
   if (fsync(fileno(file)))
-    ohshite(_("failed to sync updated files list file for package %s"),pkg->name);
+    ohshite(_("failed to sync updated files list file for package %s"),
+            pkg->set->name);
   pop_cleanup(ehflag_normaltidy); /* file = fopen() */
   if (fclose(file))
-    ohshite(_("failed to close updated files list file for package %s"),pkg->name);
+    ohshite(_("failed to close updated files list file for package %s"),
+            pkg->set->name);
   if (rename(newvb.buf, listfile))
-    ohshite(_("failed to install updated files list file for package %s"),pkg->name);
+    ohshite(_("failed to install updated files list file for package %s"),
+            pkg->set->name);
 
   dir_sync_path(pkgadmindir());
 

+ 10 - 10
src/help.c

@@ -64,7 +64,7 @@ struct filenamenode *namenodetouse(struct filenamenode *namenode, struct pkginfo
   }
 
   debug(dbg_eachfile,"namenodetouse namenode=`%s' pkg=%s",
-        namenode->name,pkg->name);
+        namenode->name, pkg->set->name);
 
   r=
     (namenode->divert->useinstead && namenode->divert->pkg != pkg)
@@ -74,7 +74,7 @@ struct filenamenode *namenodetouse(struct filenamenode *namenode, struct pkginfo
         "namenodetouse ... useinstead=%s camefrom=%s pkg=%s return %s",
         namenode->divert->useinstead ? namenode->divert->useinstead->name : "<none>",
         namenode->divert->camefrom ? namenode->divert->camefrom->name : "<none>",
-        namenode->divert->pkg ? namenode->divert->pkg->name : "<none>",
+        namenode->divert->pkg ? namenode->divert->pkg->set->name : "<none>",
         r->name);
 
   return r;
@@ -269,7 +269,7 @@ do_script(struct pkginfo *pkg, struct pkgbin *pif,
 
   pid = subproc_fork();
   if (pid == 0) {
-    if (setenv("DPKG_MAINTSCRIPT_PACKAGE", pkg->name, 1) ||
+    if (setenv("DPKG_MAINTSCRIPT_PACKAGE", pkg->set->name, 1) ||
         setenv("DPKG_MAINTSCRIPT_ARCH", pif->arch->name, 1) ||
         setenv("DPKG_MAINTSCRIPT_NAME", cmd->argv[0], 1) ||
         setenv("DPKG_RUNNING_VERSION", PACKAGE_VERSION, 1))
@@ -474,13 +474,13 @@ dir_has_conffiles(struct filenamenode *file, struct pkginfo *pkg)
   size_t namelen;
 
   debug(dbg_veryverbose, "dir_has_conffiles '%s' (from %s)", file->name,
-	pkg->name);
+        pkg->set->name);
   namelen = strlen(file->name);
   for (conff= pkg->installed.conffiles; conff; conff= conff->next) {
       if (strncmp(file->name, conff->name, namelen) == 0 &&
           conff->name[namelen] == '/') {
 	debug(dbg_veryverbose, "directory %s has conffile %s from %s",
-	      file->name, conff->name, pkg->name);
+	      file->name, conff->name, pkg->set->name);
 	return true;
       }
   }
@@ -499,12 +499,12 @@ dir_is_used_by_others(struct filenamenode *file, struct pkginfo *pkg)
   struct pkginfo *other_pkg;
 
   debug(dbg_veryverbose, "dir_is_used_by_others '%s' (except %s)", file->name,
-        pkg ? pkg->name : "<none>");
+        pkg ? pkg->set->name : "<none>");
 
   iter = filepackages_iter_new(file);
   while ((other_pkg = filepackages_iter_next(iter))) {
     debug(dbg_veryverbose, "dir_is_used_by_others considering %s ...",
-          other_pkg->name);
+          other_pkg->set->name);
     if (other_pkg == pkg)
       continue;
 
@@ -528,7 +528,7 @@ dir_is_used_by_pkg(struct filenamenode *file, struct pkginfo *pkg,
   size_t namelen;
 
   debug(dbg_veryverbose, "dir_is_used_by_pkg '%s' (by %s)",
-        file->name, pkg ? pkg->name : "<none>");
+        file->name, pkg ? pkg->set->name : "<none>");
 
   namelen = strlen(file->name);
 
@@ -625,8 +625,8 @@ void ensure_pathname_nonexisting(const char *pathname) {
 }
 
 void log_action(const char *action, struct pkginfo *pkg) {
-  log_message("%s %s %s %s", action, pkg->name,
+  log_message("%s %s %s %s", action, pkg->set->name,
 	      versiondescribe(&pkg->installed.version, vdew_nonambig),
 	      versiondescribe(&pkg->available.version, vdew_nonambig));
-  statusfd_send("processing: %s: %s", action, pkg->name);
+  statusfd_send("processing: %s: %s", action, pkg->set->name);
 }

+ 2 - 2
src/infodb.c

@@ -86,8 +86,8 @@ pkg_infodb_foreach(struct pkginfo *pkg, pkg_infodb_file_func *func)
 			continue;
 
 		/* Ignore files from other packages. */
-		if (strlen(pkg->name) != (size_t)(dot - db_de->d_name) ||
-		    strncmp(db_de->d_name, pkg->name, dot - db_de->d_name))
+		if (strlen(pkg->set->name) != (size_t)(dot - db_de->d_name) ||
+		    strncmp(db_de->d_name, pkg->set->name, dot - db_de->d_name))
 			continue;
 
 		debug(dbg_stupidlyverbose, "infodb foreach file this pkg");

+ 27 - 27
src/packages.c

@@ -106,8 +106,8 @@ enqueue_specified(const char *const *argv)
 
     pkg = pkg_db_find(thisarg);
     if (pkg->status == stat_notinstalled) {
-      size_t l = strlen(pkg->name);
-      const char *extension = pkg->name + l - sizeof(DEBEXT) + 1;
+      size_t l = strlen(pkg->set->name);
+      const char *extension = pkg->set->name + l - sizeof(DEBEXT) + 1;
 
       if (l >= sizeof(DEBEXT) && strcmp(extension, DEBEXT) == 0)
         badusage(_("you must specify packages by their own names,"
@@ -177,12 +177,12 @@ void process_queue(void) {
       case act_triggers:
       case act_configure: case act_remove: case act_purge:
         printf(_("Package %s listed more than once, only processing once.\n"),
-               rundown->pkg->name);
+               rundown->pkg->set->name);
         break;
       case act_install:
         printf(_("More than one copy of package %s has been unpacked\n"
                " in this run !  Only configuring it once.\n"),
-               rundown->pkg->name);
+               rundown->pkg->set->name);
         break;
       default:
         internerr("unknown action '%d'", cipaction->arg_int);
@@ -224,14 +224,14 @@ void process_queue(void) {
         return;
       continue;
     }
-    push_error_context_jump(&ejbuf, print_error_perpackage, pkg->name);
+    push_error_context_jump(&ejbuf, print_error_perpackage, pkg->set->name);
 
     switch (action_todo) {
     case act_triggers:
       if (!pkg->trigpend_head)
         ohshit(_("package %.250s is not ready for trigger processing\n"
                  " (current status `%.250s' with no pending triggers)"),
-               pkg->name, statusinfos[pkg->status].name);
+               pkg->set->name, statusinfos[pkg->status].name);
       /* Fall through. */
     case act_install:
       /* Don't try to configure pkgs that we've just disappeared. */
@@ -332,10 +332,10 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
     if (providing) {
       varbuf_printf(oemsgs,
                     _("  Package %s which provides %s is to be removed.\n"),
-                    possdependee->name, providing->name);
+                    possdependee->set->name, providing->set->name);
     } else {
       varbuf_printf(oemsgs, _("  Package %s is to be removed.\n"),
-                    possdependee->name);
+                    possdependee->set->name);
     }
 
     *matched = true;
@@ -352,7 +352,7 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
   case stat_installed:
     if (checkversion && !versionsatisfied(&possdependee->installed,checkversion)) {
       varbuf_printf(oemsgs, _("  Version of %s on system is %s.\n"),
-                    possdependee->name,
+                    possdependee->set->name,
                     versiondescribe(&possdependee->installed.version,
                                     vdew_nonambig));
       assert(checkversion->verrel != dvr_none);
@@ -374,11 +374,11 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
         if (providing) {
           varbuf_printf(oemsgs,
                         _("  Package %s which provides %s awaits trigger processing.\n"),
-                        possdependee->name, providing->name);
+                        possdependee->set->name, providing->set->name);
         } else {
           varbuf_printf(oemsgs,
                         _("  Package %s awaits trigger processing.\n"),
-                        possdependee->name);
+                        possdependee->set->name);
         }
         debug(dbg_depcondetail, "      triggers-awaited, no fixbytrig");
         goto unsuitable;
@@ -396,7 +396,7 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
       *fixbytrig = possdependee->trigaw.head->pend;
       debug(dbg_depcondetail,
             "      triggers-awaited, fixbytrig '%s', defer",
-            (*fixbytrig)->name);
+            (*fixbytrig)->set->name);
       return found_defer;
     }
     if (possdependee->clientdata &&
@@ -408,7 +408,7 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
                !(possdependee->status == stat_halfconfigured)) {
       fprintf(stderr,
               _("dpkg: also configuring `%s' (required by `%s')\n"),
-              possdependee->name, requiredby->name);
+              possdependee->set->name, requiredby->set->name);
       add_to_queue(possdependee);
       sincenothing = 0;
       return found_defer;
@@ -416,10 +416,10 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
       if (providing) {
         varbuf_printf(oemsgs,
                       _("  Package %s which provides %s is not configured yet.\n"),
-                      possdependee->name, providing->name);
+                      possdependee->set->name, providing->set->name);
       } else {
         varbuf_printf(oemsgs, _("  Package %s is not configured yet.\n"),
-                      possdependee->name);
+                      possdependee->set->name);
       }
 
       debug(dbg_depcondetail, "      not configured/able");
@@ -430,10 +430,10 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
     if (providing) {
       varbuf_printf(oemsgs,
                     _("  Package %s which provides %s is not installed.\n"),
-                    possdependee->name, providing->name);
+                    possdependee->set->name, providing->set->name);
     } else {
       varbuf_printf(oemsgs, _("  Package %s is not installed.\n"),
-                    possdependee->name);
+                    possdependee->set->name);
     }
 
     debug(dbg_depcondetail, "      not installed");
@@ -458,7 +458,7 @@ breaks_check_one(struct varbuf *aemsgs, enum dep_check *ok,
   struct varbuf depmsg = VARBUF_INIT;
 
   debug(dbg_depcondetail, "      checking breaker %s virtbroken %s",
-        breaker->name, virtbroken ? virtbroken->name : "<none>");
+        breaker->set->name, virtbroken ? virtbroken->set->name : "<none>");
 
   if (breaker->status == stat_notinstalled ||
       breaker->status == stat_configfiles) return;
@@ -469,18 +469,18 @@ breaks_check_one(struct varbuf *aemsgs, enum dep_check *ok,
 
   varbufdependency(&depmsg, breaks->up);
   varbuf_end_str(&depmsg);
-  varbuf_printf(aemsgs, _(" %s (%s) breaks %s and is %s.\n"), breaker->name,
+  varbuf_printf(aemsgs, _(" %s (%s) breaks %s and is %s.\n"), breaker->set->name,
                 versiondescribe(&breaker->installed.version, vdew_nonambig),
                 depmsg.buf, gettext(statusstrings[breaker->status]));
   varbuf_destroy(&depmsg);
 
   if (virtbroken) {
-    varbuf_printf(aemsgs, _("  %s (%s) provides %s.\n"), broken->name,
+    varbuf_printf(aemsgs, _("  %s (%s) provides %s.\n"), broken->set->name,
                   versiondescribe(&broken->installed.version, vdew_nonambig),
-                  virtbroken->name);
+                  virtbroken->set->name);
   } else if (breaks->verrel != dvr_none) {
     varbuf_printf(aemsgs, _("  Version of %s to be configured is %s.\n"),
-                  broken->name,
+                  broken->set->name,
                   versiondescribe(&broken->installed.version, vdew_nonambig));
     if (fc_dependsversion) return;
   }
@@ -516,7 +516,7 @@ breakses_ok(struct pkginfo *pkg, struct varbuf *aemsgs)
   for (dep= pkg->installed.depends; dep; dep= dep->next) {
     if (dep->type != dep_provides) continue;
     virtbroken = &dep->list->ed->pkg;
-    debug(dbg_depcondetail, "     checking virtbroken %s", virtbroken->name);
+    debug(dbg_depcondetail, "     checking virtbroken %s", virtbroken->set->name);
     breaks_check_target(aemsgs, &ok, pkg, virtbroken, virtbroken);
   }
   return ok;
@@ -543,7 +543,7 @@ dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
   interestingwarnings= 0;
   ok = dep_check_ok;
   debug(dbg_depcon,"checking dependencies of %s (- %s)",
-        pkg->name, removing ? removing->name : "<none>");
+        pkg->set->name, removing ? removing->set->name : "<none>");
 
   anycannotfixbytrig = false;
   canfixbytrig = NULL;
@@ -572,7 +572,7 @@ dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
           if (provider->up->type != dep_provides)
             continue;
           debug(dbg_depcondetail, "     checking provider %s",
-                provider->up->up->name);
+                provider->up->up->set->name);
           thisf = deppossi_ok_found(provider->up->up, pkg, removing,
                                     &possi->ed->pkg,
                                     &possfixbytrig, &matched, NULL,
@@ -585,7 +585,7 @@ dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
       if (thisf > found) found= thisf;
     }
     debug(dbg_depcondetail, "  found %d matched %d possfixbytrig %s",
-          found, matched, possfixbytrig ? possfixbytrig->name : "-");
+          found, matched, possfixbytrig ? possfixbytrig->set->name : "-");
     if (removing && !matched) continue;
     switch (found) {
     case found_none:
@@ -593,7 +593,7 @@ dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
       ok = dep_check_halt;
     case found_forced:
       varbuf_add_str(aemsgs, " ");
-      varbuf_add_str(aemsgs, pkg->name);
+      varbuf_add_str(aemsgs, pkg->set->name);
       varbuf_add_str(aemsgs, _(" depends on "));
       varbufdependency(aemsgs, dep);
       if (interestingwarnings) {

+ 28 - 24
src/processarc.c

@@ -202,7 +202,8 @@ void
 push_conflictor(struct pkginfo *pkg, struct pkginfo *pkg_fixbyrm)
 {
   if (cflict_index >= MAXCONFLICTORS)
-    ohshit(_("package %s has too many Conflicts/Replaces pairs"), pkg->name);
+    ohshit(_("package %s has too many Conflicts/Replaces pairs"),
+           pkg->set->name);
 
   conflictor[cflict_index++] = pkg_fixbyrm;
 }
@@ -323,7 +324,7 @@ pkg_infodb_update(struct pkginfo *pkg, char *cidir, char *cidirrest)
       continue;
     }
     if (strcmp(de->d_name, LISTFILE) == 0) {
-      warning(_("package %s contained list as info file"), pkg->name);
+      warning(_("package %s contained list as info file"), pkg->set->name);
       continue;
     }
 
@@ -366,15 +367,15 @@ static void
 pkg_disappear(struct pkginfo *pkg, struct pkginfo *infavour)
 {
   printf(_("(Noting disappearance of %s, which has been completely replaced.)\n"),
-         pkg->name);
+         pkg->set->name);
   log_action("disappear", pkg);
-  debug(dbg_general, "pkg_disappear disappearing %s", pkg->name);
+  debug(dbg_general, "pkg_disappear disappearing %s", pkg->set->name);
 
   trig_activate_packageprocessing(pkg);
   maintainer_script_installed(pkg, POSTRMFILE,
                               "post-removal script (for disappearance)",
                               "disappear",
-                              infavour->name,
+                              infavour->set->name,
                               versiondescribe(&infavour->available.version,
                                               vdew_nonambig),
                               NULL);
@@ -491,7 +492,7 @@ void process_archive(const char *filename) {
   pkg->files->size = psize;
 
   if (cipaction->arg_int == act_avail) {
-    printf(_("Recorded info about %s from %s.\n"),pkg->name,pfilename);
+    printf(_("Recorded info about %s from %s.\n"), pkg->set->name, pfilename);
     pop_cleanup(ehflag_normaltidy);
     return;
   }
@@ -555,9 +556,10 @@ void process_archive(const char *filename) {
         } else {
           varbuf_end_str(&depprobwhy);
           fprintf(stderr, _("dpkg: regarding %s containing %s, pre-dependency problem:\n%s"),
-                  pfilename, pkg->name, depprobwhy.buf);
+                  pfilename, pkg->set->name, depprobwhy.buf);
           if (!force_depends(dsearch->list))
-            ohshit(_("pre-dependency problem - not installing %.250s"),pkg->name);
+            ohshit(_("pre-dependency problem - not installing %.250s"),
+                   pkg->set->name);
           warning(_("ignoring pre-dependency problem!"));
         }
       }
@@ -575,12 +577,12 @@ void process_archive(const char *filename) {
 
   if (pkg->status != stat_notinstalled && pkg->status != stat_configfiles) {
     printf(_("Preparing to replace %s %s (using %s) ...\n"),
-           pkg->name,
+           pkg->set->name,
            versiondescribe(&pkg->installed.version,vdew_nonambig),
            pfilename);
     log_action("upgrade", pkg);
   } else {
-    printf(_("Unpacking %s (from %s) ...\n"),pkg->name,pfilename);
+    printf(_("Unpacking %s (from %s) ...\n"), pkg->set->name, pfilename);
     log_action("install", pkg);
   }
 
@@ -636,17 +638,17 @@ void process_archive(const char *filename) {
       while ((otherpkg = filepackages_iter_next(iter))) {
         debug(dbg_conffdetail,
               "process_archive conffile `%s' in package %s - conff ?",
-              newconff->namenode->name, otherpkg->name);
+              newconff->namenode->name, otherpkg->set->name);
         for (searchconff = otherpkg->installed.conffiles;
              searchconff && strcmp(newconff->namenode->name, searchconff->name);
              searchconff = searchconff->next)
           debug(dbg_conffdetail,
                 "process_archive conffile `%s' in package %s - conff ? not `%s'",
-                newconff->namenode->name, otherpkg->name, searchconff->name);
+                newconff->namenode->name, otherpkg->set->name, searchconff->name);
         if (searchconff) {
           debug(dbg_conff,
                 "process_archive conffile `%s' package=%s %s hash=%s",
-                newconff->namenode->name, otherpkg->name,
+                newconff->namenode->name, otherpkg->set->name,
                 otherpkg == pkg ? "same" : "different!",
                 searchconff->hash);
           if (otherpkg == pkg)
@@ -710,9 +712,9 @@ void process_archive(const char *filename) {
 
     if (removing)
       printf(_("De-configuring %s, to allow removal of %s ...\n"),
-             deconpil->pkg->name, removing->name);
+             deconpil->pkg->set->name, removing->set->name);
     else
-      printf(_("De-configuring %s ...\n"), deconpil->pkg->name);
+      printf(_("De-configuring %s ...\n"), deconpil->pkg->set->name);
 
     trig_activate_packageprocessing(deconpil->pkg);
     deconpil->pkg->status= stat_halfconfigured;
@@ -727,16 +729,16 @@ void process_archive(const char *filename) {
 
     if (removing) {
       maintainer_script_installed(deconpil->pkg, PRERMFILE, "pre-removal",
-                                  "deconfigure", "in-favour", pkg->name,
+                                  "deconfigure", "in-favour", pkg->set->name,
                                   versiondescribe(&pkg->available.version,
                                                   vdew_nonambig),
-                                  "removing", removing->name,
+                                  "removing", removing->set->name,
                                   versiondescribe(&removing->installed.version,
                                                   vdew_nonambig),
                                   NULL);
     } else {
       maintainer_script_installed(deconpil->pkg, PRERMFILE, "pre-removal",
-                                  "deconfigure", "in-favour", pkg->name,
+                                  "deconfigure", "in-favour", pkg->set->name,
                                   versiondescribe(&pkg->available.version,
                                                   vdew_nonambig),
                                   NULL);
@@ -754,7 +756,7 @@ void process_archive(const char *filename) {
     push_cleanup(cu_prerminfavour, ~ehflag_normaltidy, NULL, 0,
                  2,(void*)conflictor[i],(void*)pkg);
     maintainer_script_installed(conflictor[i], PRERMFILE, "pre-removal",
-                                "remove", "in-favour", pkg->name,
+                                "remove", "in-favour", pkg->set->name,
                                 versiondescribe(&pkg->available.version,
                                                 vdew_nonambig),
                                 NULL);
@@ -786,7 +788,7 @@ void process_archive(const char *filename) {
                           "upgrade", versiondescribe(&pkg->installed.version,
                                                      vdew_nonambig),
                           NULL);
-    printf(_("Unpacking replacement %.250s ...\n"),pkg->name);
+    printf(_("Unpacking replacement %.250s ...\n"), pkg->set->name);
   }
 
   /*
@@ -1181,7 +1183,8 @@ void process_archive(const char *filename) {
         otherpkg->status == stat_configfiles ||
 	otherpkg->clientdata->istobe == itb_remove ||
         !otherpkg->clientdata->files) continue;
-    debug(dbg_veryverbose, "process_archive checking disappearance %s",otherpkg->name);
+    debug(dbg_veryverbose, "process_archive checking disappearance %s",
+          otherpkg->set->name);
     assert(otherpkg->clientdata->istobe == itb_normal ||
            otherpkg->clientdata->istobe == itb_deconfigure);
     for (cfile= otherpkg->clientdata->files;
@@ -1263,7 +1266,7 @@ void process_archive(const char *filename) {
       } else {
         debug(dbg_eachfile,
               "process_archive looking for overwriting `%s' (overridden by %s)",
-              cfile->namenode->name, divpkg ? divpkg->name : "<local>");
+              cfile->namenode->name, divpkg ? divpkg->set->name : "<local>");
       }
     } else {
       divpkg = NULL;
@@ -1272,7 +1275,8 @@ void process_archive(const char *filename) {
     }
     iter = filepackages_iter_new(cfile->namenode);
     while ((otherpkg = filepackages_iter_next(iter))) {
-      debug(dbg_eachfiledetail, "process_archive ... found in %s", otherpkg->name);
+      debug(dbg_eachfiledetail, "process_archive ... found in %s",
+            otherpkg->set->name);
       /* If !fileslistvalid then it's one of the disappeared packages above
        * and we don't bother with it here, clearly. */
       if (otherpkg == pkg || !otherpkg->clientdata->fileslistvalid)
@@ -1288,7 +1292,7 @@ void process_archive(const char *filename) {
       write_filelist_except(otherpkg, otherpkg->clientdata->files,
                             fnnf_elide_other_lists);
       ensure_package_clientdata(otherpkg);
-      debug(dbg_veryverbose, "process_archive overwrote from %s", otherpkg->name);
+      debug(dbg_veryverbose, "process_archive overwrote from %s", otherpkg->set->name);
     }
     filepackages_iter_free(iter);
   }

+ 14 - 13
src/querycmd.c

@@ -102,7 +102,7 @@ list_format_init(struct list_format *fmt, struct pkg_array *array)
     for (i = 0; i < array->n_pkgs; i++) {
       int plen, vlen, dlen;
 
-      plen = strlen(array->pkgs[i]->name);
+      plen = strlen(array->pkgs[i]->set->name);
       vlen = strlen(versiondescribe(&array->pkgs[i]->installed.version,
                                     vdew_nonambig));
       pkg_summary(array->pkgs[i], &dlen);
@@ -190,7 +190,7 @@ list1package(struct pkginfo *pkg, struct list_format *fmt, struct pkg_array *arr
          "uihrp"[pkg->want],
          "ncHUFWti"[pkg->status],
          " R"[pkg->eflag],
-         pkg->name,
+         pkg->set->name,
          versiondescribe(&pkg->installed.version, vdew_nonambig),
          l, pdesc);
 }
@@ -231,7 +231,7 @@ listpackages(const char *const *argv)
     for (i = 0; i < array.n_pkgs; i++) {
       pkg = array.pkgs[i];
       for (ip = 0; ip < argc; ip++) {
-        if (!fnmatch(argv[ip], pkg->name, 0)) {
+        if (!fnmatch(argv[ip], pkg->set->name, 0)) {
           list1package(pkg, &fmt, &array);
           found[ip]++;
           break;
@@ -271,9 +271,9 @@ static int searchoutput(struct filenamenode *namenode) {
 
     if (namenode->divert->pkg) {
       printf(_("diversion by %s from: %s\n"),
-             namenode->divert->pkg->name, name_from);
+             namenode->divert->pkg->set->name, name_from);
       printf(_("diversion by %s to: %s\n"),
-             namenode->divert->pkg->name, name_to);
+             namenode->divert->pkg->set->name, name_to);
     } else {
       printf(_("local diversion from: %s\n"), name_from);
       printf(_("local diversion to: %s\n"), name_to);
@@ -285,7 +285,7 @@ static int searchoutput(struct filenamenode *namenode) {
   while ((pkg_owner = filepackages_iter_next(iter))) {
     if (found)
       fputs(", ", stdout);
-    fputs(pkg_owner->name, stdout);
+    fputs(pkg_owner->set->name, stdout);
     found++;
   }
   filepackages_iter_free(iter);
@@ -390,7 +390,7 @@ enqperpackage(const char *const *argv)
           !pkg->files &&
           pkg->want == want_unknown &&
           !pkg_is_informative(pkg, &pkg->installed)) {
-        fprintf(stderr,_("Package `%s' is not installed and no info is available.\n"),pkg->name);
+        fprintf(stderr, _("Package `%s' is not installed and no info is available.\n"), pkg->set->name);
         failures++;
       } else {
         writerecord(stdout, _("<standard output>"), pkg, &pkg->installed);
@@ -398,7 +398,7 @@ enqperpackage(const char *const *argv)
       break;
     case act_printavail:
       if (!pkg_is_informative(pkg, &pkg->available)) {
-        fprintf(stderr,_("Package `%s' is not available.\n"),pkg->name);
+        fprintf(stderr, _("Package `%s' is not available.\n"), pkg->set->name);
         failures++;
       } else {
         writerecord(stdout, _("<standard output>"), pkg, &pkg->available);
@@ -407,7 +407,7 @@ enqperpackage(const char *const *argv)
     case act_listfiles:
       switch (pkg->status) {
       case stat_notinstalled:
-        fprintf(stderr,_("Package `%s' is not installed.\n"),pkg->name);
+        fprintf(stderr, _("Package `%s' is not installed.\n"), pkg->set->name);
         failures++;
         break;
       default:
@@ -415,7 +415,8 @@ enqperpackage(const char *const *argv)
         ensure_diversions();
         file= pkg->clientdata->files;
         if (!file) {
-          printf(_("Package `%s' does not contain any files (!)\n"),pkg->name);
+          printf(_("Package `%s' does not contain any files (!)\n"),
+                 pkg->set->name);
         } else {
           while (file) {
             namenode= file->namenode;
@@ -429,7 +430,7 @@ enqperpackage(const char *const *argv)
 		       namenode->divert->useinstead->name);
               else
 		printf(_("diverted by %s to: %s\n"),
-		       namenode->divert->pkg->name,
+		       namenode->divert->pkg->set->name,
 		       namenode->divert->useinstead->name);
             }
             file= file->next;
@@ -496,7 +497,7 @@ showpackages(const char *const *argv)
     for (i = 0; i < array.n_pkgs; i++) {
       pkg = array.pkgs[i];
       for (ip = 0; ip < argc; ip++) {
-        if (!fnmatch(argv[ip], pkg->name, 0)) {
+        if (!fnmatch(argv[ip], pkg->set->name, 0)) {
           pkg_format_show(fmt, pkg, &pkg->installed);
           found[ip]++;
           break;
@@ -582,7 +583,7 @@ control_path(const char *const *argv)
 
   pkg = pkg_db_find(pkg_name);
   if (pkg->status == stat_notinstalled)
-    ohshit(_("Package `%s' is not installed.\n"), pkg->name);
+    ohshit(_("Package `%s' is not installed.\n"), pkg->set->name);
 
   if (control_file)
     control_path_file(pkg, control_file);

+ 15 - 15
src/remove.c

@@ -57,13 +57,13 @@ static void checkforremoval(struct pkginfo *pkgtoremove,
   for (possi = pkgdepcheck->set->depended.installed; possi; possi = possi->rev_next) {
     if (possi->up->type != dep_depends && possi->up->type != dep_predepends) continue;
     depender= possi->up->up;
-    debug(dbg_depcon,"checking depending package `%s'",depender->name);
+    debug(dbg_depcon, "checking depending package `%s'", depender->set->name);
     if (!(depender->status == stat_installed ||
           depender->status == stat_triggerspending ||
           depender->status == stat_triggersawaited))
       continue;
     if (ignore_depends(depender)) {
-      debug(dbg_depcon, "ignoring depending package '%s'", depender->name);
+      debug(dbg_depcon, "ignoring depending package '%s'", depender->set->name);
       continue;
     }
     if (dependtry > 1) { if (findbreakcycle(pkgtoremove)) sincenothing= 0; }
@@ -82,11 +82,11 @@ void deferred_remove(struct pkginfo *pkg) {
   int rok;
   struct dependency *dep;
 
-  debug(dbg_general,"deferred_remove package %s",pkg->name);
+  debug(dbg_general, "deferred_remove package %s", pkg->set->name);
 
   if (pkg->status == stat_notinstalled) {
     warning(_("ignoring request to remove %.250s which isn't installed."),
-            pkg->name);
+            pkg->set->name);
     pkg->clientdata->istobe= itb_normal;
     return;
   } else if (!f_pending &&
@@ -94,7 +94,7 @@ void deferred_remove(struct pkginfo *pkg) {
              cipaction->arg_int != act_purge) {
     warning(_("ignoring request to remove %.250s, only the config\n"
               " files of which are on the system. Use --purge to remove them too."),
-            pkg->name);
+            pkg->set->name);
     pkg->clientdata->istobe= itb_normal;
     return;
   }
@@ -107,7 +107,7 @@ void deferred_remove(struct pkginfo *pkg) {
     pkg->want = (cipaction->arg_int == act_purge) ? want_purge : want_deinstall;
   if (!f_noact) modstatdb_note(pkg);
 
-  debug(dbg_general,"checking dependencies for remove `%s'",pkg->name);
+  debug(dbg_general, "checking dependencies for remove `%s'", pkg->set->name);
   rok= 2;
   checkforremoval(pkg,pkg,&rok,&raemsgs);
   for (dep= pkg->installed.depends; dep; dep= dep->next) {
@@ -126,13 +126,13 @@ void deferred_remove(struct pkginfo *pkg) {
     varbuf_end_str(&raemsgs);
     fprintf(stderr,
             _("dpkg: dependency problems prevent removal of %s:\n%s"),
-            pkg->name, raemsgs.buf);
+            pkg->set->name, raemsgs.buf);
     ohshit(_("dependency problems - not removing"));
   } else if (raemsgs.used) {
     varbuf_end_str(&raemsgs);
     fprintf(stderr,
             _("dpkg: %s: dependency problems, but removing anyway as you requested:\n%s"),
-            pkg->name, raemsgs.buf);
+            pkg->set->name, raemsgs.buf);
   }
   varbuf_destroy(&raemsgs);
   sincenothing= 0;
@@ -146,7 +146,7 @@ void deferred_remove(struct pkginfo *pkg) {
   filesdbinit();
 
   if (f_noact) {
-    printf(_("Would remove or purge %s ...\n"),pkg->name);
+    printf(_("Would remove or purge %s ...\n"), pkg->set->name);
     pkg->status= stat_notinstalled;
     pkg->clientdata->istobe= itb_normal;
     return;
@@ -154,7 +154,7 @@ void deferred_remove(struct pkginfo *pkg) {
 
   oldconffsetflags(pkg->installed.conffiles);
 
-  printf(_("Removing %s ...\n"),pkg->name);
+  printf(_("Removing %s ...\n"), pkg->set->name);
   log_action("remove", pkg);
   trig_activate_packageprocessing(pkg);
   if (pkg->status >= stat_halfconfigured) {
@@ -274,7 +274,7 @@ removal_bulk_remove_files(struct pkginfo *pkg)
       } else if (errno == EBUSY || errno == EPERM) {
         warning(_("while removing %.250s, unable to remove directory '%.250s': "
                   "%s - directory may be a mount point?"),
-                pkg->name, namenode->name, strerror(errno));
+                pkg->set->name, namenode->name, strerror(errno));
         push_leftover(&leftover,namenode);
         continue;
       } else if (errno == EINVAL && strcmp(usenode->name, "/.") == 0) {
@@ -359,13 +359,13 @@ static void removal_bulk_remove_leftover_dirs(struct pkginfo *pkg) {
     if (!rmdir(fnvb.buf) || errno == ENOENT || errno == ELOOP) continue;
     if (errno == ENOTEMPTY || errno == EEXIST) {
       warning(_("while removing %.250s, directory '%.250s' not empty so not removed."),
-              pkg->name, namenode->name);
+              pkg->set->name, namenode->name);
       push_leftover(&leftover,namenode);
       continue;
     } else if (errno == EBUSY || errno == EPERM) {
       warning(_("while removing %.250s, unable to remove directory '%.250s': "
                 "%s - directory may be a mount point?"),
-              pkg->name, namenode->name, strerror(errno));
+              pkg->set->name, namenode->name, strerror(errno));
       push_leftover(&leftover,namenode);
       continue;
     } else if (errno == EINVAL && strcmp(usenode->name, "/.") == 0) {
@@ -406,7 +406,7 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) {
   char *p;
   const char *const *ext;
 
-    printf(_("Purging configuration files for %s ...\n"),pkg->name);
+    printf(_("Purging configuration files for %s ...\n"), pkg->set->name);
     log_action("purge", pkg);
     trig_activate_packageprocessing(pkg);
 
@@ -531,7 +531,7 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) {
 void removal_bulk(struct pkginfo *pkg) {
   bool foundpostrm;
 
-  debug(dbg_general,"removal_bulk package %s",pkg->name);
+  debug(dbg_general, "removal_bulk package %s", pkg->set->name);
 
   if (pkg->status == stat_halfinstalled || pkg->status == stat_unpacked) {
     removal_bulk_remove_files(pkg);

+ 9 - 3
src/select.c

@@ -40,8 +40,13 @@ static void getsel1package(struct pkginfo *pkg) {
   int l;
 
   if (pkg->want == want_unknown) return;
-  l= strlen(pkg->name); l >>= 3; l= 6-l; if (l<1) l=1;
-  printf("%s%.*s%s\n",pkg->name,l,"\t\t\t\t\t\t",wantinfos[pkg->want].name);
+  l = strlen(pkg->set->name);
+  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);
 }
 
 int
@@ -68,7 +73,8 @@ getselections(const char *const *argv)
       found= 0;
       for (i = 0; i < array.n_pkgs; i++) {
         pkg = array.pkgs[i];
-        if (fnmatch(thisarg,pkg->name,0)) continue;
+        if (fnmatch(thisarg, pkg->set->name, 0))
+          continue;
         getsel1package(pkg); found++;
       }
       if (!found)

+ 23 - 18
src/trigproc.c

@@ -96,7 +96,7 @@ trigproc_enqueue_deferred(struct pkginfo *pend)
 	if (pend->clientdata->trigprocdeferred)
 		return;
 	pend->clientdata->trigprocdeferred = pkg_queue_push(&deferred, pend);
-	debug(dbg_triggers, "trigproc_enqueue_deferred pend=%s", pend->name);
+	debug(dbg_triggers, "trigproc_enqueue_deferred pend=%s", pend->set->name);
 }
 
 void
@@ -117,7 +117,7 @@ trigproc_run_deferred(void)
 			continue;
 		}
 		push_error_context_jump(&ejbuf, print_error_perpackage,
-		                        pkg->name);
+		                        pkg->set->name);
 
 		pkg->clientdata->trigprocdeferred = NULL;
 		trigproc(pkg);
@@ -133,7 +133,7 @@ void
 trig_activate_packageprocessing(struct pkginfo *pkg)
 {
 	debug(dbg_triggersdetail, "trigproc_activate_packageprocessing pkg=%s",
-	      pkg->name);
+	      pkg->set->name);
 
 	trig_parse_ci(pkgadminfile(pkg, TRIGGERSCIFILE), NULL,
 	              trig_cicb_statuschange_activate, pkg);
@@ -176,7 +176,8 @@ check_trigger_cycle(struct pkginfo *processing_now)
 	struct pkginfo *pkg, *giveup;
 	const char *sep;
 
-	debug(dbg_triggers, "check_triggers_cycle pnow=%s", processing_now->name);
+	debug(dbg_triggers, "check_triggers_cycle pnow=%s",
+	      processing_now->set->name);
 
 	tcn = nfmalloc(sizeof(*tcn));
 	tcn->pkgs = NULL;
@@ -195,7 +196,7 @@ check_trigger_cycle(struct pkginfo *processing_now)
 	pkg_db_iter_free(it);
 	if (!hare) {
 		debug(dbg_triggersdetail, "check_triggers_cycle pnow=%s first",
-		      processing_now->name);
+		      processing_now->set->name);
 		tcn->next = NULL;
 		hare = tortoise = tcn;
 		return NULL;
@@ -216,14 +217,15 @@ check_trigger_cycle(struct pkginfo *processing_now)
 	     tortoise_pkg;
 	     tortoise_pkg = tortoise_pkg->next) {
 		debug(dbg_triggersdetail, "check_triggers_cycle pnow=%s tortoise=%s",
-		      processing_now->name, tortoise_pkg->pkg->name);
+		      processing_now->set->name, tortoise_pkg->pkg->set->name);
 		for (tortoise_trig = tortoise_pkg->then_trigs;
 		     tortoise_trig;
 		     tortoise_trig = tortoise_trig->next) {
 			debug(dbg_triggersdetail,
 			      "check_triggers_cycle pnow=%s tortoise=%s"
-			      " tortoisetrig=%s", processing_now->name,
-			      tortoise_pkg->pkg->name, tortoise_trig->name);
+			      " tortoisetrig=%s", processing_now->set->name,
+			      tortoise_pkg->pkg->set->name,
+			      tortoise_trig->name);
 			/* hare is now so we can just look up in the actual
 			 * data. */
 			for (hare_trig = tortoise_pkg->pkg->trigpend_head;
@@ -232,7 +234,8 @@ check_trigger_cycle(struct pkginfo *processing_now)
 				debug(dbg_triggersstupid,
 				      "check_triggers_cycle pnow=%s tortoise=%s"
 				      " tortoisetrig=%s haretrig=%s",
-				      processing_now->name, tortoise_pkg->pkg->name,
+				      processing_now->set->name,
+				      tortoise_pkg->pkg->set->name,
 				      tortoise_trig->name, hare_trig->name);
 				if (!strcmp(hare_trig->name, tortoise_trig->name))
 					goto found_in_hare;
@@ -240,7 +243,8 @@ check_trigger_cycle(struct pkginfo *processing_now)
 			/* Not found in hare, yay! */
 			debug(dbg_triggersdetail,
 			      "check_triggers_cycle pnow=%s tortoise=%s OK",
-			      processing_now->name, tortoise_pkg->pkg->name);
+			      processing_now->set->name,
+			      tortoise_pkg->pkg->set->name);
 			return NULL;
 			found_in_hare:;
 		}
@@ -252,7 +256,7 @@ check_trigger_cycle(struct pkginfo *processing_now)
 	        dpkg_get_progname());
 	sep = "  ";
 	for (tcn = tortoise; tcn; tcn = tcn->next) {
-		fprintf(stderr, "%s%s", sep, tcn->then_processed->name);
+		fprintf(stderr, "%s%s", sep, tcn->then_processed->set->name);
 		sep = " -> ";
 	}
 	fprintf(stderr, _("\n" " packages' pending triggers which are"
@@ -260,7 +264,7 @@ check_trigger_cycle(struct pkginfo *processing_now)
 	for (tortoise_pkg = tortoise->pkgs;
 	     tortoise_pkg;
 	     tortoise_pkg = tortoise_pkg->next) {
-		fprintf(stderr, "  %s", tortoise_pkg->pkg->name);
+		fprintf(stderr, "  %s", tortoise_pkg->pkg->set->name);
 		sep = ": ";
 		for (tortoise_trig = tortoise_pkg->then_trigs;
 		     tortoise_trig;
@@ -273,12 +277,13 @@ check_trigger_cycle(struct pkginfo *processing_now)
 	/* We give up on the _earliest_ package involved. */
 	giveup = tortoise->pkgs->pkg;
 	debug(dbg_triggers, "check_triggers_cycle pnow=%s giveup=%p",
-	      processing_now->name, giveup->name);
+	      processing_now->set->name, giveup->set->name);
 	assert(giveup->status == stat_triggersawaited ||
 	       giveup->status == stat_triggerspending);
 	giveup->status = stat_halfconfigured;
 	modstatdb_note(giveup);
-	print_error_perpackage(_("triggers looping, abandoned"), giveup->name);
+	print_error_perpackage(_("triggers looping, abandoned"),
+	                       giveup->set->name);
 
 	return giveup;
 }
@@ -295,7 +300,7 @@ trigproc(struct pkginfo *pkg)
 	struct trigpend *tp;
 	struct pkginfo *gaveup;
 
-	debug(dbg_triggers, "trigproc %s", pkg->name);
+	debug(dbg_triggers, "trigproc %s", pkg->set->name);
 
 	if (pkg->clientdata->trigprocdeferred)
 		pkg->clientdata->trigprocdeferred->pkg = NULL;
@@ -309,7 +314,7 @@ trigproc(struct pkginfo *pkg)
 		if (gaveup == pkg)
 			return;
 
-		printf(_("Processing triggers for %s ...\n"), pkg->name);
+		printf(_("Processing triggers for %s ...\n"), pkg->set->name);
 		log_action("trigproc", pkg);
 
 		varbuf_reset(&namesarg);
@@ -352,7 +357,7 @@ transitional_interest_callback_ro(const char *trig, void *user,
 
 	debug(dbg_triggersdetail,
 	      "trig_transitional_interest_callback trig=%s pend=%s",
-	      trig, pend->name);
+	      trig, pend->set->name);
 	if (pend->status >= stat_triggersawaited)
 		trig_note_pend(pend, nfstrsave(trig));
 }
@@ -383,7 +388,7 @@ trig_transitional_activate(enum modstatdb_rw cstatus)
 		if (pkg->status <= stat_halfinstalled)
 			continue;
 		debug(dbg_triggersdetail, "trig_transitional_activate %s %s",
-		      pkg->name, statusinfos[pkg->status].name);
+		      pkg->set->name, statusinfos[pkg->status].name);
 		pkg->trigpend_head = NULL;
 		trig_parse_ci(pkgadminfile(pkg, TRIGGERSCIFILE),
 		              cstatus >= msdbrw_write ?