Summary: | etc-update generates lint, duplicate files | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Roman Gruber <roman.gruber> |
Component: | Unclassified | Assignee: | Portage team <dev-portage> |
Status: | CONFIRMED --- | ||
Severity: | enhancement | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Roman Gruber
2015-08-17 15:10:03 UTC
The current implementation compares the latest ._cfg file to the file that's being merged, and re-uses the latest ._cfg file if they are identical. If you are upgrading/downgrading a given package such that the latest ._cfg file is not identical to the file being merged, then it can result in having some duplicate ._cfg files (though two consecutive ._cfg files should always be different from eachother). The relevant code can be found in the new_protect_filename function: https://gitweb.gentoo.org/proj/portage.git/tree/pym/portage/util/__init__.py?h=v2.2.20.1#n1666 The function is called here: https://gitweb.gentoo.org/proj/portage.git/tree/pym/portage/dbapi/vartree.py?h=v2.2.20.1#n4937 I have tested with portage-2.2.20.1, and it appears to behave as I have described above. (In reply to Roman Gruber from comment #0) > Expected behaviour: > > Create a temporarily folder. Maybe it's better if you focus on describing the intended result rather than how to achieve it, since there are multiple ways to achieve it (it's not strictly necessary for portage to create a temporary folder, regardless of the intended result here). (In reply to Roman Gruber from comment #0) > I do not get the point why several config files are generated with 0000, > 0001, 0002, => why not just replace ._cfg0000 with the new ._cfg0000 anyway? > it is a suggestion right? a template? That seems like it would be reasonable. However, the recommended practice is to run etc-update or dispatch-conf at the earliest opportunity (delaying it could lead to an unbootable system or failure of an important service to start in some severe cases). If you do you're config updates at the earliest opportunity, then you'll never have more that one ._cfg file anyway. Note that dispatch-conf automatically removes all but the latest ._cfg files that it finds: https://gitweb.gentoo.org/proj/portage.git/tree/bin/dispatch-conf?h=v2.2.20.1#n420 Making etc-update do the same seems like a good idea. |