[X2Go-Commits] [nx-libs] 01/14: Test for xkb/rules/base instead of xkb/keymap.dir for setting XkbBaseDir (302_nx-X11_xkbbasedir-detection.full.patch).

git-admin at x2go.org git-admin at x2go.org
Fri Feb 13 13:59:09 CET 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit 4dc1bd0043aed6b92526cbda26991be1f611a121
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Fri Feb 13 09:49:52 2015 +0100

    Test for xkb/rules/base instead of xkb/keymap.dir for setting XkbBaseDir (302_nx-X11_xkbbasedir-detection.full.patch).
    
      In recent (as of 2014/06) X.org release, the keymap.dir file
      has become obsolete. Let's test for the xkb/rules/base file
      instead.
---
 .../302_nx-X11_xkbbasedir-detection.full.patch     |   84 --------------------
 debian/patches/series                              |    1 -
 nx-X11/programs/Xserver/xkb/ddxLoad.c              |   32 ++++----
 3 files changed, 16 insertions(+), 101 deletions(-)

diff --git a/debian/patches/302_nx-X11_xkbbasedir-detection.full.patch b/debian/patches/302_nx-X11_xkbbasedir-detection.full.patch
deleted file mode 100644
index dac3d8a..0000000
--- a/debian/patches/302_nx-X11_xkbbasedir-detection.full.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-Description: Test for xkb/rules/base instead of xkb/keymap.dir for setting XkbBaseDir
-Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
-Abstract:
- In recent (as of 2014/06) X.org release, the keymap.dir file
- has become obsolete. Let's test for the xkb/rules/base file
- instead.
---- a/nx-X11/programs/Xserver/xkb/ddxLoad.c
-+++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c
-@@ -180,7 +180,7 @@
- 
- #define NX_XKB_BASE_DIRECTORY            "/usr/lib/X11/xkb"
- #define NX_XKB_ALTERNATE_BASE_DIRECTORY  "/usr/share/X11/xkb"
--#define NX_KEYMAP_DIR_FILE               "keymap.dir"
-+#define NX_XKB_RULES_BASE_FILE           "rules/base"
- #define NX_ALT_XKBCOMP_PATH              "/usr/bin"
- 
- static char _NXXkbBasePath[PATH_MAX];
-@@ -189,43 +189,43 @@
- static int NXVerifyXkbBaseDirectory(const char *dirPath)
- {
-   int size;
--  char *keymapDirFilePath;
--  struct stat keymapDirFileStat;
-+  char *rulesBaseFilePath;
-+  struct stat rulesBaseFileStat;
- 
-   /*
--   * If keymap.dir file
--   * is not present into
--   * Xkb Base Directory,
-+   * If rules/base file
-+   * is not present inside
-+   * the Xkb Base Directory,
-    * we suppose that the
-    * path is not valid.
-    */
- 
-   size = strlen(dirPath) + strlen("/") +
--             strlen(NX_KEYMAP_DIR_FILE) + 1;
-+             strlen(NX_XKB_RULES_BASE_FILE) + 1;
- 
--  if ((keymapDirFilePath = malloc((size + 1) * sizeof(char))) == NULL)
-+  if ((rulesBaseFilePath = malloc((size + 1) * sizeof(char))) == NULL)
-   {
-     FatalError("NXVerifyXkbBaseDirectory: malloc failed.\n");
-   }
- 
--  strcpy(keymapDirFilePath, dirPath);
--  strcat(keymapDirFilePath, "/");
--  strcat(keymapDirFilePath, NX_KEYMAP_DIR_FILE);
-+  strcpy(rulesBaseFilePath, dirPath);
-+  strcat(rulesBaseFilePath, "/");
-+  strcat(rulesBaseFilePath, NX_XKB_RULES_BASE_FILE);
- 
-   #ifdef TEST
-   fprintf(stderr, "NXVerifyXkbBaseDirectory: Looking for [%s] file.\n",
--              keymapDirFilePath);
-+              rulesBaseFilePath);
-   #endif
- 
--  if (stat(keymapDirFilePath, &keymapDirFileStat) != 0)
-+  if (stat(rulesBaseFilePath, &rulesBaseFileStat) != 0)
-   {
- 
-     #ifdef TEST
-     fprintf(stderr, "NXVerifyXkbBaseDirectory: Can't find the keymap.dir file [%s].\n",
--                keymapDirFilePath);
-+                rulesBaseFilePath);
-     #endif
- 
--    free(keymapDirFilePath);
-+    free(rulesBaseFilePath);
- 
-     return 0;
-   }
-@@ -235,7 +235,7 @@
-               dirPath);
-   #endif
- 
--  free(keymapDirFilePath);
-+  free(rulesBaseFilePath);
- 
-   return 1;
- }
diff --git a/debian/patches/series b/debian/patches/series
index a901010..5780128 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,3 @@
-302_nx-X11_xkbbasedir-detection.full.patch
 320_nxagent_configurable-keystrokes.full.patch
 321_nxagent_x2go-specific-keystroke-config.full.patch
 400_nxcomp-version.full+lite.patch
diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c b/nx-X11/programs/Xserver/xkb/ddxLoad.c
index e69d956..0b779b7 100644
--- a/nx-X11/programs/Xserver/xkb/ddxLoad.c
+++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c
@@ -180,7 +180,7 @@ Win32System(const char *cmdline)
 
 #define NX_XKB_BASE_DIRECTORY            "/usr/lib/X11/xkb"
 #define NX_XKB_ALTERNATE_BASE_DIRECTORY  "/usr/share/X11/xkb"
-#define NX_KEYMAP_DIR_FILE               "keymap.dir"
+#define NX_XKB_RULES_BASE_FILE           "rules/base"
 #define NX_ALT_XKBCOMP_PATH              "/usr/bin"
 
 static char _NXXkbBasePath[PATH_MAX];
@@ -189,43 +189,43 @@ static char _NXXkbCompPath[PATH_MAX];
 static int NXVerifyXkbBaseDirectory(const char *dirPath)
 {
   int size;
-  char *keymapDirFilePath;
-  struct stat keymapDirFileStat;
+  char *rulesBaseFilePath;
+  struct stat rulesBaseFileStat;
 
   /*
-   * If keymap.dir file
-   * is not present into
-   * Xkb Base Directory,
+   * If rules/base file
+   * is not present inside
+   * the Xkb Base Directory,
    * we suppose that the
    * path is not valid.
    */
 
   size = strlen(dirPath) + strlen("/") +
-             strlen(NX_KEYMAP_DIR_FILE) + 1;
+             strlen(NX_XKB_RULES_BASE_FILE) + 1;
 
-  if ((keymapDirFilePath = malloc((size + 1) * sizeof(char))) == NULL)
+  if ((rulesBaseFilePath = malloc((size + 1) * sizeof(char))) == NULL)
   {
     FatalError("NXVerifyXkbBaseDirectory: malloc failed.\n");
   }
 
-  strcpy(keymapDirFilePath, dirPath);
-  strcat(keymapDirFilePath, "/");
-  strcat(keymapDirFilePath, NX_KEYMAP_DIR_FILE);
+  strcpy(rulesBaseFilePath, dirPath);
+  strcat(rulesBaseFilePath, "/");
+  strcat(rulesBaseFilePath, NX_XKB_RULES_BASE_FILE);
 
   #ifdef TEST
   fprintf(stderr, "NXVerifyXkbBaseDirectory: Looking for [%s] file.\n",
-              keymapDirFilePath);
+              rulesBaseFilePath);
   #endif
 
-  if (stat(keymapDirFilePath, &keymapDirFileStat) != 0)
+  if (stat(rulesBaseFilePath, &rulesBaseFileStat) != 0)
   {
 
     #ifdef TEST
     fprintf(stderr, "NXVerifyXkbBaseDirectory: Can't find the keymap.dir file [%s].\n",
-                keymapDirFilePath);
+                rulesBaseFilePath);
     #endif
 
-    free(keymapDirFilePath);
+    free(rulesBaseFilePath);
 
     return 0;
   }
@@ -235,7 +235,7 @@ static int NXVerifyXkbBaseDirectory(const char *dirPath)
               dirPath);
   #endif
 
-  free(keymapDirFilePath);
+  free(rulesBaseFilePath);
 
   return 1;
 }

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list