Commit Graph

9708 Commits

Author SHA1 Message Date
Pavla Kratochvilova 87eb5a7a35 remove --oldinstallonly: when no old installonly packages, exit with 0
If no old installonly packages are present, then the command succesfully
removed all of them and should exit with 0 and write the message to
stdout instead of stderr.
2024-04-08 16:11:36 +02:00
Pavla Kratochvilova 720338fed8 remove --duplicates: when no duplicates, exit with 0 (RHEL-6424)
If no duplicates are present, then the command succesfully removed all
duplicates and should exit with 0 and write the message to stdout
instead of stderr.

Resolves: https://issues.redhat.com/browse/RHEL-6424
2024-04-08 16:11:36 +02:00
Jaroslav Rohel caa17e39b4 Do not add user site-packages directory to sys.path (RHEL-26646)
Adds `-s` to shebang lines.
The `-s` flag ensures that the user’s Python packages (e.g. installed by
pip install --user) don’t interfere with the RPM installed software.
According to Fedora Python Packaging Guidelines, the flag is added using
`%py3_shebang_fix` macro.

Note:
DNF supports plugins. There is a risk that the change will break
a custom plugins that require something from PIP.
Therefore, the change is only in the .spec file and is only allowed
for Fedora >= 41 and RHEL >= 10.
2024-04-04 15:40:39 +02:00
Jan Kolarik cb464d4351 man: Prepare pages for dnf5 switch 2024-04-03 11:29:43 +02:00
Evan Goode 9b2b2e8dda Release 4.19.2 2024-03-29 11:38:32 -04:00
Evan Goode e84837bea9 Release 4.19.1 2024-03-28 15:01:12 -04:00
Jan Kolarik 4334ea254a bash-completion: Prepare ownerships for dnf5 switch
Use `dnf-3` and `dnf4` files for bash completion and link the `dnf` only when `dnf5` is not used yet.
2024-03-28 14:04:31 +01:00
Jan Kolarik 75803f54d1 bash-completion: Complete dnf command only if we own it 2024-03-28 14:04:31 +01:00
Stephen Gallagher b7e4766fdc ELN: Don't obsolete DNF with DNF5 yet
Matches https://github.com/rpm-software-management/dnf5/pull/1309 for
 DNF 5.

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2024-03-28 08:43:49 +01:00
Pavla Kratochvilova a6d82221ae doc: Makecache with timer tries only one mirror
Related: https://bugzilla.redhat.com/show_bug.cgi?id=922667
Related: https://issues.redhat.com/browse/RHEL-1342
2024-03-19 09:32:51 +01:00
Nicola Sella 7ce37c7f10 Onboard packit tests 2024-03-18 11:20:17 +01:00
Jaroslav Mracek 929d913397 Update documentation of history userinstalled command
The described behavior differs from current behavior therefore
it might create a confusion.
2024-03-12 09:42:29 +01:00
Jaroslav Mracek a6d4cd745c Remove "leaf" word from documentation
Leaf packages term is not define in documentation and it even
represent different set of packages that are showed by leaves command.

Related: https://issues.redhat.com/browse/RHELDOCS-17711
2024-03-12 09:42:29 +01:00
Jaroslav Mracek 824a95e178 Remove confusing sentence from documentation
Installonly packages are handled by autoremove command in a similar
way like other package.

Resolves: https://issues.redhat.com/browse/RHEL-15902
2024-03-12 09:42:29 +01:00
Jaroslav Mracek a4d815e4df Fix handling installonly packages reasons
The original code took the first item from all remaining packages.
It means a random reason and use it to keep installonly package reason.

Related: https://issues.redhat.com/browse/RHEL-15902
Closes: https://github.com/rpm-software-management/dnf/issues/2061
2024-03-12 08:04:31 +01:00
Jaroslav Mracek 96f8d79c37 Add all candidates for reinstall to solver
Resolves: https://issues.redhat.com/browse/RHEL-25005
2024-03-01 19:00:15 +01:00
Orion Poplawski ee9cc93cf4 Support RPMTRANS_FLAG_DEPLOOPS 2024-02-27 08:56:11 +01:00
Jan Kolarik ec445c17f0 build: Adapt to changes in Fedora packaging of bash-completion
See also https://github.com/rpm-software-management/dnf5/issues/1252.
2024-02-20 17:41:12 +01:00
Jan Kolarik c59f4b2208 doc: Update FAQ entry on filelists
Include information about the automated logic for downloading metadata.
2024-02-19 13:33:32 +01:00
Jan Kolarik fe3742aaae Drop dnf obsoletion temporarily
To allow us and others to prepare for switching dnf5 as the default in Rawhide.
2024-02-19 06:56:27 +01:00
Aleš Matěj 259e4c9d67 Add required `.readthedocs.yaml`, `conf.py` and set `sphinx_rtd_theme`
RTD no longer automatically generates config files.

The `.readthedocs.yaml` is now required: https://blog.readthedocs.com/migrate-configuration-v2/

The `conf.py` for Sphinx is also required: https://blog.readthedocs.com/doctool-without-configuration-file/
- The previously automatically generated `conf.py` contained
  `sphinx_rtd_theme` -> in order to keep it we have to set it and add it
  as a requirement.
- The version field in `conf.py.in` remains uncofigured but I don't
  think it is a problem because it doesn't shows up in the html docs.
2024-02-09 13:25:45 +01:00
Jan Kolarik 1032c2c316 Add 4.19.0 changelog 2024-02-08 15:24:54 +00:00
Jan Kolarik 566a61f9d8 Release 4.19.0 2024-02-08 15:54:49 +01:00
Jan Kolarik ced51201a4 Fix unload plugins behavior without filelists
For packages originating outside the System repository, we don't populate the `pkg.files` when running without filelists metadata. Use RPM database as a source instead.
2024-02-08 13:07:46 +01:00
Evan Goode 0b4b8cc894 automatic: Use add_security_filters, not _update_security_filters
Resolves https://issues.redhat.com/browse/RHEL-21874

It seems that these two approaches for selecting security updates
sometimes disagree. The regular `dnf update` command uses
base.add_security_filters to select security updates, so dnf-automatic
should do the same.
2024-02-05 13:26:13 +01:00
Jan Kolarik f8db3a6609 Add a hint for user on transaction file dependency failure 2024-02-02 12:24:10 +01:00
Jan Kolarik 611e33a3c0 doc: Add FAQ entry about new filelists behavior 2024-02-02 12:22:17 +01:00
Jan Kolarik 57a4fde73d doc: Change optional metadata types default to an empty list
Connected with changes in libdnf and based on the https://fedoraproject.org/wiki/Changes/DNFConditionalFilelists.
2024-02-02 12:22:17 +01:00
Jaroslav Mracek ccb678a88e [Doc] Modify description of deltarpm option
The change reflects the change in libdnf. The patch also describe
a requirement for the option
2024-02-01 09:14:41 +01:00
Jaroslav Mracek 76cbf76d4a Remove Recommends: deltarpm for Fedora 40+
It is a reflection of https://fedoraproject.org/wiki/Changes/Drop_Delta_RPMs
Not installing DeltaRPMs by default on new systems make sence because
using RPM deltas is by default swithed off.

The change will slightly make systems smaller.

DNF workflow - check configuration option `deltarpm` then check whether binary
deltarpm is available, then request repository for deltas.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=2252128
2024-02-01 09:14:41 +01:00
Aleš Matěj 7fc4bb613e Fix failing API unit test on rawhide (RhBug:2261066)
For: https://bugzilla.redhat.com/show_bug.cgi?id=2261066

Fixes:
1: ERROR: test_do_transaction (tests.api.test_dnf_base.DnfBaseApiTest.test_do_transaction)
1: ----------------------------------------------------------------------
1: Traceback (most recent call last):
1:   File "/builddir/build/BUILD/dnf-4.19.0-0.20240130004727.4.18.2+6.g0e400470/tests/api/test_dnf_base.py", line 174, in test_do_transaction
1:     self.base.do_transaction(display=None)
1:   File "/builddir/build/BUILD/dnf-4.19.0-0.20240130004727.4.18.2+6.g0e400470/dnf/base.py", line 953, in do_transaction
1:     self._moduleContainer.save()
1:   File "/usr/lib64/python3.12/site-packages/libdnf/module.py", line 1241, in save
1:     return _module.ModulePackageContainer_save(self)
1:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1: libdnf._error.Error: Failed to create directory "/etc/dnf/modules.d": 13 - Permission denied# Please enter the commit message for your changes. Lines starting

It is also failing in our nightlies.
2024-01-30 07:44:18 +01:00
Jan Kolarik 0e40047074 Bump the version and update libdnf due to new filelists behavior 2024-01-26 09:33:46 +01:00
Jan Kolarik 1f22fe837e doc: Update config docs with new optional_metadata_types option 2024-01-26 09:33:46 +01:00
Jan Kolarik 138479265d commands: Setup filelists requests
Request loading filelists metadata if the command needs it or its argument specs contain a file pattern.
2024-01-26 09:33:46 +01:00
Jan Kolarik 11253e8387 base: Setup filelists metadata load flags
Add the filelists metadata load flag based on the optional_metadata_types option.
2024-01-26 09:33:46 +01:00
Jan Kolarik 9032dc5272 util: Add function for detecting file in specs
A helper function used to detect if any spec is a filename pattern.
2024-01-26 09:33:46 +01:00
mayo b5d25c075b Update use_cases.rst 2024-01-22 09:12:09 +01:00
Jan Kolarik 1c43d09991 Release 4.18.2 2023-12-08 11:44:42 +01:00
Nicola Sella cb54681d17 Add pre-commit checks 2023-11-30 13:00:02 +01:00
Nicola Sella e1ddff2106 Build PR packages in COPR using packit 2023-11-30 13:00:02 +01:00
derickdiaz 6229c1d40a Fixed Typo in docs 2023-11-15 12:33:34 +01:00
derickdiaz d523c192b5 Added 'send_error_messages' Boolean Option and updated man docs
Added option 'send_error_messages'

Fixed Option String List

Changed option to Boolean
2023-11-15 12:33:34 +01:00
derickdiaz bbbc19b992 Checks if emitter is null incase build_emitters throws a ConfigError 2023-11-15 12:33:34 +01:00
derickdiaz c59b50e787 Added feature to allow emitters to invoke on dnf error 2023-11-15 12:33:34 +01:00
Petr Písař 5d9555324d DNS key verification: Fix caching negative responses
If a user had installed multiple keys for the same e-mail address in
an RPM database, and no records for the address existed in DNS, DNF
validated the first key correctly, but reported that the other key is
revoked:

    # rpm -q gpg-pubkey --qf '%{packager} %{nevra}\n' |grep nokey
    nokey1 <nokey@fedoraproject.org> gpg-pubkey-7460757e-6553a6ab
    nokey2 <nokey@fedoraproject.org> gpg-pubkey-c8d04ba8-6553a6b1
    # dnf-3 upgrade
    DNSSEC extension: Testing already imported keys for their validity.
    DNSSEC extension: GPG Key nokey@fedoraproject.org has been revoked and should be removed immediately

The cause was a wrong test for a cached negative reponse. This patch
fixes it.

