Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 69507 - Merging files with FreeBSD immutable flags
Summary: Merging files with FreeBSD immutable flags
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 65828
  Show dependency tree
 
Reported: 2004-10-30 07:50 UTC by Stephen Bennett (RETIRED)
Modified: 2005-03-03 12:20 UTC (History)
1 user (show)

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


Attachments
Patch against portage-2.0.51 (portage-2.0.51-bsd-flags.diff,7.70 KB, patch)
2004-10-30 07:51 UTC, Stephen Bennett (RETIRED)
Details | Diff
Updated patch (portage-2.0.51-bsd-flags-2.diff,7.83 KB, patch)
2004-12-26 18:21 UTC, Stephen Bennett (RETIRED)
Details | Diff
Updated patch (portage-2.0.51-bsd-flags-2.1.diff,9.50 KB, patch)
2005-01-08 17:18 UTC, Stephen Bennett (RETIRED)
Details | Diff
New patch (portage-2.0.51-bsd-flags-2.2.diff,239.89 KB, patch)
2005-01-15 18:05 UTC, Stephen Bennett (RETIRED)
Details | Diff
Updated (again) patch (portage-2.0.51-bsd-flags-2.3.diff,10.54 KB, patch)
2005-01-17 12:59 UTC, Stephen Bennett (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Bennett (RETIRED) gentoo-dev 2004-10-30 07:50:54 UTC
Portage currently has issues when it tries to merge a file where the destination has an immutable flag set (see http://www.freebsd.org/cgi/man.cgi?query=chflags&sektion=2 for some info on said flags). I've got a patch that should deal with these flags transparently as far as ebuilds are concerned, assuming that securelevel < 1 and immutable flags can be unset. Obviously, the other case (flags can't be unset) requires more work, but as per jstubbs' request I'm filing a bug with this patch.

The basic idea is to implement a python module in C that provides two functions: lchflags and lgetflags, to set and get flags. Obviously, that won't work on Linux (where the filesystems don't support them), so in that case it just assumes flags are always 0 (which is functionally correct). That way, the python code can just call lchflags() without worrying about whether or not it's actually implemented.

That's the theory; it's been tested on FreeBSD, and works, and compile tested on Linux, where it passes.
Comment 1 Stephen Bennett (RETIRED) gentoo-dev 2004-10-30 07:51:50 UTC
Created attachment 42909 [details, diff]
Patch against portage-2.0.51
Comment 2 Stephen Bennett (RETIRED) gentoo-dev 2004-12-26 18:21:16 UTC
Created attachment 46932 [details, diff]
Updated patch

Updated patch, addresses a few issues that carpaski had with the original.
Comment 3 Stephen Bennett (RETIRED) gentoo-dev 2005-01-08 17:18:21 UTC
Created attachment 47987 [details, diff]
Updated patch

OK, new patch. The previous version didn't take into account directories that
had immutable flags, since it didn't cross my mind that they could be
immutable. However, they can, and so we need to deal with it.
Comment 4 Stephen Bennett (RETIRED) gentoo-dev 2005-01-15 18:05:04 UTC
Created attachment 48610 [details, diff]
New patch

As carpaski suggested, move the problem flags check into the C module. Makes
for marginally cleaner python code and reduces a 200+-character line.
Comment 5 Stephen Bennett (RETIRED) gentoo-dev 2005-01-17 12:59:50 UTC
Created attachment 48777 [details, diff]
Updated (again) patch

OK, so last patch was dud, probably due to being made + uploaded at 3AM. This
one's been tested a bit more on linux + freebsd platforms.
Comment 6 Stephen Bennett (RETIRED) gentoo-dev 2005-03-03 12:20:26 UTC
In 2.0.51.19, now stable. Marking fixed.