[policycoreutils] Fix sepolicy/__init__.py to handle _()

Daniel J Walsh dwalsh at fedoraproject.org
Tue Nov 27 21:35:23 UTC 2012


commit 5ffa11c17a32c59fca1095e1b3f899cecd8dab4d
Author: Dan Walsh <dwalsh at redhat.com>
Date:   Tue Nov 27 16:35:09 2012 -0500

    Fix sepolicy/__init__.py to handle _()

 policycoreutils-rhat.patch |   16 ++++++++++++++--
 policycoreutils.spec       |    5 ++++-
 2 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch
index 888e74c..369893d 100644
--- a/policycoreutils-rhat.patch
+++ b/policycoreutils-rhat.patch
@@ -338436,10 +338436,10 @@ index 0000000..2647bbc
 +        sys.exit(0)        
 diff --git a/policycoreutils/sepolicy/sepolicy/__init__.py b/policycoreutils/sepolicy/sepolicy/__init__.py
 new file mode 100644
-index 0000000..96a7251
+index 0000000..e43a2fb
 --- /dev/null
 +++ b/policycoreutils/sepolicy/sepolicy/__init__.py
-@@ -0,0 +1,124 @@
+@@ -0,0 +1,136 @@
 +#!/usr/bin/env python
 +
 +# Author: Thomas Liu <tliu at redhat.com>
@@ -338447,6 +338447,18 @@ index 0000000..96a7251
 +
 +import _policy
 +import selinux
++PROGNAME="policycoreutils"
++import gettext
++gettext.bindtextdomain(PROGNAME, "/usr/share/locale")
++gettext.textdomain(PROGNAME)
++try:
++    gettext.install(PROGNAME,
++                    localedir="/usr/share/locale",
++                    unicode=False,
++                    codeset = 'utf-8')
++except IOError:
++    import __builtin__
++    __builtin__.__dict__['_'] = unicode
 +
 +TYPE = _policy.TYPE
 +ROLE = _policy.ROLE
diff --git a/policycoreutils.spec b/policycoreutils.spec
index fec6d25..e331d3c 100644
--- a/policycoreutils.spec
+++ b/policycoreutils.spec
@@ -7,7 +7,7 @@
 Summary: SELinux policy core utilities
 Name:	 policycoreutils
 Version: 2.1.13
-Release: 35%{?dist}
+Release: 36%{?dist}
 License: GPLv2
 Group:	 System Environment/Base
 # Based on git repository with tag 20101221
@@ -338,6 +338,9 @@ The policycoreutils-restorecond package contains the restorecond service.
 %{_bindir}/systemctl try-restart restorecond.service >/dev/null 2>&1 || :
 
 %changelog
+* Tue Nov 27 2012 Dan Walsh <dwalsh at redhat.com> - 2.1.12-36
+- Fix sepolicy/__init__.py to handle _()
+
 * Wed Nov 21 2012 Dan Walsh <dwalsh at redhat.com> - 2.1.12-35
 - Add Miroslav Grepl patch to create etc_rw_t sock files policy
 


More information about the scm-commits mailing list