-
Notifications
You must be signed in to change notification settings - Fork 42
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
Example for generating file on apply instead of copying it? #93
Comments
The primitive for creating a file is Logically, aconfmgr needs to have the exact contents of files it manages, so that it knows if a file as specified by the configuration differs from the copy on the system. So, yes, non-trivial files would need to be generated as part of parsing the configuration for aconfmgr to be able to manage their contents. You could implement some kind of caching mechanism to avoid doing so every time the configuration is parsed. Alternatively, if the contents of the file is not important and only its absence/presence is, you could make the configuration generate it if it is absent on the system, but if it is already present on the system, just copy it from there. |
Thanks for the answer, maybe I have to specify a bit. |
Well, that doesn't really fit into aconfmgr's model. It needs to be able to compare what's on the system and what the configuration is trying to make the system look like, and in order for it to be able to do that, the configuration must compile to a complete representation of the system configuration. This is what enables things like saving incremental configuration changes, My previous comment includes some suggestions of making it work within that model. Outside that model, you could create a script on top of aconfmgr, or perform the system changes directly from within the configuration (checking if |
Hi,
sorry if this is already answered in the documentation (if so, I havent found it)
but is it possible to create a file on apply instead of copying it?
Example would be an initramfs. I would like to ignore the file from saves and on apply run mkinitcpio -p to generate it.
As all packages and other files need to be already present for that, I would have to run that as the last command in the apply chain so I guess I should create a file 99-zzzzcreate.sh and put mkinitcpio -p into it but wouldn't that also run the command on every save?
Cheers
The text was updated successfully, but these errors were encountered: