Commit Graph

89 Commits

Author SHA1 Message Date
Neal Gompa d796e26008 Bump minimum version of libdnf in CMake and Meson
This was supposed to be done in 1a11b81885,
but it was missed by accident.
2020-11-13 10:35:04 -05:00
Nicola Sella 0d353c9c05 Release 3.5.0 2020-11-12 18:30:41 +01:00
Jaroslav Mracek 428d027939 Add module enable and disable commands 2020-11-05 11:28:34 +01:00
Jaroslav Mracek d9719df2c9 Allow to commit module changes and report module switch as an error 2020-11-05 11:28:34 +01:00
Jaroslav Mracek d571cc7794 Add reports of module changes 2020-11-05 11:28:34 +01:00
Jaroslav Rohel 1a11b81885 Add "module enable" command 2020-11-05 11:00:54 +01:00
Jaroslav Rohel 9edaf50971 Add subcommands support
Plugins with a '_' character in command name will  implement subcommands.
Needed for modularity subcommands.
E.g. the "command_module_enable" plugin will implement the "enable"
subcommand of the "module" command.
2020-11-05 11:00:54 +01:00
Pavla Kratochvilova d1e8657176 Introduce changelog metadata in commit messages
Add Contribution section into README, including the guidelines for
adding changelog metadata to the commit messages. Thanks to this,
changelog can be automatically generated while staying useful.
2020-08-26 11:55:32 +02:00
Jaroslav Rohel 3026b97808 Print info about obsoleted packages before transaction (RhBug:1855542)
- Added number of obsolete packages into transaction summary.
- Added which packages are obsolete and by whom they are replaced.

The user can run microdnf in test mode (--setopt=tsflags=test) to know
what microdnf will do. However, without this patch, information about
obsolete (replaced as obsolete) packages was missing.

Example output before patch:
# microdnf install TestB
Package                                           Repository        Size
Installing:
 TestB-1.0.0-1.noarch                             ci-obsoletes    5,9 kB
Transaction Summary:
 Installing:        1 packages
 Reinstalling:      0 packages
 Upgrading:         0 packages
 Removing:          0 packages
 Downgrading:       0 packages
Downloading packages...
Running transaction test...
Installing: TestB;1.0.0-1;noarch;ci-obsoletes
Obsoleting: TestA;1.0.0-1;noarch;installed
Complete.

Example output after patch:
# microdnf install TestB
Package                                           Repository        Size
Installing:
 TestB-1.0.0-1.noarch                             ci-obsoletes    5,9 kB
   replacing TestA-1.0.0-1.noarch
Transaction Summary:
 Installing:        1 packages
 Reinstalling:      0 packages
 Upgrading:         0 packages
 Obsoleting:        1 packages
 Removing:          0 packages
 Downgrading:       0 packages
Downloading packages...
Running transaction test...
Installing: TestB;1.0.0-1;noarch;ci-obsoletes
Obsoleting: TestA;1.0.0-1;noarch;installed
Complete.
2020-07-19 12:57:02 -04:00
Aleš Matěj 6d04a3ce97 Release 3.4.0 2020-01-15 11:03:12 +01:00
Jaroslav Rohel 4333e8d4c9 Set version to 3.4.0 2020-01-10 04:35:59 -05:00
Jaroslav Rohel 539edb9267 Add "--refresh" argument
Set metadata as expired before running the command.
2020-01-10 04:35:59 -05:00
Jaroslav Rohel b87f371045 Respect "metadata_expire" config files option (RhBug:1771147)
Microdnf respects the "metadata_expire" option from repository or global
configuration file.
Before this patch the microdnf set maximum cache age to 0. -> Metadata
was alway downloaded. Again and again during each action that needed
metadata.
2020-01-10 04:35:59 -05:00
Jaroslav Rohel 5ae1d24983 Add --installroot support
The "--installroot" argument must be used together with "--config",
"--noplugins", "--setopt=cachedir=<path>", "--setopt=reposdir=<path>",
and "--setopt=varsdir=<path>" arguments.

The release version is detected from the installroot directory. If it
is not possible (eg. empty/newly created installroot) then the release
version must be supplied as an additional argument
"--releasever=<requested_releasever>".
2020-01-08 19:07:09 -05:00
Jaroslav Rohel 16683030c4 Support for setting path to cache directory (--setopt=cachedir=)
Default path is /var/cache/yum.