https://bugzilla.redhat.com/show_bug.cgi?id=2249380
2023-11-15 12:24:08 +01:00
Petr Písař 53a5a93971 DNS key verification: Fix handling keys without an e-mail address
If an PGP key is stored in an RPM database without a "packager" RPM
header, or without an e-mail address there, DNS verification crashed
on converting the undefined address into a DNS domain. That was the
case of Fedora 13 key:

    # dnf-3 upgrade
    Traceback (most recent call last):
      File "/usr/bin/dnf-3", line 62, in <module>
        main.user_main(sys.argv[1:], exit_code=True)
      File "/usr/lib/python3.12/site-packages/dnf/cli/main.py", line 201, in user_main
        errcode = main(args)
                  ^^^^^^^^^^
      File "/usr/lib/python3.12/site-packages/dnf/cli/main.py", line 67, in main
        return _main(base, args, cli_class, option_parser_class)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.12/site-packages/dnf/cli/main.py", line 106, in _main
        return cli_run(cli, base)
               ^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.12/site-packages/dnf/cli/main.py", line 122, in cli_run
        cli.run()
      File "/usr/lib/python3.12/site-packages/dnf/cli/cli.py", line 1040, in run
        self._process_demands()
      File "/usr/lib/python3.12/site-packages/dnf/cli/cli.py", line 741, in _process_demands
        self.base.fill_sack(
      File "/usr/lib/python3.12/site-packages/dnf/base.py", line 403, in fill_sack
        dnf.dnssec.RpmImportedKeys.check_imported_keys_validity()
      File "/usr/lib/python3.12/site-packages/dnf/dnssec.py", line 286, in check_imported_keys_validity
        keys = RpmImportedKeys._query_db_for_gpg_keys()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.12/site-packages/dnf/dnssec.py", line 276, in _query_db_for_gpg_keys
        email = re.search('<(.*@.*)>', packager).group(1)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib64/python3.12/re/__init__.py", line 177, in search
        return _compile(pattern, flags).search(string)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: expected string or bytes-like object, got 'NoneType'

This patch defends the crash at two places: In
_query_db_for_gpg_keys() because here we know a NEVRA of the key
and can produce a meaningful message. And in _cache_miss() because
we can get there independenly and called email2location() would also
crash.
2023-11-15 12:24:08 +01:00
Petr Písař 49feb2253d DNS key verification: Fix parsing an armored PGP key
A PGP armor message can contain any amount of headers. Up to Fedora 38
there was one:

  -----BEGIN PGP PUBLIC KEY BLOCK-----
  Version: rpm-4.18.0-beta1

  mQINBGIC2cYBEADJye1aE0AR17qwj6wsHWlCQlcihmqkL8s4gbOk1IevBbH4iXJx
  [...]
  =CHKS
  -----END PGP PUBLIC KEY BLOCK-----

Since Fedora 39 there is none:

  -----BEGIN PGP PUBLIC KEY BLOCK-----

  mQINBGLykg8BEADURjKtgQpQNoluifXia+U3FuqGCTQ1w7iTqx1UvNhLX6tb9Qjy
  l/vjl1iXxucrd2JBnrT/21BdtaABhu2hPy7bpcGEkG8MDinAMZBzcyzHcS/JiGHZ
  [...]
  =CHKS
  -----END PGP PUBLIC KEY BLOCK-----

RpmImportedKeys._query_db_for_gpg_keys() assumed exactly one header.
As a result if gpgkey_dns_verification configuration option was true,
DNF reported that Fedora 39 keys was revoked because the key
misextratracted from RPM database did not match a key in DNS:

    # dnf-3 upgrade
    DNSSEC extension: Testing already imported keys for their validity.
    DNSSEC extension: GPG Key fedora-39-primary@fedoraproject.org has been revoked and should be removed immediately

This patch implements skipping all armor headers.

https://bugzilla.redhat.com/show_bug.cgi?id=2249380
2023-11-15 12:24:08 +01:00
Iztok Fister Jr 3f8a560153 Fix typo in test file 2023-11-14 12:52:32 +01:00
Jan Kolarik 41a287e2bd Release 4.18.1 2023-11-07 08:09:45 +01:00
Marek Blaha 3c8c66f185 repoquery: Do not translate time format strings (RhBz: 2245773)
Given that the `--queryformat` option is commonly used to generate
machine-readable outputs from repoquery, we should ensure that the
output remains stable regardless of the locale used.

This partially reverts commit 1daf3467e6.

= changelog =
msg:           Do not translate repoquery time format strings
type:          bugfix
resolves:      https://bugzilla.redhat.com/show_bug.cgi?id=2245773
2023-10-27 07:56:47 +02:00