Description of problem: Currently, very little in dnf allows for statistics to be gathered about which packages or modules as user has chosen to install. I'd like to request that an 'install' action in dnf pass this information to the server as part of the request for repository information. In this fashion, a url could be constructed that would gather package information. A hypothetical example repository url for fedora could be: metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch&pkg=$install In this example, $install would be an array containing the names of packages the user requested to install. On update/non-install actions it would be empty and simply ignored in the server logs. This would provide fedora a way to show packagers a rough idea of how many times their package was being installed. Below is a mailing list request from the community for this type of information: https://lists.fedoraproject.org/archives/list/infrastructure@lists.fedoraproject.org/thread/BLUC224OHMHYAWPC3MWJLFUIJZR2COZT/
Fedora Change: https://fedoraproject.org/wiki/Changes/DNF_Better_Counting The change consists of 2 parts: - User-Agent change - countme feature User-Agent ---------- Schemas: libdnf/$libdnf_version ($NAME $VERSION_ID; Linux.$basearch) libdnf/$libdnf_version ($NAME $VERSION_ID; $VARIANT_ID; Linux.$basearch) Examples: libdnf/0.26.0 (Fedora 29; Linux.x86_64) libdnf/0.26.0 (Fedora 29; server; Linux.x86_64) libdnf/0.26.0 (Red Hat Enterprise Linux 7.6; workstation; Linux.x86_64) Countme ------- Add a new 'countme' option to repo configs, for example: [fedora] countme = 1 Create a new dnf sub-command to trigger the countme feature: $ dnf countme Iterate through all repos: if countme == 1: GET($url?countme=1) where $url is first available from [metalink, mirrorlist, baseurl] # consider using HEAD instead of GET Create a systemd timer triggering the `dnf countme` command periodically
Note to (mostly) self on capturing the User-Agent field: 1) Create a local repo (id=myrepo) somewhere on the file system and host it with: $ python -m SimpleHTTPServer & 2) Create /etc/yum.repos.d/myrepo.repo 3) In one terminal, run: # tcpflow -p -c -i lo port 8000 | grep -i user-agent 4) In another terminal, run: # dnf --refresh --disablerepo=\* --enablerepo=myrepo makecache 5) Observe the User-Agent value in the first terminal
Upstream PR: https://github.com/rpm-software-management/libdnf/pull/768
I've also requests the addition "countme=1" to the fedora-repos package: https://bugzilla.redhat.com/show_bug.cgi?id=1737516
*requested