Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 240402 - env.eselect does not process symlinks
Summary: env.eselect does not process symlinks
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: eselect (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo eselect Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2008-10-07 17:27 UTC by Ilya Kolesnikovich
Modified: 2009-04-18 09:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Kolesnikovich 2008-10-07 17:27:35 UTC
On my system (I use symbolic links in env.d directory - real files are placed in SVN and they are in local copy in other directory) "eselect env update" command skips all symlinks with message like "Skipping non-text file /etc/env.d/02locale".
env.eselect doesn't process symlinks. So, my offer is either put "application/x-symlink" mime type in MIME_WHITELIST of use -L option for "file" utility like in this patch for /usr/share/eselect/modules/env.eselect:

52c52
<       mime=$(file -i ${envfile} | cut -d ' ' -f 2 | sed -e 's/;$//')
---
>       mime=$(file -iL ${envfile} | cut -d ' ' -f 2 | sed -e 's/;$//')


Reproducible: Always

Steps to Reproduce:
1. mv /etc/env.d/02locale ~
2. ln -s ~/02locale /etc/env.d/
3. eselect env update
4. See output results

Actual Results:  
Environment configs in env.d directory are not processed

Expected Results:  
It will be cool if they are precessed
Comment 1 Ulrich Müller gentoo-dev 2009-04-16 21:43:41 UTC
Unfortunately, "file -L" is not portable. Does the following also work for you?

-	mime=$(file -i ${envfile} | cut -d ' ' -f 2 | sed -e 's/;$//')
+	mime=$(POSIXLY_CORRECT=1 file -i ${envfile} \
+		| cut -d ' ' -f 2 | sed -e 's/;$//')
Comment 2 Ulrich Müller gentoo-dev 2009-04-17 05:56:28 UTC
Committed to SVN trunk (r445) and 1.0.x branch (r447), since I think this is a safe change.
Comment 3 Ulrich Müller gentoo-dev 2009-04-18 09:04:33 UTC
Fixed in 1.0.12.
Thanks for reporting.