summaryrefslogtreecommitdiffstats
path: root/pym/portage/_selinux.py
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-08-15 18:13:18 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-08-15 18:13:18 +0000
commit74ecc5568944b42e38cd99a4c07a6249bc9a56ed (patch)
tree4afdd58d9462b0d2efe71edfa43810e42766b5d2 /pym/portage/_selinux.py
parent6a454b2769795983b0f91d341632782b2596ef0b (diff)
downloadportage-74ecc5568944b42e38cd99a4c07a6249bc9a56ed.tar.gz
portage-74ecc5568944b42e38cd99a4c07a6249bc9a56ed.tar.bz2
portage-74ecc5568944b42e38cd99a4c07a6249bc9a56ed.zip
Prepare 308 messages to localization.
svn path=/main/trunk/; revision=14067
Diffstat (limited to 'pym/portage/_selinux.py')
-rw-r--r--pym/portage/_selinux.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/pym/portage/_selinux.py b/pym/portage/_selinux.py
index e92c21fc9..71ec0a46e 100644
--- a/pym/portage/_selinux.py
+++ b/pym/portage/_selinux.py
@@ -8,6 +8,8 @@ import os
import shutil
import portage
+from portage.localization import _
+
import selinux
from selinux import is_selinux_enabled, getfilecon, lgetfilecon
@@ -16,7 +18,7 @@ def copyfile(src, dest):
dest = portage._unicode_encode(dest)
(rc, ctx) = selinux.lgetfilecon(src)
if rc < 0:
- raise OSError("copyfile: Failed getting context of \"%s\"." % src)
+ raise OSError(_("copyfile: Failed getting context of \"%s\".") % src)
setfscreate(ctx)
try:
@@ -27,7 +29,7 @@ def copyfile(src, dest):
def getcontext():
(rc, ctx) = selinux.getcon()
if rc < 0:
- raise OSError("getcontext: Failed getting current process context.")
+ raise OSError(_("getcontext: Failed getting current process context."))
return ctx
@@ -37,7 +39,7 @@ def mkdir(target, refdir):
(rc, ctx) = selinux.getfilecon(refdir)
if rc < 0:
raise OSError(
- "mkdir: Failed getting context of reference directory \"%s\"." \
+ _("mkdir: Failed getting context of reference directory \"%s\".") \
% refdir)
setfscreatecon(ctx)
@@ -51,7 +53,7 @@ def rename(src, dest):
dest = portage._unicode_encode(dest)
(rc, ctx) = selinux.lgetfilecon(src)
if rc < 0:
- raise OSError("rename: Failed getting context of \"%s\"." % src)
+ raise OSError(_("rename: Failed getting context of \"%s\".") % src)
setfscreate(ctx)
try:
@@ -68,13 +70,13 @@ def setexec(ctx="\n"):
if isinstance(ctx, unicode):
ctx = ctx.encode('utf_8', 'replace')
if selinux.setexeccon(ctx) < 0:
- raise OSError("setexec: Failed setting exec() context \"%s\"." % ctx)
+ raise OSError(_("setexec: Failed setting exec() context \"%s\".") % ctx)
def setfscreate(ctx="\n"):
ctx = portage._unicode_encode(ctx)
if selinux.setfscreatecon(ctx) < 0:
raise OSError(
- "setfscreate: Failed setting fs create context \"%s\"." % ctx)
+ _("setfscreate: Failed setting fs create context \"%s\".") % ctx)
def spawn_wrapper(spawn_func, selinux_type):
@@ -96,7 +98,7 @@ def symlink(target, link, reflnk):
(rc, ctx) = selinux.lgetfilecon(reflnk)
if rc < 0:
raise OSError(
- "symlink: Failed getting context of reference symlink \"%s\"." \
+ _("symlink: Failed getting context of reference symlink \"%s\".") \
% reflnk)
setfscreate(ctx)