Example of setting of another path:
--setopt=cachedir=/var/cache/microdnf
2020-01-07 17:42:43 -05:00
Jaroslav Rohel 2c684df8ef Message if plugins loading disabled and --enableplugin, --disableplugin 2020-01-06 18:49:58 -05:00
Jaroslav Rohel b737863b8c Add command line argument --noplugins
Disable loading of plugins.
2020-01-06 18:49:58 -05:00
Jaroslav Rohel b75a5d9eed Fix: Add missing "else"
Fixed arguments --config, --disablerepo, --enablerepo.
Error:
Bail out! ERROR:/home/jrohel/projects/rpm-software-management/microdnf/
dnf/dnf-main.c:142:process_global_option: code should not be reached
2020-01-06 23:00:46 +01:00
Jaroslav Rohel 0fec40d5f0 Add --disableplugin, --enableplugin (RhBug:1781126)
--disableplugin=name    Disable plugins by name
--enableplugin=name     Enable plugins by name

The name can contains globs.
2020-01-06 14:32:42 +01:00
Jaroslav Rohel 4b91cfcc5b Call dnf_context_set_install_weak_deps() later
The dnf_context_set_install_weak_deps() must not be called before
dnf_context_set_config_file_path().
2020-01-05 09:36:05 -05:00
Jaroslav Rohel d8992df7c7 Add "--config=" argument
Configuration file location can be set by:
"--config=<path_to_config_file>"
2020-01-05 09:36:05 -05:00
Jaroslav Rohel fffcd0b397 Multiple directories in option "--setopt=reposdir="
Patch allows to set multiple repos directories by --setopt.
Format: "--setopt=reposdir=<path1>, <path2>,..."

Needs libdnf with dnf_context_set_repos_dir() function.

Notes:
The libdnf creates the first repos directory if it does not exists.
The RHSM code in libdnf uses the first repos directory.
2020-01-05 09:35:20 -05:00
Jaroslav Rohel b75be3bff8 Respect reposdir option from configuration file
The old libdnf version required setting of path to repository. The new
libdnf reads the path from configuration file. Or sets the default path
if it is not found in the configuration file.
So, the PR removes default setting of path to repository from
the microdnf.
Needs libdnf with support for reposdir in configuration file.
2020-01-05 09:35:20 -05:00
Jaroslav Rohel 71c71ea4f7 Fix --setopt=install_weak_deps=0
There was a bug. Solved transaction was always resolved again with
hardcoded parameters (and weak dependencies was always installed).

The patch needs libdnf with dnf_transaction_set_dont_solve_goal()
function.

Example of bug (weak deps transaction is resolved and 3 instead
2 packages are installed):
# microdnf install --setopt=install_weak_deps=0 abcde
Package                        Repository            Size
Installing:
 abcde-2.9.2-1.fc29.noarch      dnf-ci-fedora      6.20 kB
 wget-1.19.5-5.fc29.x86_64      dnf-ci-fedora      6.50 kB
Transaction Summary:
 Installing:        2 packages
 Reinstalling:      0 packages
 Upgrading:         0 packages
 Removing:          0 packages
 Downgrading:       0 packages
Running transaction test...
Installing: wget;1.19.5-5.fc29;x86_64;dnf-ci-fedora
Installing: flac;1.3.2-8.fc29;x86_64;dnf-ci-fedora
Installing: abcde;2.9.2-1.fc29;noarch;dnf-ci-fedora
Complete.
2020-01-05 09:34:38 -05:00
Jaroslav Rohel 2f9b3edc74 Support for setting paths to variables directories (--setopt=varsdir=)
More directories can be specified.
Example:
--setopt=varsdir=/etc/dnf/vars,/etc/vars
2019-12-29 12:03:51 -05:00
Jaroslav Rohel 21c40316f8 Support for setting path to repository directory (--setopt=reposdir=)
Only one repository directory can be specified.
The libdnf must be change to support more repository directories and to respect
global configuration file (dnf.conf).

Example:
--setopt=reposdir=/etc/yum.repos.d
2019-12-29 12:03:51 -05:00
Jaroslav Rohel c1617f049a Support more flags in "--setopt=tsflags=" at once
Example:
"--setopt=tsflags=test --setopt=tsflags=nodocs" can be replaced by
"--setopt=tsflags=test,nodocs"
2019-12-18 23:36:11 -06:00
Jaroslav Rohel e1aa2f6146 Add "--setopt=tsflags=test" support
There was no possibility only to show and test a transaction.
The transaction was always performed.
The "test" option provides a transaction check without performing
the transaction. It includes downloading of packages, gpg keys check
(including permanent import of additional keys if necessary), and
rpm check to prevent file conflicts.
2019-12-18 23:36:11 -06:00
Jaroslav Rohel 1add3db1d8 Command "reinstall" respect tsflags 2019-12-18 23:36:11 -06:00
Jaroslav Rohel eb2123bb5d Support "--setopt=install_weak_deps=0/1"
Instaling of week dependencies can be disabled or enabled by "setopt"
argument.
2019-12-18 15:50:31 +01:00
Jaroslav Rohel afcf9ca117 Respect configuration option "install_weak_deps" 2019-12-18 15:50:31 +01:00
Jaroslav Rohel a72151f749 [repolist] Print padding spaces only if output is terminal 2019-12-18 10:44:40 +01:00
Pavla Kratochvilova 30f4737a70 Add dependency on libdnf
The "BuildRequires: pkgconfig(libdnf) >= %{libdnf_version}" results
only in dependency on "libdnf.so.2()(64bit)", which is not sufficient,
therefore, adding also "Requires: libdnf >= %{libdnf_version}".

