Method: Debian::AptPkg::PkgCache.provides_count

Defined in:
ext/apt_pkg/pkgcache.cpp

.provides_countInteger?

The number of provided packages. Raise ‘Debian::AptPkg::InitError` when config, system, cache is not configured.

Debian::AptPkg::PkgCache.provides_count # => 69511

Returns:

  • (Integer, nil)

319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'ext/apt_pkg/pkgcache.cpp', line 319

static VALUE
provides_count(VALUE self)
{
  if (!config_system_initialized()) {
    rb_raise(e_mDebianAptPkgInitError, "System not initialized");
  }
  pkgCacheFile CacheFile;
  pkgCache *Cache = CacheFile.GetPkgCache();
  if (Cache == NULL) {
    return Qnil;
  }
  return INT2FIX(Cache->HeaderP->ProvidesCount);
}