From 96b2050c622bd0b28554dd2876ef68de14c78afe Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Dec 01 2011 20:58:16 +0000 Subject: Drop keyboard_backend.py and un-Require pyxf86config (#758709) --- diff --git a/sck-1.3.1-no-pyxf86config.patch b/sck-1.3.1-no-pyxf86config.patch new file mode 100644 index 0000000..34db967 --- /dev/null +++ b/sck-1.3.1-no-pyxf86config.patch @@ -0,0 +1,181 @@ +diff -up system-config-keyboard-1.3.1/src/keyboard_backend.py.jx system-config-keyboard-1.3.1/src/keyboard_backend.py +--- system-config-keyboard-1.3.1/src/keyboard_backend.py.jx 2009-07-26 18:32:19.000000000 -0400 ++++ system-config-keyboard-1.3.1/src/keyboard_backend.py 2011-12-01 15:54:28.235998250 -0500 +@@ -1,96 +0,0 @@ +-# +-# keyboard_backend.py - backend code for keyboard configuration +-# +-# Copyright (C) 2002, 2003 Red Hat, Inc. +-# Brent Fox +-# +-# Copyright (C) 2008 Lubomir Kundrak +-# +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or +-# (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +-# +- +-#!/usr/bin/python2.2 +- +-import sys +-import os +- +-class KeyboardBackend: +- +- def modifyXconfig(self, fullname, layout, model, variant, options): +- #import xf86config and make the necessary changes +- if os.access("/etc/X11/XF86Config", os.W_OK) or os.access("/etc/X11/xorg.conf", os.W_OK): +- import xf86config +- (xconfig, xconfigpath) = xf86config.readConfigFile() +- try: +- keyboard = xf86config.getCoreKeyboard(xconfig) +- except: +- xconfig.comment = "\n# This configuration file was broken by system-config-keyboard\n" +- keyboard = xf86config.XF86ConfInput (); +- keyboard.comment = "\n# Keyboard added by system-config-keyboard\n" +- keyboard.identifier = "Keyboard0" +- keyboard.driver = "kbd" +- keyboard.options.insert (xf86config.XF86Option("XkbModel", "pc101")) +- keyboard.options.insert (xf86config.XF86Option("XkbLayout", "us")) +- xconfig.input.insert (keyboard) +- if len(xconfig.layout) == 0: +- xconfig.layout.insert(xf86config.XF86ConfLayout()) +- +- xconfig.layout[0].inputs.insert (xf86config.XF86ConfInputref ("Keyboard0", "CoreKeyboard")); +- +- found = 0 +- for o in keyboard.options: +- if o.name == "XkbLayout": +- found = 1 +- +- if not found: +- #If there's not an XkbLayout option for some reason, create one +- option = xf86config.XF86Option("XkbLayout") +- keyboard.options.insert(option) +- +- found_variant = None +- found_options = None +- count = 0 +- for o in keyboard.options: +- if o.name == "XkbModel": +- o.val = model +- if o.name == "XkbLayout": +- o.val = layout +- if o.name == "XkbVariant": +- found_variant = 1 +- if variant == "": +- #remove variant here +- keyboard.options.remove(count) +- o.val = variant +- +- if o.name == "XkbOptions": +- found_options = 1 +- if options == "": +- #remove option here +- keyboard.options.remove(count) +- +- count = count + 1 +- +- if variant != "" and found_variant == None: +- #Need to create a XkbVariant entry +- opt = xf86config.XF86Option("XkbVariant", variant) +- keyboard.options.insert(opt) +- +- if options != "" and found_options == None: +- #Need to create an XkbOptions entry +- opt = xf86config.XF86Option("XkbOptions", options) +- keyboard.options.insert(opt) +- +- xconfig.write(xconfigpath) +- +diff -up system-config-keyboard-1.3.1/src/keyboard_cli.py.jx system-config-keyboard-1.3.1/src/keyboard_cli.py +--- system-config-keyboard-1.3.1/src/keyboard_cli.py.jx 2009-07-26 20:31:30.000000000 -0400 ++++ system-config-keyboard-1.3.1/src/keyboard_cli.py 2011-12-01 15:53:29.390000097 -0500 +@@ -21,15 +21,12 @@ + + import sys + import string +-import keyboard_backend + import system_config_keyboard.keyboard as keyboard + import gettext + + _ = gettext.gettext + gettext.textdomain('system-config-keyboard') + +-keyboardBackend = keyboard_backend.KeyboardBackend() +- + class childWindow: + def usage(self): + print _("""Usage: system-config-keyboard [--help] [--noui] [--text] [] +@@ -67,7 +64,6 @@ class childWindow: + self.kbd.set(kbdtype) + self.kbd.write() + self.kbd.activate() +- keyboardBackend.modifyXconfig(fullname, layout, model, variant, options) + else: + print (_("'%s' is an invalid keymap. Please run 'system-config-keyboard --help' " + "for a list of keymaps" % kbdtype)) +diff -up system-config-keyboard-1.3.1/src/keyboard_gui.py.jx system-config-keyboard-1.3.1/src/keyboard_gui.py +--- system-config-keyboard-1.3.1/src/keyboard_gui.py.jx 2011-11-30 14:38:11.000000000 -0500 ++++ system-config-keyboard-1.3.1/src/keyboard_gui.py 2011-12-01 15:54:01.257000089 -0500 +@@ -41,7 +41,6 @@ from firstboot.functions import * + from firstboot.module import * + + sys.path.append('/usr/share/system-config-keyboard') +-import keyboard_backend + + _ = gettext.gettext + gettext.textdomain('system-config-keyboard') +@@ -62,8 +61,6 @@ except: + except: + pass + +-keyboardBackend = keyboard_backend.KeyboardBackend() +- + # hack around the fact that scroll-to in the installer acts wierd + def setupTreeViewFixupIdleHandler(view, store): + id = {} +@@ -117,8 +114,6 @@ class moduleClass(Module): + # If the /etc/X11/XF86Config file exists, then change it's keyboard settings + fullname, layout, model, variant, options = self.kbdDict[self.kbd.get()] + +- keyboardBackend.modifyXconfig(fullname, layout, model, variant, options) +- + try: + #If we're in reconfig mode, this will fail because there is no self.mainWindow + self.mainWindow.destroy() +diff -up system-config-keyboard-1.3.1/src/keyboard_tui.py.jx system-config-keyboard-1.3.1/src/keyboard_tui.py +--- system-config-keyboard-1.3.1/src/keyboard_tui.py.jx 2009-07-26 21:20:04.000000000 -0400 ++++ system-config-keyboard-1.3.1/src/keyboard_tui.py 2011-12-01 15:53:58.874000023 -0500 +@@ -29,14 +29,11 @@ + + from snack import * + import gettext +-import keyboard_backend + import system_config_keyboard.keyboard as keyboard + + _ = gettext.gettext + gettext.textdomain('system-config-keyboard') + +-keyboardBackend = keyboard_backend.KeyboardBackend() +- + class KeyboardWindow: + def __call__(self, screen): + self.kbd = keyboard.Keyboard() +@@ -103,6 +100,5 @@ class childWindow: + kbd.write() + kbd.activate() + fullname, layout, model, variant, options = rc +- keyboardBackend.modifyXconfig(fullname, layout, model, variant, options) + DONE = 1 + diff --git a/system-config-keyboard.spec b/system-config-keyboard.spec index 7cd66d7..1758334 100644 --- a/system-config-keyboard.spec +++ b/system-config-keyboard.spec @@ -3,7 +3,7 @@ Name: system-config-keyboard Version: 1.3.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A graphical interface for modifying the keyboard Group: System Environment/Base @@ -19,13 +19,11 @@ BuildRequires: intltool Requires: python Requires: usermode >= 1.36 Requires: dbus-python -%ifnarch s390 s390x -Requires: pyxf86config -%endif Obsoletes: kbdconfig Obsoletes: redhat-config-keyboard Patch0: s-c-keyboard-do_not_remove_the_OK_button.patch +Patch1: sck-1.3.1-no-pyxf86config.patch %description @@ -36,6 +34,7 @@ the user to change the default keyboard of the system. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build make @@ -85,6 +84,9 @@ fi %changelog +* Thu Dec 01 2011 Adam Jackson 1.3.1-6 +- Drop keyboard_backend.py and un-Require pyxf86config (#758709) + * Thu Jun 16 2011 Toshio Kuratomi - 1.3.1-5 - Apply patches from itamarjp, landgraf, mschwendt to fix: - Needs pyhon-dbus: https://bugzilla.redhat.com/show_bug.cgi?id=708631