Bug 884617 - dnf update/distro-sync command line exclude option doesn't work
Summary: dnf update/distro-sync command line exclude option doesn't work
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 18
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Ales Kozumplik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 871892
TreeView+ depends on / blocked
 
Reported: 2012-12-06 12:25 UTC by Jan Vcelak
Modified: 2015-10-08 15:19 UTC (History)
5 users (show)

Fixed In Version: dnf-0.2.20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-04-03 14:49:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jan Vcelak 2012-12-06 12:25:40 UTC
Description of problem:

An option to exclude a packages from update/distro-sync does not work in DNF.


Version-Release number of selected component (if applicable):
dnf-0.2.17-1.git6a055e6.fc18.noarch


How reproducible:
always


Steps to Reproduce:
1. dnf distro-sync -x tuned
2.
3.
  
Actual results:

Dependencies Resolved

========================================================================
 Package             Arch   Version               Repository       Size
========================================================================
Installing:
 ...
Updating:
 ...
 tuned               noarch 2.1.0-1.fc18          updates-testing 120 k
 ...

Transaction Summary
========================================================================
...

Expected results:

tuned should not be in the list of updated packages


Additional info:

The same with 'dnf update'. This option is quite useful, if you know that some package in repository is broken and want to use an older version.

The option seems to be implemented, 'yum update -x' gives following error:
Command line error: -x option requires an argument

Comment 1 Ales Kozumplik 2012-12-12 08:12:06 UTC
Hi, thanks for the report. The -x option is not supported yet, but it is coming later.

Comment 2 Ales Kozumplik 2012-12-17 08:56:21 UTC
Hi Michael,

Can you please advise me about the best way to tackle this with libsolv? In short, yum users are able to specify '-x <name or glob pattern>' with a command that excludes the named packages from the processing, i.e. yum acts as if these packages didn't exist. For instance doing:

yum update -x 'python*'

updates all packages with a higher version available, but not any package whose name starts with 'python'.

I was thinking this could be done by finding all solvables matching the pattern and removing these from their repos with repo_free_solvable(). Is this approach viable?

Comment 3 Ales Kozumplik 2012-12-17 09:14:03 UTC
Hm, also just found about about pool->considered. Maybe that's the answer then?

Comment 4 Michael Schröder 2012-12-17 10:43:43 UTC
I kinda dislike disabling the packages, as it means they are not available when the solver searches for solutions. Also, you should not remove installed packages.

Maybe it's enough to simply SOLVER_LOCK all the matching packages. That may not be enough for reposync mode, though, but I can make that configurable.

Comment 5 Ales Kozumplik 2012-12-17 11:04:38 UTC
Hm, what if I just remove the uninstalled subset of all excludes from pool->considered? That shouldn't harm the solver: it would not see them but that's allright, we  don't want them considered for any operation anyway.

Will look at SOLVER_LOCK too, thanks.

Comment 6 Michael Schröder 2012-12-17 11:12:45 UTC
As I said, I don't like that because the solver can't propose good solutions if the packages are removed. I know that dnf currently doesn't propose solutions, but it's something that you may want to do some day.

locking packages is basically the same, it tells the solver that the packages must not change state, i.e. uninstalled packages keep being uninstalled and installed ones keep being installed.

Comment 7 Ales Kozumplik 2013-01-03 14:13:10 UTC
Fixed, commit 28a29b4.


Note You need to log in before you can comment on or make changes to this bug.