Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 129515 - [PATCH] etc-update and dispatch-conf ignore any files that are under symlinked dirs
Summary: [PATCH] etc-update and dispatch-conf ignore any files that are under symlinke...
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All Linux
: High normal with 2 votes (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 149388 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-04-10 13:00 UTC by Patrick McLean
Modified: 2010-11-20 03:33 UTC (History)
2 users (show)

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


Attachments
dispatch-conf-deference-symlinks.patch (dispatch-conf-read-symlinks.patch,614 bytes, patch)
2006-04-10 13:02 UTC, Patrick McLean
Details | Diff
etc-update-derefence-symlinks.patch (etc-update-read-symlinks.patch,534 bytes, patch)
2006-04-10 13:03 UTC, Patrick McLean
Details | Diff
dispatch-conf-better-symlink.patch (dispatch-conf-better-symlink.patch,6.47 KB, patch)
2006-04-11 10:58 UTC, Patrick McLean
Details | Diff
dispatch-conf-find-fix.patch (dispatch-conf-better-symlink.patch,611 bytes, patch)
2006-04-28 19:17 UTC, Patrick McLean
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick McLean gentoo-dev 2006-04-10 13:00:31 UTC
dispatch-conf and etc-update seem to ignore any files that are under symlinked dirs.

For example, if /etc/conf.d is a symlink to another location, and an ebuild updates a file in /etc/conf.d, etc-update and dispatch-conf won't notice the file that needs to be updated.

I have a one line patch for each tool that fixes this by modifying the "find" statement to dereference symlinks (i also added a uniq, because sometimes it was getting multiple copies of the same file, after dereferencing).
Comment 1 Patrick McLean gentoo-dev 2006-04-10 13:02:29 UTC
Created attachment 84382 [details, diff]
dispatch-conf-deference-symlinks.patch

Patch to make dispatch-conf deference symlinks.
Comment 2 Patrick McLean gentoo-dev 2006-04-10 13:03:07 UTC
Created attachment 84383 [details, diff]
etc-update-derefence-symlinks.patch

Patch to make etc-update deference symlinks.
Comment 3 Zac Medico gentoo-dev 2006-04-11 02:32:55 UTC
Thanks.  These patches are in svn r3129 and r3130 for the next release.
Comment 4 Patrick McLean gentoo-dev 2006-04-11 10:58:52 UTC
Created attachment 84455 [details, diff]
dispatch-conf-better-symlink.patch

Better patch, the last one would get royally confused sometimes, this one seems to work better. This also adds a check if the ._cfg0000* file exists before trying to merge it. This should apply against a version with the previous patch already applied.
Comment 5 Zac Medico gentoo-dev 2006-04-11 13:40:43 UTC
(In reply to comment #4)
> Created an attachment (id=84455) [edit]
> dispatch-conf-better-symlink.patch

At a glance, that patch looks like it could make dispatch-conf more difficult to maintain.  It would be nicer if the os.realpath calls could be factored out and isolated somehow.

Comment 6 Zac Medico gentoo-dev 2006-04-11 14:01:20 UTC
What about the etc-update patch?  The `readlink -f` makes the original patch unknown, which probably leads to problems similar to those from the first dispatch-conf patch.
Comment 7 Patrick McLean gentoo-dev 2006-04-11 17:55:11 UTC
The etc-update patch doesn't suffer from the same problems, it seems to work fine. 

I only noticed the problems on the setup with symlinks, without the links there didn't seem to be the same problems.
Comment 8 Patrick McLean gentoo-dev 2006-04-28 19:17:25 UTC
Created attachment 85717 [details, diff]
dispatch-conf-find-fix.patch

I have tested this patch on multiple machines over a couple of weeks, the problem with the original was that I forgot that uniq only works on sorted lists, so I sort the output of the find before piping it into uniq to kill duplicate entries.

This shouldn't add any maintenance load and allows for symlinks in /etc.
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2007-08-09 08:20:03 UTC
*** Bug 149388 has been marked as a duplicate of this bug. ***
Comment 10 Alon Bar-Lev (RETIRED) gentoo-dev 2007-11-24 22:27:59 UTC
I also think there should be no difference between symbolic link and a directory.
I agree with Zac that it may cause recursive issues, but it makes configuration simpler.
For example, I use cross-compile environments which share the same state for many /etc/ folders. Portage creates the ._cfg* files but I need to update these by hand.
Thanks!
Comment 11 katabami 2010-11-20 03:33:12 UTC
FYI: Though it is not a direct solution, "etckeeper" manages files under git or bzr. It is requested in bug 216114.

With best regards.