Discovered by: https://bugzilla.redhat.com/show_bug.cgi?id=1679476#c16
2019-12-17 08:08:13 +01:00
Jaroslav Rohel f3cb4de55b [reinstall] pass all available candidates to the solver
When there were more available candidates with the same nevra, then
the package with the greatest Id was passed to the solver.
Now all candidates are passed to the solver (using selector). Solver
chooses package. Solver takes in account other factors (eg. priority
of repositories).
2019-12-13 14:26:56 +01:00
Jaroslav Rohel 1143be7bc4 Add reinstall command
Reinstalls selected packages.

Signed-off-by: Jaroslav Rohel <jrohel@redhat.com>
2019-12-13 14:26:56 +01:00
Jaroslav Rohel 5c0df680b7 Fix: Don't print lines with (null) in transaction report (RhBug:1691353)
Example:
Installing: binutils;2.30-49.el8;x86_64;beaker-BaseOS
Installing: (null)
Installing: isl;0.16.1-6.el8;x86_64;beaker-AppStream
Installing: (null)

The lines with (null) will not be printed with this patch.
2019-12-03 07:48:47 -05:00
Aleš Matěj d443b1bc31 Release 3.3.0 2019-11-26 10:09:22 +01:00
Aleš Matěj c7217418c4 Release 3.0.3 2019-11-25 12:26:48 +01:00
Jaroslav Rohel f334ccb7a5 [repoquery] add "--info" and "--nevra" options
--info   show detailed information about the packages
--nevra  use name-epoch:version-release.architecture format
         for displaying packages (default)

Signed-off-by: Jaroslav Rohel <jrohel@redhat.com>
2019-11-20 14:43:01 +01:00
Jaroslav Rohel d07c9f1313 Add repoquery command (RhBug:1769245)
Searches for selected packages and displays the requested information
about them.

Command options:
  --available   display available packages (default)
  --installed   display installed packages

Signed-off-by: Jaroslav Rohel <jrohel@redhat.com>
2019-11-20 14:43:01 +01:00
Jaroslav Rohel 0342015ed4 Add repolist command (RhBug:1584952)
The command lists repositories.

Command options:
  --all        show all repositories
  --disabled   show disabled repositories
  --enabled    show enabled repositories (default)

Signed-off-by: Jaroslav Rohel <jrohel@redhat.com>
2019-11-19 10:37:44 +01:00
Aleš Matěj e93771dd2e [spec] Bump libdnf require (RhBug:1771611)
microdnf PR: https://github.com/rpm-software-management/microdnf/pull/52
requires libdnf PR:
https://github.com/rpm-software-management/libdnf/pull/826 however this
libdnf PR is present in version 0.37.2, where as microdnf currently
requires only 0.37.1
2019-11-13 09:48:01 -05:00
Jonathan Dowland 2d073afddc update README to reflect libhif→dnf
libhif no longer exists and microdnf uses libdnf
2019-11-12 13:40:27 +01:00
Jaroslav Rohel a66377aa86 Fix: do not download metadata in remove command
Microdnf downloades repository metadata in the remove command. It is
not needed because the remove command does not use them. In addition,
there is a problem with unavailable repositories when
skip_if_unavailable=false. In this case, microdnf stops with error
message "error: cannot update repo ..." and does not remove any package.

The fix disables loading of repository metadata in the remove command.
2019-11-12 10:34:00 +01:00
Pavla Kratochvilova 1ac375ff33 Release 3.0.2 2019-11-05 08:56:31 +01:00
Jaroslav Mracek cf1ef32988 [spec] Bump libdnf require 2019-10-25 10:38:50 +02:00
Jaroslav Mracek 4cc9b82242 Add option --nobest
It is used to overwrite configuration of best option. It is useful when
best=True is default.
2019-10-25 00:58:23 -04:00
Jaroslav Mracek 3f752fda64 Initialized to use tito. 2019-10-25 00:58:23 -04:00
Jaroslav Mracek 2be521af42 Add option best for transactions (RhBug:1679476)
It adds option `--best` plus default is handled from libdnf.conf and
dnf.conf

https://bugzilla.redhat.com/show_bug.cgi?id=1679476
2019-10-25 00:58:23 -04:00
Neal Gompa 9956d1dcdd spec: Sync summary and description from Mageia
Mageia's microdnf spec has a much better summary and description
than Fedora's spec, so let's pull that into this package.
2019-09-12 09:02:28 -04:00