The following commit has been merged in the master branch:
commit 3b7d2f98df1f0f206e345786f44ad976e24a46be
Author: Raphaël Hertzog <[email protected]>
Date:   Fri Jan 28 16:40:37 2011 +0100

    Replace most pkg_db_find() calls with its newer counterparts
    
    The occurrences that concern triggers and diversions will be replaced
    in a later commit.
    
    Most of the remaining occurrences in src/* will be replaced in an update
    implementing the parsing of package specifiers in the input.
    
    Sponsored-by: Linaro Limited
    
    Signed-off-by: Guillem Jover <[email protected]>

diff --git a/lib/dpkg/fields.c b/lib/dpkg/fields.c
index 8d6e9bf..506b618 100644
--- a/lib/dpkg/fields.c
+++ b/lib/dpkg/fields.c
@@ -90,8 +90,8 @@ f_name(struct pkginfo *pigp, struct pkgbin *pifp,
   e = pkg_name_is_illegal(value, NULL);
   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->set->name = pkg_db_find(value)->set->name;
+  /* We use the new name, as pkg_db_find_set() may have done a tolower for us. 
*/
+  pigp->set->name = pkg_db_find_set(value)->name;
 }
 
 void
@@ -408,7 +408,7 @@ f_dependency(struct pkginfo *pigp, struct pkgbin *pifp,
                     fip->name, depname.buf, emsg);
       dop= nfmalloc(sizeof(struct deppossi));
       dop->up= dyp;
-      dop->ed = pkg_db_find(depname.buf)->set;
+      dop->ed = pkg_db_find_set(depname.buf);
       dop->next= NULL; *ldopp= dop; ldopp= &dop->next;
 
       /* Don't link this (which is after all only ‘newpig’ from
diff --git a/lib/dpkg/parse.c b/lib/dpkg/parse.c
index 4611356..412de49 100644
--- a/lib/dpkg/parse.c
+++ b/lib/dpkg/parse.c
@@ -559,7 +559,7 @@ int parsedb(const char *filename, enum parsedbflags flags,
 
     pkg_parse_verify(&ps, new_pkg, new_pkgbin);
 
-    db_pkg = pkg_db_find(new_pkg->set->name);
+    db_pkg = pkg_db_find_pkg(new_pkg->set->name, new_pkgbin->arch);
     if (flags & pdb_recordavailable)
       db_pkgbin = &db_pkg->available;
     else
diff --git a/src/enquiry.c b/src/enquiry.c
index 9f2bcc8..2b45db3 100644
--- a/src/enquiry.c
+++ b/src/enquiry.c
@@ -295,7 +295,7 @@ assert_version_support(const char *const *argv,
 
   modstatdb_open(msdbrw_readonly);
 
-  pkg = pkg_db_find("dpkg");
+  pkg = pkg_db_find_pkg("dpkg", NULL);
   switch (pkg->status) {
   case stat_installed:
   case stat_triggerspending:

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to