Summary: | eix does not respect /etc/portage/package.* directories | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Martin Väth <martin> |
Component: | Tools | Assignee: | Stefan Schweizer (RETIRED) <genstef> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | bugs, caster, emilbeinroth, rockoo, sergio.bevilacqua |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Patch for eix-0.5.5 to consider dirs as a file
Patch for eix-0.5.5 to consider mask-dirs as a file Patch for eix-0.5.5 to consider mask-dirs as a file Cleaner version of previous patches and a bugfix for an unreported bug |
Description
Martin Väth
2006-06-23 15:52:16 UTC
Created attachment 89960 [details, diff]
Patch for eix-0.5.5 to consider dirs as a file
Nice. Tried the patch and package.keywords dir is now parsed correctly. packages.mask and packages.unmask not, though. Created attachment 89981 [details, diff]
Patch for eix-0.5.5 to consider mask-dirs as a file
You are right. I had not tested this case, and to my surprise, eix uses another mechanism when reading mask-files. The attached patch does the same thing with the corresponding mask-file-reading-function as my previous patch did with the "general" file-reading-function. (Note: I have not merged the patches, i.e. both patches should be used together to have the same behavior for all files in /etc/portage/* - hopefully, I did not forget yet another file in there?)
Created attachment 89982 [details, diff]
Patch for eix-0.5.5 to consider mask-dirs as a file
You are right. I had not tested this case, and to my surprise, eix uses another mechanism when reading mask-files. The attached patch does the same thing with the corresponding mask-file-reading-function as my previous patch did with the "general" file-reading-function. (Note: I have not merged the patches, i.e. both patches should be used together to have the same behavior for all files in /etc/portage/* - hopefully, I did not forget yet another file in there?)
Created attachment 90681 [details, diff]
Cleaner version of previous patches and a bugfix for an unreported bug
The attached patch makes the previous patches obsolete. In addition, it fixes another bug of eix which I found by accident when writing this patch.
In detail:
1. Portage actually reads the /etc/portage/package.* recursively. The new patch of eix now also reads recursively (not just one level).
2. Some internal cleanup which will simplify future changes:
(a) The previous patch (and the unpatched eix) contained essentially a copy for the "file-reading" code when reading {un,}mask-files. With the new patch, pushback_lines() is used in both cases.
(b) The patched file-reading functions now all have an optional argument "recursive" (with the obvious meaning). So it is now easy to restore the old behavior for certain files, if required (currently, this is not used, i.e. also the files in /usr/portage are possibly read recursively - this might be considered as a bug or as a feature for future changes of portage).
3. The original eix had a bug in pushback_files(): The argument "exclude" never had any effect, because the "continue" statement in its test refers to the inner while loop, not as intended to the enclosing loop. Apparently, this bug did not cause a severe problem before (because "." and ".." were ignored anyway, because they are not ordinary files, and "parent" usually does not contain something which might confuse eix). However, for the recursive reading it is important that "." and ".." actually get "exclude"d to avoid infinite loops.
Security note: Symbolic links are not treated special, so a recursive symbolic link might hang eix forever.
thanks, this is fixed in 0.5.6 *** Bug 140102 has been marked as a duplicate of this bug. *** |