Browse Source

libdpkg: Rename pigp/pifp to db_pkg/db_pkgbin in parsedb()

The names better match reality, and describe this is package information
coming from the database. The previous usage was slightly confusing.
Guillem Jover 15 years ago
parent
commit
6b7ea85f6c
1 changed files with 11 additions and 7 deletions
  1. 11 7
      lib/dpkg/parse.c

+ 11 - 7
lib/dpkg/parse.c

@@ -300,8 +300,8 @@ int parsedb(const char *filename, enum parsedbflags flags,
             struct pkginfo **donep)
             struct pkginfo **donep)
 {
 {
   static int fd;
   static int fd;
-  struct pkginfo newpig, *pigp;
-  struct pkgbin *newpifp, *pifp;
+  struct pkginfo newpig, *db_pkg;
+  struct pkgbin *newpifp, *db_pkgbin;
   int pdone;
   int pdone;
   char *data, *dataptr, *endptr;
   char *data, *dataptr, *endptr;
   struct stat st;
   struct stat st;
@@ -426,16 +426,20 @@ int parsedb(const char *filename, enum parsedbflags flags,
 
 
     pkg_parse_verify(&ps, &newpig, newpifp);
     pkg_parse_verify(&ps, &newpig, newpifp);
 
 
-    pigp = pkg_db_find(newpig.name);
-    pifp= (flags & pdb_recordavailable) ? &pigp->available : &pigp->installed;
+    db_pkg = pkg_db_find(newpig.name);
+    if (flags & pdb_recordavailable)
+      db_pkgbin = &db_pkg->available;
+    else
+      db_pkgbin = &db_pkg->installed;
 
 
     if ((flags & pdb_ignoreolder) &&
     if ((flags & pdb_ignoreolder) &&
-	versioncompare(&newpifp->version, &pifp->version) < 0)
+        versioncompare(&newpifp->version, &db_pkgbin->version) < 0)
       continue;
       continue;
 
 
-    pkg_parse_copy(&ps, pigp, pifp, &newpig, newpifp);
+    pkg_parse_copy(&ps, db_pkg, db_pkgbin, &newpig, newpifp);
 
 
-    if (donep) *donep= pigp;
+    if (donep)
+      *donep = db_pkg;
     pdone++;
     pdone++;
     if (EOF_mmap(dataptr, endptr)) break;
     if (EOF_mmap(dataptr, endptr)) break;
     if (c == '\n')
     if (c == '\n')