Determining Num of packages in db

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is there a way to determine the total number of packages in the rpmdb?
I've been trying variations on the following with no luck.

num =rpmdbCountPackages(db, NULL); 

It's easy to-- 

mi = rpmdbInitIterator(db, RPMDBI_PACKAGES, NULL, 0);
if (mi) {
  while ((h = rpmdbNextIterator(mi)) != NULL)
	num++;
  }

--but it seems pretty inefficient.

Thanks, 
David Farning


_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux