Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 321087 - 'Undo' steps for emerge
Summary: 'Undo' steps for emerge
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-22 19:24 UTC by dE
Modified: 2015-06-21 16:13 UTC (History)
1 user (show)

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 dE 2010-05-22 19:24:15 UTC
One major problems that users face when updating the system to unstable branch (for e.g. using the latest KDE) is compile time failures resulting in breaking of packages. This can be solved by 'undoing' certain emerge processes, i.e. removing the newly compiled packages and merging the old ones.

emerge should have a '--track start|stop' option; when --track start is implemented, portage will start watching the user for what he's merging/unmerging and if a user does emerge --undo, portage will try and bring the package states (versions and USE flags) back when --track start was implemented, after which (after successful merges of old packages) --track stop will automatically be implemented which will stop tracking changes.

In case after a --track start has been implemented, the user syncs the tree/overlay or updates the main tree/overlay manually, --track stop will automatically be trigged. Before such an upgrade the users should be warned that --track start is still initiated, infact it's recommended he should be warned every time.

Tracking can manually be stopped using --track stop.

I guess this will be a hard feature to implement.

Reproducible: Always

Steps to Reproduce:
Comment 1 Zac Medico gentoo-dev 2010-05-25 07:44:42 UTC
(In reply to comment #0)
> One major problems that users face when updating the system to unstable branch
> (for e.g. using the latest KDE) is compile time failures resulting in breaking
> of packages. This can be solved by 'undoing' certain emerge processes, i.e.
> removing the newly compiled packages and merging the old ones.

Your idea seems to require lots of user intervention. Ideally, we should solve these kinds of build failures in ways that do not require any user intervention.
Comment 2 Fabian Groffen gentoo-dev 2010-05-25 08:17:52 UTC
Would it be easy to implement some FEATURE that just quickpkgs the package to be unmerged right before it is unmerged?  It could be stored in some location different from regular binpkg files (I guess it never has any licence issues, and configuration file issues, since it isn't meant to be distributed).  Then a "backout" command could just put the package back in place, effectively undoing the merge.

Sun's pkg tool usually actually backups whatever is in the filesystem before it's going to be replaced, such that when an error occurs during installation/upgrade, it just backouts its changes made sofar, to leave the system in a consistent state.  Because it stores the backups, you can also backout patches later, if you e.g. suspect them to cause some weird behaviour.

1) I've seen Portage dying (backtracing) in the merge phase a couple of times, recovery from that point is hard since the states aren't recorded and you have a half-merged package in the live filesystem.  A handler there that can recover would be nice regardless.
2) Implementing a "backout" feature is probably closely related to delivering enterprise stability features.  Not sure if we want that.

My 0.02e.
Comment 3 dE 2010-05-25 08:27:22 UTC
Yes, as I said - 

>I guess this will be a hard feature to implement.

Specially with the complexity of portage.

I have recommend that binpkg feature. Zac Medico knows.
Comment 4 Alex Xu (Hello71) 2015-06-21 16:13:55 UTC
FEATURES=unmerge-backup