浏览代码

Rename pif variables to pkgbin

Guillem Jover 14 年之前
父节点
当前提交
430bcfdb9e
共有 8 个文件被更改,包括 97 次插入93 次删除
  1. 1 3
      lib/dpkg/dpkg-db.h
  2. 45 45
      lib/dpkg/dump.c
  3. 35 29
      lib/dpkg/fields.c
  4. 2 2
      lib/dpkg/parsedump.h
  5. 3 3
      lib/dpkg/pkg-format.c
  6. 1 1
      lib/dpkg/pkg-format.h
  7. 8 8
      src/archives.c
  8. 2 2
      src/help.c

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

@@ -104,8 +104,6 @@ struct filedetails {
  * Node describing a binary package file.
  *
  * This structure holds information contained on each binary package.
- *
- * Note: Usually referred in the code as ‘pif’ for historical reasons.
  */
 struct pkgbin {
   struct dependency *depends;
@@ -269,7 +267,7 @@ void pkgset_blank(struct pkgset *set);
 int pkgset_installed_instances(struct pkgset *set);
 
 void pkg_blank(struct pkginfo *pp);
-void pkgbin_blank(struct pkgbin *pifp);
+void pkgbin_blank(struct pkgbin *pkgbin);
 bool pkg_is_informative(struct pkginfo *pkg, struct pkgbin *info);
 
 struct pkgset *pkg_db_find_set(const char *name);

+ 45 - 45
lib/dpkg/dump.c

@@ -47,7 +47,7 @@
 
 void
 w_name(struct varbuf *vb,
-       const struct pkginfo *pkg, const struct pkgbin *pifp,
+       const struct pkginfo *pkg, const struct pkgbin *pkgbin,
        enum fwriteflags flags, const struct fieldinfo *fip)
 {
   assert(pkg->set->name);
@@ -60,24 +60,24 @@ w_name(struct varbuf *vb,
 
 void
 w_version(struct varbuf *vb,
-          const struct pkginfo *pkg, const struct pkgbin *pifp,
+          const struct pkginfo *pkg, const struct pkgbin *pkgbin,
           enum fwriteflags flags, const struct fieldinfo *fip)
 {
-  if (!dpkg_version_is_informative(&pifp->version))
+  if (!dpkg_version_is_informative(&pkgbin->version))
     return;
   if (flags&fw_printheader)
     varbuf_add_str(vb, "Version: ");
-  varbufversion(vb,&pifp->version,vdew_nonambig);
+  varbufversion(vb, &pkgbin->version, vdew_nonambig);
   if (flags&fw_printheader)
     varbuf_add_char(vb, '\n');
 }
 
 void
 w_configversion(struct varbuf *vb,
-                const struct pkginfo *pkg, const struct pkgbin *pifp,
+                const struct pkginfo *pkg, const struct pkgbin *pkgbin,
                 enum fwriteflags flags, const struct fieldinfo *fip)
 {
-  if (pifp != &pkg->installed)
+  if (pkgbin != &pkg->installed)
     return;
   if (!dpkg_version_is_informative(&pkg->configversion))
     return;
@@ -94,14 +94,14 @@ w_configversion(struct varbuf *vb,
 
 void
 w_null(struct varbuf *vb,
-       const struct pkginfo *pkg, const struct pkgbin *pifp,
+       const struct pkginfo *pkg, const struct pkgbin *pkgbin,
        enum fwriteflags flags, const struct fieldinfo *fip)
 {
 }
 
 void
 w_section(struct varbuf *vb,
-          const struct pkginfo *pkg, const struct pkgbin *pifp,
+          const struct pkginfo *pkg, const struct pkgbin *pkgbin,
           enum fwriteflags flags, const struct fieldinfo *fip)
 {
   const char *value = pkg->section;
@@ -115,10 +115,10 @@ w_section(struct varbuf *vb,
 
 void
 w_charfield(struct varbuf *vb,
-            const struct pkginfo *pkg, const struct pkgbin *pifp,
+            const struct pkginfo *pkg, const struct pkgbin *pkgbin,
             enum fwriteflags flags, const struct fieldinfo *fip)
 {
-  const char *value = PKGPFIELD(pifp, fip->integer, const char *);
+  const char *value = PKGPFIELD(pkgbin, fip->integer, const char *);
   if (!value || !*value) return;
   if (flags&fw_printheader) {
     varbuf_add_str(vb, fip->name);
@@ -131,12 +131,12 @@ w_charfield(struct varbuf *vb,
 
 void
 w_filecharf(struct varbuf *vb,
-            const struct pkginfo *pkg, const struct pkgbin *pifp,
+            const struct pkginfo *pkg, const struct pkgbin *pkgbin,
             enum fwriteflags flags, const struct fieldinfo *fip)
 {
   struct filedetails *fdp;
 
-  if (pifp != &pkg->available)
+  if (pkgbin != &pkg->available)
     return;
   fdp = pkg->files;
   if (!fdp || !FILEFFIELD(fdp,fip->integer,const char*)) return;
@@ -158,10 +158,10 @@ w_filecharf(struct varbuf *vb,
 
 void
 w_booleandefno(struct varbuf *vb,
-               const struct pkginfo *pkg, const struct pkgbin *pifp,
+               const struct pkginfo *pkg, const struct pkgbin *pkgbin,
                enum fwriteflags flags, const struct fieldinfo *fip)
 {
-  bool value = PKGPFIELD(pifp, fip->integer, bool);
+  bool value = PKGPFIELD(pkgbin, fip->integer, bool);
   if (!(flags&fw_printheader)) {
     varbuf_add_str(vb, value ? "yes" : "no");
     return;
@@ -174,10 +174,10 @@ w_booleandefno(struct varbuf *vb,
 
 void
 w_multiarch(struct varbuf *vb,
-            const struct pkginfo *pkg, const struct pkgbin *pifp,
+            const struct pkginfo *pkg, const struct pkgbin *pkgbin,
             enum fwriteflags flags, const struct fieldinfo *fip)
 {
-  int value = PKGPFIELD(pifp, fip->integer, int);
+  int value = PKGPFIELD(pkgbin, fip->integer, int);
 
   if (!(flags & fw_printheader)) {
     varbuf_add_str(vb, multiarchinfos[value].name);
@@ -194,28 +194,28 @@ w_multiarch(struct varbuf *vb,
 
 void
 w_architecture(struct varbuf *vb,
-               const struct pkginfo *pkg, const struct pkgbin *pifp,
+               const struct pkginfo *pkg, const struct pkgbin *pkgbin,
                enum fwriteflags flags, const struct fieldinfo *fip)
 {
-  if (!pifp->arch)
+  if (!pkgbin->arch)
     return;
-  if (pifp->arch->type == arch_none)
+  if (pkgbin->arch->type == arch_none)
     return;
-  if (pifp->arch->type == arch_empty)
+  if (pkgbin->arch->type == arch_empty)
     return;
 
   if (flags & fw_printheader) {
     varbuf_add_str(vb, fip->name);
     varbuf_add_str(vb, ": ");
   }
-  varbuf_add_str(vb, pifp->arch->name);
+  varbuf_add_str(vb, pkgbin->arch->name);
   if (flags & fw_printheader)
     varbuf_add_char(vb, '\n');
 }
 
 void
 w_priority(struct varbuf *vb,
-           const struct pkginfo *pkg, const struct pkgbin *pifp,
+           const struct pkginfo *pkg, const struct pkgbin *pkgbin,
            enum fwriteflags flags, const struct fieldinfo *fip)
 {
   if (pkg->priority == pri_unknown)
@@ -232,10 +232,10 @@ w_priority(struct varbuf *vb,
 
 void
 w_status(struct varbuf *vb,
-         const struct pkginfo *pkg, const struct pkgbin *pifp,
+         const struct pkginfo *pkg, const struct pkgbin *pkgbin,
          enum fwriteflags flags, const struct fieldinfo *fip)
 {
-  if (pifp != &pkg->installed)
+  if (pkgbin != &pkg->installed)
     return;
   assert(pkg->want <= want_purge);
   assert(pkg->eflag <= eflag_reinstreq);
@@ -323,7 +323,7 @@ void varbufdependency(struct varbuf *vb, struct dependency *dep) {
 
 void
 w_dependency(struct varbuf *vb,
-             const struct pkginfo *pkg, const struct pkgbin *pifp,
+             const struct pkginfo *pkg, const struct pkgbin *pkgbin,
              enum fwriteflags flags, const struct fieldinfo *fip)
 {
   char fnbuf[50];
@@ -336,7 +336,7 @@ w_dependency(struct varbuf *vb,
     fnbuf[0] = '\0';
 
   depdel= fnbuf;
-  for (dyp= pifp->depends; dyp; dyp= dyp->next) {
+  for (dyp = pkgbin->depends; dyp; dyp = dyp->next) {
     if (dyp->type != fip->integer) continue;
     assert(dyp->up == pkg);
     varbuf_add_str(vb, depdel);
@@ -349,17 +349,17 @@ w_dependency(struct varbuf *vb,
 
 void
 w_conffiles(struct varbuf *vb,
-            const struct pkginfo *pkg, const struct pkgbin *pifp,
+            const struct pkginfo *pkg, const struct pkgbin *pkgbin,
             enum fwriteflags flags, const struct fieldinfo *fip)
 {
   struct conffile *i;
 
-  if (!pifp->conffiles || pifp == &pkg->available)
+  if (!pkgbin->conffiles || pkgbin == &pkg->available)
     return;
   if (flags&fw_printheader)
     varbuf_add_str(vb, "Conffiles:\n");
-  for (i=pifp->conffiles; i; i= i->next) {
-    if (i != pifp->conffiles)
+  for (i = pkgbin->conffiles; i; i = i->next) {
+    if (i != pkgbin->conffiles)
       varbuf_add_char(vb, '\n');
     varbuf_add_char(vb, ' ');
     varbuf_add_str(vb, i->name);
@@ -374,12 +374,12 @@ w_conffiles(struct varbuf *vb,
 
 void
 w_trigpend(struct varbuf *vb,
-           const struct pkginfo *pkg, const struct pkgbin *pifp,
+           const struct pkginfo *pkg, const struct pkgbin *pkgbin,
            enum fwriteflags flags, const struct fieldinfo *fip)
 {
   struct trigpend *tp;
 
-  if (pifp == &pkg->available || !pkg->trigpend_head)
+  if (pkgbin == &pkg->available || !pkg->trigpend_head)
     return;
 
   assert(pkg->status >= stat_triggersawaited &&
@@ -397,12 +397,12 @@ w_trigpend(struct varbuf *vb,
 
 void
 w_trigaw(struct varbuf *vb,
-         const struct pkginfo *pkg, const struct pkgbin *pifp,
+         const struct pkginfo *pkg, const struct pkgbin *pkgbin,
          enum fwriteflags flags, const struct fieldinfo *fip)
 {
   struct trigaw *ta;
 
-  if (pifp == &pkg->available || !pkg->trigaw.head)
+  if (pkgbin == &pkg->available || !pkg->trigaw.head)
     return;
 
   assert(pkg->status > stat_configfiles &&
@@ -420,15 +420,15 @@ w_trigaw(struct varbuf *vb,
 
 void
 varbufrecord(struct varbuf *vb,
-             const struct pkginfo *pkg, const struct pkgbin *pifp)
+             const struct pkginfo *pkg, const struct pkgbin *pkgbin)
 {
   const struct fieldinfo *fip;
   const struct arbitraryfield *afp;
 
   for (fip= fieldinfos; fip->name; fip++) {
-    fip->wcall(vb, pkg, pifp, fw_printheader, fip);
+    fip->wcall(vb, pkg, pkgbin, fw_printheader, fip);
   }
-  for (afp = pifp->arbs; afp; afp = afp->next) {
+  for (afp = pkgbin->arbs; afp; afp = afp->next) {
     varbuf_add_str(vb, afp->name);
     varbuf_add_str(vb, ": ");
     varbuf_add_str(vb, afp->value);
@@ -438,17 +438,17 @@ varbufrecord(struct varbuf *vb,
 
 void
 writerecord(FILE *file, const char *filename,
-            const struct pkginfo *pkg, const struct pkgbin *pifp)
+            const struct pkginfo *pkg, const struct pkgbin *pkgbin)
 {
   struct varbuf vb = VARBUF_INIT;
 
-  varbufrecord(&vb, pkg, pifp);
+  varbufrecord(&vb, pkg, pkgbin);
   varbuf_end_str(&vb);
   if (fputs(vb.buf,file) < 0) {
     struct varbuf pkgname = VARBUF_INIT;
     int errno_saved = errno;
 
-    varbuf_add_pkgbin_name(&pkgname, pkg, pifp, pnaw_nonambig);
+    varbuf_add_pkgbin_name(&pkgname, pkg, pkgbin, pnaw_nonambig);
 
     errno = errno_saved;
     ohshite(_("failed to write details of `%.50s' to `%.250s'"),
@@ -465,7 +465,7 @@ writedb(const char *filename, enum writedb_flags flags)
 
   struct pkgiterator *it;
   struct pkginfo *pkg;
-  struct pkgbin *pifp;
+  struct pkgbin *pkgbin;
   const char *which;
   struct atomic_file *file;
   struct varbuf vb = VARBUF_INIT;
@@ -479,16 +479,16 @@ writedb(const char *filename, enum writedb_flags flags)
 
   it = pkg_db_iter_new();
   while ((pkg = pkg_db_iter_next_pkg(it)) != NULL) {
-    pifp = (flags & wdb_dump_available) ? &pkg->available : &pkg->installed;
+    pkgbin = (flags & wdb_dump_available) ? &pkg->available : &pkg->installed;
     /* Don't dump records which have no useful content. */
-    if (!pkg_is_informative(pkg, pifp))
+    if (!pkg_is_informative(pkg, pkgbin))
       continue;
-    varbufrecord(&vb, pkg, pifp);
+    varbufrecord(&vb, pkg, pkgbin);
     varbuf_add_char(&vb, '\n');
     varbuf_end_str(&vb);
     if (fputs(vb.buf, file->fp) < 0)
       ohshite(_("failed to write %s database record about '%.50s' to '%.250s'"),
-              which, pkgbin_name(pkg, pifp, pnaw_nonambig), filename);
+              which, pkgbin_name(pkg, pkgbin, pnaw_nonambig), filename);
     varbuf_reset(&vb);
   }
   pkg_db_iter_free(it);

+ 35 - 29
lib/dpkg/fields.c

@@ -82,7 +82,7 @@ parse_nv_last(struct parsedb_state *ps,
 }
 
 void
-f_name(struct pkginfo *pkg, struct pkgbin *pifp,
+f_name(struct pkginfo *pkg, struct pkgbin *pkgbin,
        struct parsedb_state *ps,
        const char *value, const struct fieldinfo *fip)
 {
@@ -96,7 +96,7 @@ f_name(struct pkginfo *pkg, struct pkgbin *pifp,
 }
 
 void
-f_filecharf(struct pkginfo *pkg, struct pkgbin *pifp,
+f_filecharf(struct pkginfo *pkg, struct pkgbin *pkgbin,
             struct parsedb_state *ps,
             const char *value, const struct fieldinfo *fip)
 {
@@ -140,15 +140,16 @@ f_filecharf(struct pkginfo *pkg, struct pkgbin *pifp,
 }
 
 void
-f_charfield(struct pkginfo *pkg, struct pkgbin *pifp,
+f_charfield(struct pkginfo *pkg, struct pkgbin *pkgbin,
             struct parsedb_state *ps,
             const char *value, const struct fieldinfo *fip)
 {
-  if (*value) PKGPFIELD(pifp,fip->integer,char*)= nfstrsave(value);
+  if (*value)
+    PKGPFIELD(pkgbin, fip->integer, char *) = nfstrsave(value);
 }
 
 void
-f_boolean(struct pkginfo *pkg, struct pkgbin *pifp,
+f_boolean(struct pkginfo *pkg, struct pkgbin *pkgbin,
           struct parsedb_state *ps,
           const char *value, const struct fieldinfo *fip)
 {
@@ -159,11 +160,11 @@ f_boolean(struct pkginfo *pkg, struct pkgbin *pifp,
 
   boolean = parse_nv_last(ps, _("yes/no in boolean field"),
                           booleaninfos, value);
-  PKGPFIELD(pifp, fip->integer, bool) = boolean;
+  PKGPFIELD(pkgbin, fip->integer, bool) = boolean;
 }
 
 void
-f_multiarch(struct pkginfo *pkg, struct pkgbin *pifp,
+f_multiarch(struct pkginfo *pkg, struct pkgbin *pkgbin,
             struct parsedb_state *ps,
             const char *value, const struct fieldinfo *fip)
 {
@@ -174,22 +175,22 @@ f_multiarch(struct pkginfo *pkg, struct pkgbin *pifp,
 
   multiarch = parse_nv_last(ps, _("foreign/allowed/same/no in quadstate field"),
                             multiarchinfos, value);
-  PKGPFIELD(pifp, fip->integer, int) = multiarch;
+  PKGPFIELD(pkgbin, fip->integer, int) = multiarch;
 }
 
 void
-f_architecture(struct pkginfo *pkg, struct pkgbin *pifp,
+f_architecture(struct pkginfo *pkg, struct pkgbin *pkgbin,
                struct parsedb_state *ps,
                const char *value, const struct fieldinfo *fip)
 {
-  pifp->arch = dpkg_arch_find(value);
-  if (pifp->arch->type == arch_illegal)
+  pkgbin->arch = dpkg_arch_find(value);
+  if (pkgbin->arch->type == arch_illegal)
     parse_warn(ps, _("'%s' is not a valid architecture name: %s"),
                value, dpkg_arch_name_is_illegal(value));
 }
 
 void
-f_section(struct pkginfo *pkg, struct pkgbin *pifp,
+f_section(struct pkginfo *pkg, struct pkgbin *pkgbin,
           struct parsedb_state *ps,
           const char *value, const struct fieldinfo *fip)
 {
@@ -198,7 +199,7 @@ f_section(struct pkginfo *pkg, struct pkgbin *pifp,
 }
 
 void
-f_priority(struct pkginfo *pkg, struct pkgbin *pifp,
+f_priority(struct pkginfo *pkg, struct pkgbin *pkgbin,
            struct parsedb_state *ps,
            const char *value, const struct fieldinfo *fip)
 {
@@ -210,7 +211,7 @@ f_priority(struct pkginfo *pkg, struct pkgbin *pifp,
 }
 
 void
-f_status(struct pkginfo *pkg, struct pkgbin *pifp,
+f_status(struct pkginfo *pkg, struct pkgbin *pkgbin,
          struct parsedb_state *ps,
          const char *value, const struct fieldinfo *fip)
 {
@@ -229,16 +230,16 @@ f_status(struct pkginfo *pkg, struct pkgbin *pifp,
 }
 
 void
-f_version(struct pkginfo *pkg, struct pkgbin *pifp,
+f_version(struct pkginfo *pkg, struct pkgbin *pkgbin,
           struct parsedb_state *ps,
           const char *value, const struct fieldinfo *fip)
 {
-  parse_db_version(ps, &pifp->version, value,
+  parse_db_version(ps, &pkgbin->version, value,
                    _("error in Version string '%.250s'"), value);
 }
 
 void
-f_revision(struct pkginfo *pkg, struct pkgbin *pifp,
+f_revision(struct pkginfo *pkg, struct pkgbin *pkgbin,
            struct parsedb_state *ps,
            const char *value, const struct fieldinfo *fip)
 {
@@ -247,16 +248,18 @@ f_revision(struct pkginfo *pkg, struct pkgbin *pifp,
   parse_warn(ps,
              _("obsolete `Revision' or `Package-Revision' field used"));
   if (!*value) return;
-  if (pifp->version.revision && *pifp->version.revision) {
-    newversion= nfmalloc(strlen(pifp->version.version)+strlen(pifp->version.revision)+2);
-    sprintf(newversion,"%s-%s",pifp->version.version,pifp->version.revision);
-    pifp->version.version= newversion;
+  if (pkgbin->version.revision && *pkgbin->version.revision) {
+    newversion = nfmalloc(strlen(pkgbin->version.version) +
+                          strlen(pkgbin->version.revision) + 2);
+    sprintf(newversion, "%s-%s", pkgbin->version.version,
+                                 pkgbin->version.revision);
+    pkgbin->version.version = newversion;
   }
-  pifp->version.revision= nfstrsave(value);
+  pkgbin->version.revision = nfstrsave(value);
 }
 
 void
-f_configversion(struct pkginfo *pkg, struct pkgbin *pifp,
+f_configversion(struct pkginfo *pkg, struct pkgbin *pkgbin,
                 struct parsedb_state *ps,
                 const char *value, const struct fieldinfo *fip)
 {
@@ -298,7 +301,7 @@ malformed:
 }
 
 void
-f_conffiles(struct pkginfo *pkg, struct pkgbin *pifp,
+f_conffiles(struct pkginfo *pkg, struct pkgbin *pkgbin,
             struct parsedb_state *ps,
             const char *value, const struct fieldinfo *fip)
 {
@@ -309,7 +312,7 @@ f_conffiles(struct pkginfo *pkg, struct pkgbin *pifp,
   bool obsolete;
   char *newptr;
 
-  lastp= &pifp->conffiles;
+  lastp = &pkgbin->conffiles;
   while (*value) {
     c= *value++;
     if (c == '\n') continue;
@@ -351,7 +354,7 @@ f_conffiles(struct pkginfo *pkg, struct pkgbin *pifp,
 }
 
 void
-f_dependency(struct pkginfo *pkg, struct pkgbin *pifp,
+f_dependency(struct pkginfo *pkg, struct pkgbin *pkgbin,
              struct parsedb_state *ps,
              const char *value, const struct fieldinfo *fip)
 {
@@ -368,7 +371,10 @@ f_dependency(struct pkginfo *pkg, struct pkgbin *pifp,
   if (!*value)
     return;
   p= value;
-  ldypp= &pifp->depends; while (*ldypp) ldypp= &(*ldypp)->next;
+
+  ldypp = &pkgbin->depends;
+  while (*ldypp)
+    ldypp = &(*ldypp)->next;
 
    /* Loop creating new struct dependency's. */
   for (;;) {
@@ -600,7 +606,7 @@ scan_word(const char **valp)
 }
 
 void
-f_trigpend(struct pkginfo *pend, struct pkgbin *pifp,
+f_trigpend(struct pkginfo *pend, struct pkgbin *pkgbin,
            struct parsedb_state *ps,
            const char *value, const struct fieldinfo *fip)
 {
@@ -624,7 +630,7 @@ f_trigpend(struct pkginfo *pend, struct pkgbin *pifp,
 }
 
 void
-f_trigaw(struct pkginfo *aw, struct pkgbin *pifp,
+f_trigaw(struct pkginfo *aw, struct pkgbin *pkgbin,
          struct parsedb_state *ps,
          const char *value, const struct fieldinfo *fip)
 {

+ 2 - 2
lib/dpkg/parsedump.h

@@ -71,12 +71,12 @@ bool parse_stanza(struct parsedb_state *ps, struct field_state *fs,
                   parse_field_func *parse_field, void *parse_obj);
 
 #define PKGIFPOFF(f) (offsetof(struct pkgbin, f))
-#define PKGPFIELD(pifp,of,type) (*(type*)((char*)(pifp)+(of)))
+#define PKGPFIELD(pkgbin, of, type) (*(type *)((char *)(pkgbin) + (of)))
 
 #define FILEFOFF(f) (offsetof(struct filedetails, f))
 #define FILEFFIELD(filedetail,of,type) (*(type*)((char*)(filedetail)+(of)))
 
-typedef void freadfunction(struct pkginfo *pkg, struct pkgbin *pifp,
+typedef void freadfunction(struct pkginfo *pkg, struct pkgbin *pkgbin,
                            struct parsedb_state *ps,
                            const char *value, const struct fieldinfo *fip);
 freadfunction f_name, f_charfield, f_priority, f_section, f_status, f_filecharf;

+ 3 - 3
lib/dpkg/pkg-format.c

@@ -305,7 +305,7 @@ find_field_info(const struct fieldinfo *fields_head,
 
 void
 pkg_format_show(const struct pkg_format_node *head,
-                struct pkginfo *pkg, struct pkgbin *pif)
+                struct pkginfo *pkg, struct pkgbin *pkgbin)
 {
 	struct varbuf vb = VARBUF_INIT, fb = VARBUF_INIT, wb = VARBUF_INIT;
 
@@ -333,7 +333,7 @@ pkg_format_show(const struct pkg_format_node *head,
 				fip = find_field_info(virtinfos, head);
 
 			if (fip->name) {
-				fip->wcall(&wb, pkg, pif, 0, fip);
+				fip->wcall(&wb, pkg, pkgbin, 0, fip);
 
 				varbuf_end_str(&wb);
 				varbuf_printf(&fb, fmt, wb.buf);
@@ -342,7 +342,7 @@ pkg_format_show(const struct pkg_format_node *head,
 			} else {
 				const struct arbitraryfield *afp;
 
-				for (afp = pif->arbs; afp; afp = afp->next)
+				for (afp = pkgbin->arbs; afp; afp = afp->next)
 					if (strcasecmp(head->data, afp->name) == 0) {
 						varbuf_printf(&fb, fmt, afp->value);
 						ok = true;

+ 1 - 1
lib/dpkg/pkg-format.h

@@ -31,7 +31,7 @@ struct pkg_format_node;
 struct pkg_format_node *pkg_format_parse(const char *fmt);
 void pkg_format_free(struct pkg_format_node *head);
 void pkg_format_show(const struct pkg_format_node *head,
-                     struct pkginfo *pkg, struct pkgbin *pif);
+                     struct pkginfo *pkg, struct pkgbin *pkgbin);
 
 DPKG_END_DECLS
 

+ 8 - 8
src/archives.c

@@ -268,25 +268,25 @@ struct pkg_deconf_list *deconfigure = NULL;
 static time_t currenttime;
 
 static int
-does_replace(struct pkginfo *new_pkg, struct pkgbin *newpifp,
-             struct pkginfo *old_pkg, struct pkgbin *oldpifp)
+does_replace(struct pkginfo *new_pkg, struct pkgbin *new_pkgbin,
+             struct pkginfo *old_pkg, struct pkgbin *old_pkgbin)
 {
   struct dependency *dep;
 
   debug(dbg_depcon,"does_replace new=%s old=%s (%s)",
-        pkgbin_name(new_pkg, newpifp, pnaw_always),
-        pkgbin_name(old_pkg, oldpifp, pnaw_always),
-        versiondescribe(&oldpifp->version, vdew_always));
-  for (dep= newpifp->depends; dep; dep= dep->next) {
+        pkgbin_name(new_pkg, new_pkgbin, pnaw_always),
+        pkgbin_name(old_pkg, old_pkgbin, pnaw_always),
+        versiondescribe(&old_pkgbin->version, vdew_always));
+  for (dep = new_pkgbin->depends; dep; dep = dep->next) {
     if (dep->type != dep_replaces || dep->list->ed != old_pkg->set)
       continue;
     debug(dbg_depcondetail,"does_replace ... found old, version %s",
           versiondescribe(&dep->list->version,vdew_always));
-    if (!versionsatisfied(oldpifp, dep->list))
+    if (!versionsatisfied(old_pkgbin, dep->list))
       continue;
     /* The test below can only trigger if dep_replaces start having
      * arch qualifiers different from “any”. */
-    if (!archsatisfied(oldpifp, dep->list))
+    if (!archsatisfied(old_pkgbin, dep->list))
       continue;
     debug(dbg_depcon,"does_replace ... yes");
     return true;

+ 2 - 2
src/help.c

@@ -283,7 +283,7 @@ static void setexecute(const char *path, struct stat *stab) {
 }
 
 static int
-do_script(struct pkginfo *pkg, struct pkgbin *pif,
+do_script(struct pkginfo *pkg, struct pkgbin *pkgbin,
           struct command *cmd, struct stat *stab, int warn)
 {
   pid_t pid;
@@ -296,7 +296,7 @@ do_script(struct pkginfo *pkg, struct pkgbin *pif,
   pid = subproc_fork();
   if (pid == 0) {
     if (setenv("DPKG_MAINTSCRIPT_PACKAGE", pkg->set->name, 1) ||
-        setenv("DPKG_MAINTSCRIPT_ARCH", pif->arch->name, 1) ||
+        setenv("DPKG_MAINTSCRIPT_ARCH", pkgbin->arch->name, 1) ||
         setenv("DPKG_MAINTSCRIPT_NAME", cmd->argv[0], 1) ||
         setenv("DPKG_RUNNING_VERSION", PACKAGE_VERSION, 1))
       ohshite(_("unable to setenv for maintainer script"));