[PATCH 4/5] Get rid of unused isys.isCapsLockEnabled function

Vratislav Podzimek vpodzime at redhat.com
Tue Nov 19 11:50:28 UTC 2013


This function is no longer used anywhere in our codebase and it pulls in libX11
as a dependency.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 anaconda.spec.in            |  3 ---
 pyanaconda/isys/Makefile.am |  2 +-
 pyanaconda/isys/isys.c      | 26 --------------------------
 3 files changed, 1 insertion(+), 30 deletions(-)

diff --git a/anaconda.spec.in b/anaconda.spec.in
index 7e8c3b8..337df57 100755
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -52,9 +52,6 @@ BuildRequires: gobject-introspection-devel
 BuildRequires: glade-devel
 BuildRequires: pygobject3
 BuildRequires: intltool >= %{intltoolver}
-BuildRequires: libX11-devel
-BuildRequires: libXt-devel
-BuildRequires: libXxf86misc-devel
 BuildRequires: libgnomekbd-devel
 BuildRequires: libnl-devel >= %{libnlver}
 BuildRequires: libxklavier-devel
diff --git a/pyanaconda/isys/Makefile.am b/pyanaconda/isys/Makefile.am
index 454e2fc..21ac924 100644
--- a/pyanaconda/isys/Makefile.am
+++ b/pyanaconda/isys/Makefile.am
@@ -29,7 +29,7 @@ ISYS_CFLAGS = -DVERSION_RELEASE='"$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)"' \
               $(NETWORKMANAGER_CFLAGS) $(LIBNL_CFLAGS) $(LIBNM_GLIB_CFLAGS) \
               $(SELINUX_CFLAGS)
 ISYS_LIBS   = $(RESOLV_LIBS) $(ZLIB_LIBS) \
-              $(DEVMAPPER_LIBS) $(X11_LIBS) $(SELINUX_LIBS) \
+              $(DEVMAPPER_LIBS) $(SELINUX_LIBS) \
               $(LIBNL_LIBS) $(LIBNM_GLIB_LIBS)
 
 isysdir     = $(pkgpyexecdir)/isys
diff --git a/pyanaconda/isys/isys.c b/pyanaconda/isys/isys.c
index 6058678..ce81d1f 100644
--- a/pyanaconda/isys/isys.c
+++ b/pyanaconda/isys/isys.c
@@ -60,10 +60,6 @@
 #include <signal.h>
 #include <execinfo.h>
 
-#include <X11/Xlib.h>
-#include <X11/XKBlib.h>
-#include <X11/keysym.h>
-
 #ifdef MAJOR_IN_MKDEV
 #include <sys/mkdev.h>
 #endif
@@ -94,7 +90,6 @@ static PyObject * printObject(PyObject * s, PyObject * args);
 static PyObject * py_bind_textdomain_codeset(PyObject * o, PyObject * args);
 static PyObject * doSegvHandler(PyObject *s, PyObject *args);
 static PyObject * doAuditDaemon(PyObject *s);
-static PyObject * doIsCapsLockEnabled(PyObject * s, PyObject * args);
 static PyObject * doGetAnacondaVersion(PyObject * s, PyObject * args);
 static PyObject * doInitLog(PyObject * s);
 static PyObject * doTotalMemory(PyObject * s);
@@ -110,7 +105,6 @@ static PyMethodDef isysModuleMethods[] = {
     { "bind_textdomain_codeset", (PyCFunction) py_bind_textdomain_codeset, METH_VARARGS, NULL},
     { "handleSegv", (PyCFunction) doSegvHandler, METH_VARARGS, NULL },
     { "auditdaemon", (PyCFunction) doAuditDaemon, METH_NOARGS, NULL },
-    { "isCapsLockEnabled", (PyCFunction) doIsCapsLockEnabled, METH_VARARGS, NULL },
     { "getAnacondaVersion", (PyCFunction) doGetAnacondaVersion, METH_VARARGS, NULL },
     { "initLog", (PyCFunction) doInitLog, METH_VARARGS, NULL },
     { "total_memory", (PyCFunction) doTotalMemory, METH_NOARGS, NULL },
@@ -251,26 +245,6 @@ static PyObject * doAuditDaemon(PyObject *s) {
     return Py_None;
 }
 
-static PyObject * doIsCapsLockEnabled(PyObject * s, PyObject * args) {
-    Display *d = NULL;
-    XkbStateRec state;
-
-    if ((d = XOpenDisplay(NULL)) == NULL) {
-        PyErr_SetString(PyExc_RuntimeError, "XOpenDisplay failed");
-        return NULL;
-    }
-
-    memset(&state, 0, sizeof(state));
-    XkbGetState(d, XkbUseCoreKbd, &state);
-
-    if (XCloseDisplay(d)) {
-        PyErr_SetString(PyExc_RuntimeError, "XCloseDisplay failed");
-        return NULL;
-    }
-
-    return PyBool_FromLong(state.locked_mods & LockMask);
-}
-
 static PyObject * doGetAnacondaVersion(PyObject * s, PyObject * args) {
     return Py_BuildValue("s", VERSION_RELEASE);
 }
-- 
1.8.4.2



More information about the anaconda-patches mailing list