-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
(Partially Fixed) Emerge config reading badly broken #9767
Comments
To clarify, I'm seeing this on a minion after trying both 0.17.4 and 2014.1.0-379-ga2de041 ... I would imagine the official RC also has it. I reproduced it on another minion also running 2014.1.0-379-ga2de041 The master is 0.17.4, though I don't think that's relevant in this case. |
Having studied the code further and figured out the interaction, I'm noting my original post has some errors. I found the writing code down in I don't know what's the proper way to fix this is, but for a temp fix I'm going to inject a config option in to ebuild.py's ex_mod_init and default it to off. This mechanic could well annoy people when it totally rewrites their /etc/portage Edit: Now I see why I've not encountered it before... it was in the 0.17 release but not in the 0.16 release. |
Hi @kaithar. Thanks for reporting this and for the excellent detective work here! I'm not a Gentoo user so I don't have an enlightened view of what the correct behavior should be here. I am going to move this issue into the list of open bugs so that we can start to get some feedback from others on how this might work. |
@kaithar None of the core devs are gentoo users, so we're not very opinionated on the subject. Perhaps that was too invasive and should not have been merged. Seems like the invasive behavior could probably be hidden behind a configuration option and that would allow everyone to be happy. Thoughts? |
@basepi that's what I'm intending, yes, defaulting to off (though it obviously won't revert previous merges), and properly documented. The only analogy I could come up with is a media player deciding to silently reorganise your mp3 collection when you only asked it to play one of the tracks... that's not the best analogy but I think it conveys the right notion. One of the main principles of Gentoo is that of offering choices where ever possible, even to the point of having you choose what crontab package to use. That's part of why it's such a horrible learning curve unfortunately. As a result, I'm not aware of an "official" layout for the folders. The site docs mention they can be files or folders and suggest you could use one file per package. It also suggests checking the man-page. Thus the portage man-page is probably the most authoritative (and detailed) source and has this to say:
So basically, every user does what feels right to them. For my salt controlled nodes I've gone the route of having a file for each state named after the state that created it. As noted elsewhere, portage automatically generates comments along with new atoms when the user uses the
|
Should I make a separate PR for 2014.1, or can this be cherry picked over? |
Sorted :) |
I've directed @faust here, as the original author of the code involved, as I'd like the original problem resolved. |
Thank you for pointing me here. Actually there were some doubts about the original PR (#5824), but then it was merged before finding out a better solution. The main problem is that Gentoo allows users to build up silly directory trees for configuration files. Reading values is not a problem, but when you have to modify or to add something it can be a little bit difficult to find out what file you have to modify. For this reason I choose to "enforce" a "nice" (for salt) configuration. I know that it is not the best solution, but I based my decision on the assumption that if you are using salt it means that you won't manage your server manually. So I thought that it doesn't matter if your configuration tree structure is reorganized as a far as it is hidden behind salt states. Of course this assumption does not have general validity. |
Just as a small update: 'portage_config.enforce_nice_config' still aborts with errors if there are
I don't know yet about the other dirs, but I will dig into that (and hopefully provide a solution soon). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Kinda-regression for #8252
I threw an exception throw in just above
append_to_package_conf(conf, string=line)
insalt/modules/portage_config.py:188:_package_conf_ordering
to determine what's going on...To be sure, I went down a frame:
And sure enough:
I'm calling it a regression as I wasn't seeing this on 0.17.4, but the patch applied in PR #8924 doesn't actually address this particular case. I'd guess that some other change has resurrected this bug.
After a lot of digging, I've traced a large part of the issue to this section of
salt/modules/portage_config.py
(around L157):So, if you have straight files, os.walk won't yield and this entire block gets skipped. If you have directories like me:
path ==
"/etc/portage/package.accept_keywords"
triplet ==
('/etc/portage/package.accept_keywords', [], ['salt'])
file_path =
"/etc/portage/package.accept_keywords/salt"
triplet[0][len(path) + 1:] ==
""
cp ==
"/whatever_keywords_file"
Meaning, by my reading, that that last comparison won't fail unless you have nested folders.
Not to mention that the
os.remove
call deletes the original file and a furtheros.remove
further down deletes the backup ... but the call to recreate the original isn't called so far as I can see.So as is, it looks like emerge support is broken and actively nuking config files?
The text was updated successfully, but these errors were encountered: