All of lore.kernel.org
 help / color / mirror / Atom feed
* semanage and RHPL
@ 2006-07-12 20:09 Stephen Bennett
  2006-07-13 12:22 ` Stephen Smalley
  2006-07-17 19:40 ` Stephen Bennett
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Bennett @ 2006-07-12 20:09 UTC (permalink / raw)
  To: selinux

Hi,

After encountering some problems with modular policy in the released
toolchain packages, it was suggested to me that I try the svn
toolchain. I did this, and found that semanage and genhomedircon both
traceback when run, failing to import functions from rhpl.translate.
This package doesn't appear to be available in Gentoo's repository, and
a quick bit of searching suggests that it's a Red Hat-specific library.
Is this dependency intentional or desirable? If yes, where can we get
the sources to package it for other distros?

Thanks in advance for any input.

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: semanage and RHPL
  2006-07-12 20:09 semanage and RHPL Stephen Bennett
@ 2006-07-13 12:22 ` Stephen Smalley
  2006-07-17 19:40 ` Stephen Bennett
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Smalley @ 2006-07-13 12:22 UTC (permalink / raw)
  To: Stephen Bennett; +Cc: Daniel J Walsh, selinux

On Wed, 2006-07-12 at 21:09 +0100, Stephen Bennett wrote:
> Hi,
> 
> After encountering some problems with modular policy in the released
> toolchain packages, it was suggested to me that I try the svn
> toolchain. I did this, and found that semanage and genhomedircon both
> traceback when run, failing to import functions from rhpl.translate.
> This package doesn't appear to be available in Gentoo's repository, and
> a quick bit of searching suggests that it's a Red Hat-specific library.
> Is this dependency intentional or desirable? If yes, where can we get
> the sources to package it for other distros?
> 
> Thanks in advance for any input.

rhpl.translate is described as a "persistent global gettext service for
python programs".  Not sure why that is RH specific.

The source is available from the Fedora CVS tree
(http://cvs.fedora.redhat.com) as well as in the SRPMS.  You can grab it
via:
curl -O -R -S --fail --show-error http://cvs.fedora.redhat.com/repo/dist/rhpl/rhpl-0.187.tar.gz/7979e7677a5cb32c06d176052403c707/rhpl-0.187.tar.gz

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: semanage and RHPL
  2006-07-12 20:09 semanage and RHPL Stephen Bennett
  2006-07-13 12:22 ` Stephen Smalley
@ 2006-07-17 19:40 ` Stephen Bennett
  2006-07-27 20:18   ` Stephen Smalley
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Bennett @ 2006-07-17 19:40 UTC (permalink / raw)
  To: Stephen Bennett; +Cc: selinux

[-- Attachment #1: Type: text/plain, Size: 1332 bytes --]

Having investigated this some more and discussed it on IRC, it seems
that rhpl is only being used for one function (_), which it seems can
be replaced by Python's standard gettext interface. A patch to do this
is attached, tested with LC_* both unset and set to en_GB. semanage and
genhomedircon are known to work in these situations; the changes to the
other scripts are identical so they ought to work as well. Please
comment.

On Wed, 12 Jul 2006 21:09:09 +0100
Stephen Bennett <spb@gentoo.org> wrote:

> Hi,
> 
> After encountering some problems with modular policy in the released
> toolchain packages, it was suggested to me that I try the svn
> toolchain. I did this, and found that semanage and genhomedircon both
> traceback when run, failing to import functions from rhpl.translate.
> This package doesn't appear to be available in Gentoo's repository,
> and a quick bit of searching suggests that it's a Red Hat-specific
> library. Is this dependency intentional or desirable? If yes, where
> can we get the sources to package it for other distros?
> 
> Thanks in advance for any input.
> 
> -- 
> This message was distributed to subscribers of the selinux mailing
> list. If you no longer wish to subscribe, send mail to
> majordomo@tycho.nsa.gov with the words "unsubscribe selinux" without
> quotes as the message.
> 

[-- Attachment #2: policycoreutils-gettext.diff --]
[-- Type: text/x-patch, Size: 2654 bytes --]

Index: policycoreutils/semanage/semanage
===================================================================
--- policycoreutils/semanage/semanage   (revision 33)
+++ policycoreutils/semanage/semanage   (working copy)
@@ -23,8 +23,13 @@
 import os, sys, getopt
 import seobject
 import selinux
-from rhpl.translate import _, N_
+import gettext

+try:
+       gettext.install('policycoreutils')
+except:
+       pass
+
 is_mls_enabled=selinux.is_selinux_mls_enabled()

 if __name__ == '__main__':
Index: policycoreutils/semanage/seobject.py
===================================================================
--- policycoreutils/semanage/seobject.py        (revision 33)
+++ policycoreutils/semanage/seobject.py        (working copy)
@@ -23,8 +23,14 @@

 import pwd, string, selinux, tempfile, os, re, sys
 from semanage import *;
-from rhpl.translate import _, N_
+import gettext

+try:
+       t = gettext.translation('policycoreutils', '/usr/share/locale')
+       _ = t.ugettext
+except:
+       pass
+
 is_mls_enabled = selinux.is_selinux_mls_enabled()

 import syslog
Index: policycoreutils/audit2allow/audit2allow
===================================================================
--- policycoreutils/audit2allow/audit2allow     (revision 33)
+++ policycoreutils/audit2allow/audit2allow     (working copy)
@@ -27,8 +27,12 @@
 from avc import *

 if __name__ == '__main__':
-       from rhpl.translate import _, N_
        import commands, sys, os, getopt, selinux
+       import gettext
+       try:
+               gettext.install('policycoreutils')
+       except:
+               pass
        def get_mls_flag():
                if selinux.is_selinux_mls_enabled():
                        return "-M"
Index: policycoreutils/scripts/genhomedircon
===================================================================
--- policycoreutils/scripts/genhomedircon       (revision 33)
+++ policycoreutils/scripts/genhomedircon       (working copy)
@@ -26,7 +26,8 @@

 import sys, os, pwd, string, getopt, re
 from semanage import *;
-from rhpl.translate import _, N_
+import gettext
+gettext.install('policycoreutils')

 try:
        fd = open("/etc/shells", 'r')
Index: policycoreutils/scripts/chcat
===================================================================
--- policycoreutils/scripts/chcat       (revision 33)
+++ policycoreutils/scripts/chcat       (working copy)
@@ -24,8 +24,13 @@
 #
 import commands, sys, os, pwd, string, getopt, selinux
 import seobject
-from rhpl.translate import _, N_
+import gettext

+try:
+    gettext.install('policycoreutils')
+except:
+    pass
+
 def verify_users(users):
     for u in users:
         try:

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: semanage and RHPL
  2006-07-17 19:40 ` Stephen Bennett
@ 2006-07-27 20:18   ` Stephen Smalley
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Smalley @ 2006-07-27 20:18 UTC (permalink / raw)
  To: Stephen Bennett; +Cc: selinux

On Mon, 2006-07-17 at 20:40 +0100, Stephen Bennett wrote:
> Having investigated this some more and discussed it on IRC, it seems
> that rhpl is only being used for one function (_), which it seems can
> be replaced by Python's standard gettext interface. A patch to do this
> is attached, tested with LC_* both unset and set to en_GB. semanage and
> genhomedircon are known to work in these situations; the changes to the
> other scripts are identical so they ought to work as well. Please
> comment.

Thanks, merged upstream.

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-07-27 20:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-12 20:09 semanage and RHPL Stephen Bennett
2006-07-13 12:22 ` Stephen Smalley
2006-07-17 19:40 ` Stephen Bennett
2006-07-27 20:18   ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.