Skip to content
This repository has been archived by the owner on Jun 7, 2018. It is now read-only.

Commands for declarative package state and configuration #26

Open
piotr-yuxuan opened this issue Apr 5, 2018 · 3 comments
Open

Commands for declarative package state and configuration #26

piotr-yuxuan opened this issue Apr 5, 2018 · 3 comments

Comments

@piotr-yuxuan
Copy link

piotr-yuxuan commented Apr 5, 2018

Hi, thank you for this package, it's rather appealing!

This is more a question than an issue, which you can close if you find it too out of topic. Do you think it would be a good idea to add some commands to dump package system state (installed packages, repositories, versions) to some file? Then we could diff current state and expected state and execute commands to mute the current state and make it equal to expected one.

(well, actually this question is related to stateful package manager, like homebrew for macOS)

References:

@piotr-yuxuan piotr-yuxuan changed the title Commands for declarative package configu Commands for declarative package state and configuration Apr 5, 2018
@jabranham
Copy link
Owner

jabranham commented Apr 5, 2018 via email

@piotr-yuxuan
Copy link
Author

Yeah, sorry I have been unclear. To make it less confusing, let's say I use brew on my macOS to install programs or apps. Is there any way to tell system-packages which programs or apps are to be installed, and install them if they are missing? Just like Nix which allows you to describe which programs and apps you want on your computer, and it takes care of that for you.

@jabranham
Copy link
Owner

Ah, gotcha. I was responding to the email and didn't see the edits you made to your first comment.

I'd say checking for a particular package version isn't possible. Most ditros don't keep older package versions around on their mirrors, so once they've updated to foo-1.1, if we tried to install foo-1.0, we'd get an error. Nix and Guix are special in that they're specifically designed to be able to functionally describe the state of an entire system. Doing something like that just isn't possible with apt, brew, or pacman.

I think the best we can do is to tell whether or not a particular package is currently installed, and even that is complicated because package names vary across distros (see also #24). I'll add a command soon that will make this a little easier than the unless ... statement I described above.

jabranham added a commit that referenced this issue Apr 25, 2018
Also an alias for system-packages-package-installed-p to
executable-find.  This is somewhat related to bug #26, since you can
now do something clever with if statments: if pack-man=apt, then
ensure blah, else if pack-man=pacman, ensure blah-foo.

Obviously, there's still work to be done here.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants