Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aptcc not installing recommends #145

Closed
hsitter opened this issue Jul 12, 2016 · 7 comments · Fixed by #166
Closed

aptcc not installing recommends #145

hsitter opened this issue Jul 12, 2016 · 7 comments · Fixed by #166

Comments

@hsitter
Copy link
Contributor

hsitter commented Jul 12, 2016

  • foobar 1.0 doesn't recommend kitteh
  • foobar 2.0 recommends kitteh
  • pkcon update from 1.0 to 2.0 doesn't want to install kitteh

This is inconsistent with apt where both upgrade and dist-upgrade will install new recommends. Furthermore, this actually can have negative impact on any form of rolling system where this sort of thing might occur regularly.

@dantti
Copy link
Collaborator

dantti commented Jul 22, 2016

does apt install pkg to update install the recommends?

@hsitter
Copy link
Contributor Author

hsitter commented Jul 22, 2016

It does. both upgrade and dist-upgrade as a matter of fact

@dantti
Copy link
Collaborator

dantti commented Jul 22, 2016

no, I mean install as in
apt install foo
upgrade and dist-upgrade are different

@hsitter
Copy link
Contributor Author

hsitter commented Jul 22, 2016

oh. good question. I can't check right now as I have no linux at hand until sunday, if you don't get to it before then I'll make a test repo and have a look.

@dantti
Copy link
Collaborator

dantti commented Jul 22, 2016

k thks, as aptcc should do the same as apt install foo, I only use dist-upgrade to get a list of upgradable things

@hsitter
Copy link
Contributor Author

hsitter commented Jul 25, 2016

Testing repo: https://github.com/apachelogger/test-apt-recommends-install

kitteh
version 1 = no relationships
version 2 = recommends on meows

meows
version 1 = recommended on by kitteh

the repo also has build.sh which rebuilds the repo, update.sh which does an apt update bypassing gpg verification and test.sh which tests an install sequence

apt install kitteh=1
apt install kitteh
leads to:

The following NEW packages will be installed:                                                                                                
  meows   

same for dist-upgrade, same for upgrade.

For good measure, I also tried qapt-batch --install kitteh (to install 2 on top of 1) which also works as expected.
screenshot_20160725_121500

So there's definitely something wrong in aptcc's resolution.

@hsitter hsitter changed the title aptcc not installing recommends on update aptcc not installing recommends Sep 19, 2016
@hsitter
Copy link
Contributor Author

hsitter commented Sep 19, 2016

So, as it turns out this affects regular install as well. Namely if you install kitteh=2 from above's repo it won't pull in meows.

I have an unfinished fix for this which is basically the same for both install and update.

We first want to mark all to be changed packages without autoinst. We then want to mark all of them again but this time with autoinst. After this we probably can mark them protected, in between it's probably more of a hindrance to resolution than anything.

By first marking everything without autoinst we can make sure that explicit selection trumps in an or-group

e.g. Depends: foo | bar with pkcon install meow bar will definitely pick bar rather than foo where autoinst would pick foo.

I need to do a bit more testing on the when to mark things protected though.

hsitter added a commit to hsitter/PackageKit that referenced this issue Sep 20, 2016
new arguments: autoInst and preserveAuto

apt's markInstall can automatically try to resolve dependencies (incl.
recommends if applicable) without having the resolver deal with broken
dependencies at all. to that end it will mark dependencies of $package as
auto-install which gives them a slightly lower resolution score and the
auto flag (so they can be autoremoved).
To facilitate its use, the interface now calls toinstall twice: once
without autoInst to only mark explicitly wanted packages, and a second time
with autoInst to then also mark all needed dependencies. This is
specifically meant to allow or-relationships to resolve as desired.

e.g.
```
Package: foobar
Depends: foo|bar
```
with `pkcon install foobar bar` will explicitly mark foobar and bar and
thus prevent foo from getting autoinstalled.

In update scenarios it is hard to tell whether a user wants a package to be
installed or updated. In particular whether or not a package is meant to
be installed according to the user would prevent them from being
autoremoved. A user may however run `pkcon update foo` to update foo, not
because she actually thinks foo is needed or useful. To prevent
unintentionally losing the auto flag on updates, the backend now
always preserves the flag when updates are requested. Conversely on
installs we default to not having the auto flag.

fixes PackageKit#153
fixes PackageKit#151
fixes PackageKit#145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants