-
Notifications
You must be signed in to change notification settings - Fork 4
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
Parse and apply tmpfiles config file before writing out any content #72
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You may want to check out the hlint suggestions that travis printed out. Otherwise, that hint should get disabled locally. It's sometimes useful. |
bcl
force-pushed
the
master-parse-tmpfiles
branch
from
July 27, 2017 16:42
71bbf09
to
ebef77a
Compare
clumens
approved these changes
Jul 27, 2017
Only the tmpfile types needed for Export are supported, all others will be parsed as tfeType = Unsupported Use it like so: import TmpFiles(parseConfString) cfg <- readFile "data/tmpfiles-default.conf" parseConfString cfg Output will look like: Right [TmpFileEntry {tfeType = NewFile, tfePath = "path", tfeMode = Just 384, tfeUid = Just "root", tfeGid = Just "root", tfeAge = Just "5d", tfeArg = Nothing}]
When records are sorted the directory ones should be first, followed by symlink, file and then the rest. Sort by path within each type.
This implements limited support for tmpfiles.d file and directory creation. Only the following are supported: f Create a new file and optionally write the arg to it. Will not overwrite. F Remove existing file and make a new one, optionally writing arg to it. d Create a new directory, only if it doesn't exist. e Modify an existing directory's ownership and permissions L Create a new symlink. Do nothing if it already exists. L+ Remove file, directory tree, or symlink before creating it. WARNING this will remove a whole directory tree.
If the parser fails it will now print out the error string. If an entry is skipped it will now print that instead of being silent.
The tmpfiles.d snippet in data/tmpfiles-default.conf will now be processed before the content is written to the target directory when creating qcow2 images and directory trees.
Remove unneeded entries, and sort them for easier reading. (They don't need to be in order for processing, setupFilesystem takes care of that, this is purely cosmetic).
bcl
force-pushed
the
master-parse-tmpfiles
branch
from
July 27, 2017 20:58
ebef77a
to
3f2ae3e
Compare
bcl
force-pushed
the
master-parse-tmpfiles
branch
from
July 27, 2017 22:23
3f2ae3e
to
9512d88
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.