Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 509912 - Add transactions / atomic updates to Portage
Summary: Add transactions / atomic updates to Portage
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Conceptual/Abstract Ideas (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-09 11:21 UTC by headcrabextra
Modified: 2023-09-01 00:59 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 headcrabextra 2014-05-09 11:21:17 UTC
In debian and ubuntu there is a graphical frontend for apt-get - synaptic. It allows to select, which packages you want to install and which packages you want to uninstall and do that in one operation.
What I suggest for portage is even better, it would be a real killer-feature and would make portage so much better than all other package managers.

Transactions.
You start transaction with
emerge --start-transaction transaction-name
or something like that
Now you can do different actions with emerge, whatever you do usually, but with an option --transaction transaction-name
When you do that, portage compiles packages, but doesn't actually install or uninstall them to the system - instead it uses chroot or some other sophisticated system, so that until you commit the transaction, it won't affect your system.
emerge --commit-transaction transaction-name  # this is where all the changes are actually written to your system.

Why do we need it?
Usually, when I want to do my weekly update of @world, I do it overnight.
So I do "emerge --ask --update --deep --with-bdeps=y --newuse @world" only to find it in the morning with some build failure or emerge telling me to emerge @preserved-rebuild, or haskell-updater or perl-updater or python-updater or whatever. I might not have time for that in the morning. With transactions you can leave it at that moment, because nothing is commited to your system, so you can continue this process some other time.

Or you want to emerge @world, but there are package blocks. So you start oneshotting packages, appending something to package.accept_keywords and do stuff. You really don't want to leave your system in the middle of this process. Obviously, in this case transactions would have to somehow track package.* files (for example whenever you start a transaction, create copies of /etc/portage/package.* files and copy them to /etc/portage/transactions/transaction-name, and when you do emerge --transaction transaction-name, work with them)

That was my exlaining as why portage should have transactions,
exptrapolate your option.

Reproducible: Always
Comment 1 Alex Xu (Hello71) 2014-05-09 11:30:29 UTC
This is not a new idea; some package managers (notably nix) have advanced upon this concept and created an entire operating system that is entirely "functional", so to speak.
Comment 2 headcrabextra 2014-05-09 11:33:42 UTC
(In reply to Alex Xu (Hello71) from comment #1)
> This is not a new idea; some package managers (notably nix) have advanced
> upon this concept and created an entire operating system that is entirely
> "functional", so to speak.

I didn't know. What are those operating systems?
Comment 3 Brian Dolbec (RETIRED) gentoo-dev 2014-05-09 14:53:30 UTC
You can pretty much do this in app-portage/porthole.  You can pause the terminal queue and restart at your will.  I even started to code a timer for it so you could set the time for it to start, but I've never gotten back to it.  The queue also allows you to move pkgs up and down in the queue.

What you suggest sounds like you want portage to build binpkgs only, then merge the binpkgs later.  That is possible now.  It also sounds like this could easily be done with a simple wrapper script.

Personally, I would not want to do this in portage at this time.  There is still far too much code cleanup, improvement and performance issues to deal with.