The following commit has been merged in the master branch:
commit 729dcbd9a359a29aca74e6b5e895c9b2960da725
Author: RaphaĆ«l Hertzog <[email protected]>
Date:   Fri Jan 28 17:19:37 2011 +0100

    Replace all pkg_db_count() calls with pkg_db_count_pkg()
    
    Sponsored-by: Linaro Limited
    
    Signed-off-by: Guillem Jover <[email protected]>

diff --git a/dselect/pkglist.cc b/dselect/pkglist.cc
index 809e367..8e5209f 100644
--- a/dselect/pkglist.cc
+++ b/dselect/pkglist.cc
@@ -355,7 +355,7 @@ void packagelist::sortmakeheads() {
 void packagelist::initialsetup() {
   debug(dbg_general, "packagelist[%p]::initialsetup()", this);
 
-  int allpackages = pkg_db_count();
+  int allpackages = pkg_db_count_pkg();
   datatable= new struct perpackagestate[allpackages];
 
   nallocated= allpackages+150; // will realloc if necessary, so 150 not 
critical
diff --git a/lib/dpkg/dpkg-db.h b/lib/dpkg/dpkg-db.h
index c75b0a5..338b89c 100644
--- a/lib/dpkg/dpkg-db.h
+++ b/lib/dpkg/dpkg-db.h
@@ -269,7 +269,6 @@ bool pkg_is_informative(struct pkginfo *pkg, struct pkgbin 
*info);
 struct pkginfo *pkg_db_find(const char *name);
 struct pkgset *pkg_db_find_set(const char *name);
 struct pkginfo *pkg_db_find_pkg(const char *name, const struct dpkg_arch 
*arch);
-int pkg_db_count(void);
 int pkg_db_count_set(void);
 int pkg_db_count_pkg(void);
 void pkg_db_reset(void);
diff --git a/lib/dpkg/libdpkg.Versions b/lib/dpkg/libdpkg.Versions
index 86a4152..b170bde 100644
--- a/lib/dpkg/libdpkg.Versions
+++ b/lib/dpkg/libdpkg.Versions
@@ -221,7 +221,6 @@ LIBDPKG_PRIVATE {
        pkg_db_find;
        pkg_db_find_set;
        pkg_db_find_pkg;
-       pkg_db_count;
        pkg_db_count_set;
        pkg_db_count_pkg;
        pkg_db_reset;
diff --git a/lib/dpkg/pkg-array.c b/lib/dpkg/pkg-array.c
index 20ff02e..30e99e0 100644
--- a/lib/dpkg/pkg-array.c
+++ b/lib/dpkg/pkg-array.c
@@ -42,7 +42,7 @@ pkg_array_init_from_db(struct pkg_array *a)
        struct pkginfo *pkg;
        int i;
 
-       a->n_pkgs = pkg_db_count();
+       a->n_pkgs = pkg_db_count_pkg();
        a->pkgs = m_malloc(sizeof(a->pkgs[0]) * a->n_pkgs);
 
        it = pkg_db_iter_new();
diff --git a/lib/dpkg/pkg-db.c b/lib/dpkg/pkg-db.c
index 2d3f22b..9d00369 100644
--- a/lib/dpkg/pkg-db.c
+++ b/lib/dpkg/pkg-db.c
@@ -152,12 +152,6 @@ pkg_db_count_pkg(void)
   return npkg;
 }
 
-int
-pkg_db_count(void)
-{
-  return nset;
-}
-
 struct pkgiterator {
   struct pkginfo *pigp;
   int nbinn;
diff --git a/src/filesdb.c b/src/filesdb.c
index 2a602a4..f5cd1e8 100644
--- a/src/filesdb.c
+++ b/src/filesdb.c
@@ -461,7 +461,7 @@ void ensure_allinstfiles_available(void) {
 
   if (allpackagesdone) return;
   if (saidread<2) {
-    int max = pkg_db_count();
+    int max = pkg_db_count_pkg();
 
     saidread=1;
     progress_init(&progress, _("(Reading database ... "), max);

-- 
dpkg's main repository


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

Reply via email to