File: load_system_repos.cpp

package info (click to toggle)
dnf5 5.4.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,960 kB
  • sloc: cpp: 94,312; python: 3,370; xml: 1,073; ruby: 600; sql: 250; ansic: 232; sh: 104; perl: 62; makefile: 30
file content (15 lines) | stat: -rw-r--r-- 624 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
auto repo_sack = base.get_repo_sack();

// Create repositories from system configuration files.
repo_sack->create_repos_from_system_configuration();

// Acquire a write lock on the system repository before loading it
base.lock_system_repo(libdnf5::utils::LockAccess::WRITE, libdnf5::utils::LockBlocking::BLOCKING);

// If out of date, downloads fresh repositories' metadata and loads the
// repositories into memory.
//
// load_repos() without any arguments says to load both the @System
// repository (the packages installed on the system, loaded from the rpmdb)
// and the available repositories.
repo_sack->load_repos();