Summary: | Use python-provided st_flags to read flags instead of calling lgetflags | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Diego Elio Pettenò (RETIRED) <flameeyes> |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | bsd+disabled, osx |
Priority: | High | ||
Version: | 2.0 | ||
Hardware: | All | ||
OS: | FreeBSD | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 94637 | ||
Bug Blocks: | |||
Attachments: |
portage-2.0.51.22-nochflags.patch
2.0.51.22-chflags.patch 2.0.51.22-chflags.patch 2.0.51.22-chflags-bis.patch portage-2.0.53_rc2-stflags.patch |
Description
Diego Elio Pettenò (RETIRED)
2005-05-31 12:38:32 UTC
Created attachment 60296 [details, diff]
portage-2.0.51.22-nochflags.patch
Would it be possible to make some of those constants (st_flags & 0x0160016 and e[0] == 45) into human readable constants? The flags constant is something i don't know how to describe, it was took from hasproblems() function in bsd_chflags module. As for 51, it's just the error code for operation not supported, maybe I can declare a constant OperationNotSupported == 51 and then use that? 51? I only see 45 in the patch. I checked the errno module and found that 45 corresponds with EL2NSYNC (Level 2 not synchronized) and that 51 corresponds with EL2HLT (Level 2 halted) but does that make sense? I'd really expect something like ENOSYS or EINVAL... What does `python -c 'import errno; print errno.errorcode["45"]'` give you there? Whatever it is, that's probably what should be used. So, what's the status on bug #94637 then? though of something and wrote something else.. lately i'm being a bit confused, I know. Created attachment 60844 [details, diff]
2.0.51.22-chflags.patch
Updated patch
Created attachment 66075 [details, diff]
2.0.51.22-chflags.patch
Removed out the broken stuff and make 'freebsd' references changed to
'bsdutils' (hoping that py-freebsd's API is the one that will be used by other
modules, too).
Created attachment 66078 [details, diff]
2.0.51.22-chflags-bis.patch
New patch this time trying to avoid the ugly if to check if a file is not
writable.
This way isNotWritable can also be extended in future to carry other checks for
non-bsd flags.
Created attachment 69728 [details, diff]
portage-2.0.53_rc2-stflags.patch
Backing off from the idea of using py-freebsd, it turned out to be unpractical
as it doesn't provide support for other systems like dragonfly, so spb's module
is still the best shot.
This patch just uses st_flags from stat() struct instead of using lgetflags, as
python 2.4.1-r1 and will-be-2.4.2 supports that natively.
Okay never mind. |