Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 137784

Summary: eix does not respect /etc/portage/package.* directories
Product: Portage Development Reporter: Martin Väth <martin>
Component: ToolsAssignee: 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
One of the features of portage-2.1 is that /etc/portage/package.* can be directories instead of files. However, this feature is not known to eix. I add a patch for eix-0.5.5 which adds this feature in a very simple manner: Whenever a requested file is a directory, all its content is considered as a single file.
Comment 1 Martin Väth 2006-06-23 15:54:00 UTC
Created attachment 89960 [details, diff]
Patch for eix-0.5.5 to consider dirs as a file
Comment 2 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-06-23 16:12:45 UTC
Nice. Tried the patch and package.keywords dir is now parsed correctly. packages.mask and packages.unmask not, though.
Comment 3 Martin Väth 2006-06-24 01:26:56 UTC
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?)
Comment 4 Martin Väth 2006-06-24 01:29:12 UTC
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?)
Comment 5 Martin Väth 2006-07-02 04:54:30 UTC
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.
Comment 6 Stefan Schweizer (RETIRED) gentoo-dev 2006-07-11 17:47:29 UTC
thanks, this is fixed in 0.5.6
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2006-07-12 05:45:18 UTC
*** Bug 140102 has been marked as a duplicate of this bug. ***