[man-db] - related: #693458 updated patch for .so links because previous one wasn't working very well

pschiffe pschiffe at fedoraproject.org
Tue Apr 24 17:27:23 UTC 2012


commit 44d2b4d4840199cfe885b97936f55bad402a2d0d
Author: Peter Schiffer <pschiffe at redhat.com>
Date:   Tue Apr 24 19:26:58 2012 +0200

    - related: #693458
      updated patch for .so links because previous one wasn't working very well

 man-db-2.6.1-so-links.patch |   71 +++++++++++++++++++++++++++++++++++-------
 man-db.spec                 |    6 +++-
 2 files changed, 64 insertions(+), 13 deletions(-)
---
diff --git a/man-db-2.6.1-so-links.patch b/man-db-2.6.1-so-links.patch
index 6c25c92..fbce71c 100644
--- a/man-db-2.6.1-so-links.patch
+++ b/man-db-2.6.1-so-links.patch
@@ -1,16 +1,63 @@
-diff -up man-db-2.6.1/src/ult_src.c.better_so man-db-2.6.1/src/ult_src.c
---- man-db-2.6.1/src/ult_src.c.better_so	2012-02-05 14:21:24.000000000 +0100
-+++ man-db-2.6.1/src/ult_src.c	2012-04-24 13:55:03.770469147 +0200
-@@ -345,6 +345,12 @@ const char *ult_src (const char *name, c
- 						  NULL);
- 				free (include);
+diff -upr man-db-2.6.1.orig/src/Makefile.am man-db-2.6.1/src/Makefile.am
+--- man-db-2.6.1.orig/src/Makefile.am	2012-04-24 18:47:20.023383735 +0200
++++ man-db-2.6.1/src/Makefile.am	2012-04-24 18:54:41.219294370 +0200
+@@ -87,6 +87,8 @@ lexgrog_SOURCES = \
+ 	descriptions.h \
+ 	filenames.c \
+ 	filenames.h \
++	globbing.c \
++	globbing.h \
+ 	lexgrog.l \
+ 	lexgrog_test.c \
+ 	manconv.c \
+diff -upr man-db-2.6.1.orig/src/ult_src.c man-db-2.6.1/src/ult_src.c
+--- man-db-2.6.1.orig/src/ult_src.c	2012-02-05 14:21:24.000000000 +0100
++++ man-db-2.6.1/src/ult_src.c	2012-04-24 19:13:20.499950083 +0200
+@@ -59,6 +59,8 @@
+ #include <unistd.h>
+ 
+ #include "canonicalize.h"
++#include "dirname.h"
++#include "globbing.h"
  
+ #include "gettext.h"
+ #define _(String) gettext (String)
+@@ -343,6 +345,38 @@ const char *ult_src (const char *name, c
+ 				free (base);
+ 				base = appendstr (NULL, path, "/", include,
+ 						  NULL);
++
++				/* If the original path from above doesn't exist, try to create
++				 * new path as if the "include" was relative to the current
++				 * man page.
++				 */
 +				if (access (base, F_OK) != 0) {
-+					debug ("ult_src: original path of .so link: %s doesn't exist\n",
-+							base);
-+					return NULL;
++					char *dirname = mdir_name (name);
++					char *tempFile = appendstr (NULL, dirname, "/", include,
++							NULL);
++					free (dirname);
++					if (access (tempFile, F_OK) == 0) {
++						free (base);
++						base = canonicalize_filename_mode (tempFile,
++								CAN_EXISTING);
++					} else {
++						char *tempFileAsterisk = appendstr (NULL, tempFile,
++								"*", NULL);
++						char **possibleFiles = expand_path (tempFileAsterisk);
++						free (tempFileAsterisk);
++						if (access (possibleFiles[0], F_OK) == 0) {
++							free (base);
++							base = canonicalize_filename_mode (possibleFiles[0],
++									CAN_EXISTING);
++						}
++						int i;
++						for (i = 0; possibleFiles[i] != NULL; i++) {
++							free (possibleFiles[i]);
++						}
++						free (possibleFiles);
++					}
++					free (tempFile);
 +				}
-+
- 				debug ("ult_src: points to %s\n", base);
+ 				free (include);
  
- 				recurse++;
+ 				debug ("ult_src: points to %s\n", base);
diff --git a/man-db.spec b/man-db.spec
index 755cc86..c3e0a90 100644
--- a/man-db.spec
+++ b/man-db.spec
@@ -3,7 +3,7 @@
 Summary: Tools for searching and reading man pages
 Name: man-db
 Version: 2.6.1
-Release: 3%{?dist}
+Release: 4%{?dist}
 # project man-db  GPLv2+
 # Gnulib part     GPLv3+
 License: GPLv2+ and GPLv3+
@@ -116,6 +116,10 @@ rm -rf $RPM_BUILD_ROOT
 %lang(it)   %{_datadir}/man/it/man*/*
 
 %changelog
+* Tue Apr 24 2012 Peter Schiffer <pschiffe at redhat.com> - 2.6.1-4
+- related: #693458
+  updated patch for .so links because previous one wasn't working very well
+
 * Tue Apr 24 2012 Peter Schiffer <pschiffe at redhat.com> - 2.6.1-3
 - added autoconf, automake, libtool and gettext-devel to the build requires
 


More information about the scm-commits mailing list