Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 647644 - sys-apps/portage: emerge -avuDN world should update portage at first and reload
Summary: sys-apps/portage: emerge -avuDN world should update portage at first and reload
Status: RESOLVED CANTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-14 18:44 UTC by Pacho Ramos
Modified: 2018-02-19 20:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2018-02-14 18:44:14 UTC
From time to time portage updates include important fixes to improve dep resolving. In some case I have seen that, just after syncing, running "emerge -avuDN world" was failing but, updating portage before that, end up getting "emerge -avuDN world" to work

Wouldn't it be possible to make "emerge -avuDN world" behave in a way that, if an update for portage is present, it updates portage first and, after that, it re-runs the world update?

Thanks a lot
Comment 1 Zac Medico gentoo-dev 2018-02-14 18:48:20 UTC
This is why portage checks for an update after emerge --sync, and suggests to run 'emerge -1 portage' if an update is available.

Adding special logic for portage to update itself leads to a lot of ugly code that I would prefer to avoid.
Comment 2 Zac Medico gentoo-dev 2018-02-14 18:50:03 UTC
It would be relatively simple if portage had zero dependencies, but it's often necessary to upgrade other packages first, and then it starts becoming more complicated.
Comment 3 Pacho Ramos gentoo-dev 2018-02-15 08:02:51 UTC
Ah, then probably I didn't see the message because I made sync some days ago but didn't update at that time, then, yesterday, when I re-run sync and tried to continue, the message didn't appear
Comment 4 Zac Medico gentoo-dev 2018-02-19 01:08:18 UTC
The message looks like this:

* An update to portage is available. It is _highly_ recommended
* that you update portage now, before any other packages are updated.

* To update portage, run 'emerge --oneshot portage' now.

The message is supposed to display unconditionally after every emerge --sync, unless the --quiet option is used:

https://gitweb.gentoo.org/proj/portage.git/tree/pym/portage/emaint/modules/sync/sync.py?h=portage-2.3.24#n266

The --quiet option suppresses the message here:

https://gitweb.gentoo.org/proj/portage.git/tree/pym/portage/emaint/modules/sync/sync.py?h=portage-2.3.24#n297
Comment 5 Pacho Ramos gentoo-dev 2018-02-19 19:04:20 UTC
I sync with eix-sync... but I use defaults and it seems it is using "emerge --sync"... but I will check on next portage update :/
Comment 6 Pacho Ramos gentoo-dev 2018-02-19 19:07:05 UTC
Ah, it is because eix-update output is shown after emerge --sync and, then, the warning is lost behind lots of other output :S

This also affects to "news" messages... but I guess this should be handled in eix side (either by showing that messages from emerge at the last part of the output or trying to re-run that tests after eix-update :|
Comment 7 Zac Medico gentoo-dev 2018-02-19 19:13:02 UTC
Instead of using eix-sync, you could call eix-update from /etc/portage/postsync.d script. The postsync.d scripts run before portage update and news item stuff.
Comment 8 Pacho Ramos gentoo-dev 2018-02-19 19:26:44 UTC
Oh, I didn't thought on that :O, it looks to work nice

Would you mind if I CC eix maintainers to let them know the issue for the case they want to handle this messages in a special way or, even, if they allow people to get this /etc/portage/postsync.d file installed by eix as an alternative to use eix-sync?
Comment 9 Zac Medico gentoo-dev 2018-02-19 19:31:24 UTC
(In reply to Pacho Ramos from comment #8)
> Oh, I didn't thought on that :O, it looks to work nice
> 
> Would you mind if I CC eix maintainers to let them know the issue for the
> case they want to handle this messages in a special way or, even, if they
> allow people to get this /etc/portage/postsync.d file installed by eix as an
> alternative to use eix-sync?

Yes that's fine, you could file a new bug and reference this one.
Comment 10 Pacho Ramos gentoo-dev 2018-02-19 19:59:32 UTC
done, thanks. Then, do whatever you prefer for this one... if the reloading of portage when updating is too hard to achieve... I guess this would be "WONTFIX" then
Comment 11 Zac Medico gentoo-dev 2018-02-19 20:27:57 UTC
For reference, these are the commits where I removed the automatic "resume after portage update" behavior:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=d3f704a425a50b5cfa997a25866929b30f1b7d0f
https://gitweb.gentoo.org/proj/portage.git/commit/?id=458ce208ed25f2d17666926585e14da6166eb9d7

In order to install the new version of portage, we have to evaluate its dependencies and install them if they are not satisfied. Therefore, it's not possible to avoid performing a dependency calculation using the installed instance of portage, so performing an automatic resume will not necessarily solve the dependency calculation problem discussed in comment #0.