gmrun makes it's own version of alphasort. However, as far as I can
tell, it's unecessary as it doesn't add anything new. By using the
alphasort provided by dirent.h I hope to avoid any sort of glibc
compatibility problems. I'm attaching the patch to this email.

diff -Nudar gmrun-0.9.2.orig/debian/control gmrun-0.9.2/debian/control
--- gmrun-0.9.2.orig/debian/control	2010-02-16 22:44:15.000000000 +0000
+++ gmrun-0.9.2/debian/control	2010-03-07 15:32:46.000000000 +0000
@@ -2,7 +2,7 @@
 Section: x11
 Priority: optional
 Maintainer: Alexandre De Dommelin <adedomme...@tuxz.net>
-Build-Depends: debhelper (>= 7), libgtk2.0-dev, libpopt-dev, libc6-dev (>= 2.10.2-2)
+Build-Depends: debhelper (>= 7), libgtk2.0-dev, libpopt-dev
 Standards-Version: 3.8.4
 Homepage: http://sourceforge.net/projects/gmrun/
 
diff -Nudar gmrun-0.9.2.orig/debian/patches/60-fix_gtkcompletionline.patch gmrun-0.9.2/debian/patches/60-fix_gtkcompletionline.patch
--- gmrun-0.9.2.orig/debian/patches/60-fix_gtkcompletionline.patch	2010-02-03 07:28:09.000000000 +0000
+++ gmrun-0.9.2/debian/patches/60-fix_gtkcompletionline.patch	2010-03-07 14:55:37.000000000 +0000
@@ -1,11 +1,11 @@
 # Description: Fixes FTBFS
-# Author: Brian M. Carlson <sand...@crustytoothpaste.ath.cx>
+# Author: Rafael Cunha de Almeida <raf...@kontesti.me>
 
 Index: gmrun-0.9.2/src/gtkcompletionline.cc
 ===================================================================
---- gmrun-0.9.2.orig/src/gtkcompletionline.cc	2010-02-03 12:35:27.879769704 +0800
-+++ gmrun-0.9.2/src/gtkcompletionline.cc	2010-02-03 12:35:45.837755945 +0800
-@@ -374,10 +374,7 @@
+--- gmrun-0.9.2.orig/src/gtkcompletionline.cc	2010-03-07 14:53:19.000000000 +0000
++++ gmrun-0.9.2/src/gtkcompletionline.cc	2010-03-07 14:53:53.000000000 +0000
+@@ -374,30 +374,6 @@
    return 0;
  }
  
@@ -13,7 +13,44 @@
 -  const struct dirent** a = (const struct dirent**)va;
 -  const struct dirent** b = (const struct dirent**)vb;
 -
-+int my_alphasort(const struct dirent** a, const struct dirent** b) {
-   const char* s1 = (*a)->d_name;
-   const char* s2 = (*b)->d_name;
+-  const char* s1 = (*a)->d_name;
+-  const char* s2 = (*b)->d_name;
+-
+-  int l1 = strlen(s1);
+-  int l2 = strlen(s2);
+-  int result = strcmp(s1, s2);
+-
+-  if (result == 0) return 0;
+-
+-  if (l1 < l2) {
+-    int res2 = strncmp(s1, s2, l1);
+-    if (res2 == 0) return -1;
+-  } else {
+-    int res2 = strncmp(s1, s2, l2);
+-    if (res2 == 0) return 1;
+-  }
+-
+-  return result;
+-}
+-
+ static void
+ generate_execs()
+ {
+@@ -405,7 +381,7 @@
  
+   for (StrSet::iterator i = path.begin(); i != path.end(); i++) {
+     struct dirent **eps;
+-    int n = scandir(i->c_str(), &eps, select_executables_only, my_alphasort);
++    int n = scandir(i->c_str(), &eps, select_executables_only, alphasort);
+     if (n >= 0) {
+       for (int j = 0; j < n; j++) {
+         execs.insert(eps[j]->d_name);
+@@ -505,7 +481,7 @@
+   dirlist.clear();
+   struct dirent **eps;
+   prefix = filename;
+-  n = scandir(dest.c_str(), &eps, select_executables_only, my_alphasort);
++  n = scandir(dest.c_str(), &eps, select_executables_only, alphasort);
+   if (n >= 0) {
+     for (int j = 0; j < n; j++) {
+       {

Reply via email to