pkgcore.fs.ops module¶
default fs ops.
Shouldn’t be accessed directly for the most part, use
pkgcore.plugins
to get at these ops.
- exception pkgcore.fs.ops.CannotOverwrite(obj, existing)[source]¶
Bases:
FailedCopy
- pkgcore.fs.ops.copyfile(obj, mkdirs=False)[source]¶
copy a
pkgcore.fs.fs.fsBase
to its stated location.- Parameters:
obj –
pkgcore.fs.fs.fsBase
instance, exemptingfsDir
- Returns:
true if success, else an exception is thrown
- Raises:
EnvironmentError – permission errors
- pkgcore.fs.ops.ensure_perms(d1, d2=None)[source]¶
Enforce a fs objects attributes on the livefs.
Attributes enforced are permissions, mtime, uid, gid.
- Parameters:
d2 – if not None, an fs object for what’s on the livefs now
- Returns:
True on success, else an exception is thrown
- Raises:
EnvironmentError – if fs object attributes can’t be enforced
- pkgcore.fs.ops.merge_contents(cset, offset=None, callback=None)[source]¶
merge a
pkgcore.fs.contents.contentsSet
instance to the livefs- Parameters:
cset –
pkgcore.fs.contents.contentsSet
instanceoffset – if not None, offset to prefix all locations with. Think of it as target dir.
callback – callable to report each entry being merged; given a single arg, the fs object being merged.
- Raises:
EnvironmentError – Thrown for permission failures.
- pkgcore.fs.ops.mkdir(d)[source]¶
mkdir for a fsDir object
- Parameters:
d –
pkgcore.fs.fs.fsDir
instance- Returns:
true if success, else an exception is thrown
- Raises:
EnvironmentError – if can’t complete
- pkgcore.fs.ops.unmerge_contents(cset, offset=None, callback=None)[source]¶
unmerge a
pkgcore.fs.contents.contentsSet
instance to the livefs- Parameters:
cset –
pkgcore.fs.contents.contentsSet
instanceoffset – if not None, offset to prefix all locations with. Think of it as target dir.
callback – callable to report each entry being unmerged
- Returns:
True, or an exception is thrown on failure (OSError, although see copyfile for specifics).
- Raises:
EnvironmentError – see
copyfile()
andmkdir()