Просмотр исходного кода

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 <guillem@debian.org>
Raphaël Hertzog лет назад: 15
Родитель
Сommit
3b7d2f98df
3 измененных файлов с 5 добавлено и 5 удалено
  1. 3 3
      lib/dpkg/fields.c
  2. 1 1
      lib/dpkg/parse.c
  3. 1 1
      src/enquiry.c

+ 3 - 3
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

+ 1 - 1
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

+ 1 - 1
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: