man-db-2.6.1-so-links.patch 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. diff -up man-db-2.6.2/src/Makefile.am.so-links man-db-2.6.2/src/Makefile.am
  2. --- man-db-2.6.2/src/Makefile.am.so-links 2012-07-20 19:21:13.000000000 +0200
  3. +++ man-db-2.6.2/src/Makefile.am 2012-07-20 19:21:13.000000000 +0200
  4. @@ -87,6 +87,8 @@ lexgrog_SOURCES = \
  5. descriptions.h \
  6. filenames.c \
  7. filenames.h \
  8. + globbing.c \
  9. + globbing.h \
  10. lexgrog.l \
  11. lexgrog_test.c \
  12. manconv.c \
  13. diff -up man-db-2.6.2/src/Makefile.in.so-links man-db-2.6.2/src/Makefile.in
  14. --- man-db-2.6.2/src/Makefile.in.so-links 2012-07-20 19:21:13.000000000 +0200
  15. +++ man-db-2.6.2/src/Makefile.in 2012-07-20 19:21:39.000000000 +0200
  16. @@ -257,7 +257,7 @@ catman_DEPENDENCIES = $(am__DEPENDENCIES
  17. am_globbing_OBJECTS = globbing.$(OBJEXT) globbing_test.$(OBJEXT)
  18. globbing_OBJECTS = $(am_globbing_OBJECTS)
  19. globbing_DEPENDENCIES = $(am__DEPENDENCIES_1)
  20. -am_lexgrog_OBJECTS = compression.$(OBJEXT) descriptions.$(OBJEXT) \
  21. +am_lexgrog_OBJECTS = globbing.$(OBJEXT) compression.$(OBJEXT) descriptions.$(OBJEXT) \
  22. filenames.$(OBJEXT) lexgrog.$(OBJEXT) lexgrog_test.$(OBJEXT) \
  23. manconv.$(OBJEXT) manconv_client.$(OBJEXT) ult_src.$(OBJEXT)
  24. lexgrog_OBJECTS = $(am_lexgrog_OBJECTS)
  25. @@ -1356,6 +1356,8 @@ lexgrog_SOURCES = \
  26. descriptions.h \
  27. filenames.c \
  28. filenames.h \
  29. + globbing.c \
  30. + globbing.h \
  31. lexgrog.l \
  32. lexgrog_test.c \
  33. manconv.c \
  34. diff -up man-db-2.6.2/src/ult_src.c.so-links man-db-2.6.2/src/ult_src.c
  35. --- man-db-2.6.2/src/ult_src.c.so-links 2012-06-18 04:28:56.000000000 +0200
  36. +++ man-db-2.6.2/src/ult_src.c 2012-07-20 19:21:13.000000000 +0200
  37. @@ -59,6 +59,8 @@
  38. #include <unistd.h>
  39. #include "canonicalize.h"
  40. +#include "dirname.h"
  41. +#include "globbing.h"
  42. #include "gettext.h"
  43. #define _(String) gettext (String)
  44. @@ -343,6 +345,38 @@ const char *ult_src (const char *name, c
  45. free (base);
  46. base = appendstr (NULL, path, "/", include,
  47. NULL);
  48. +
  49. + /* If the original path from above doesn't exist, try to create
  50. + * new path as if the "include" was relative to the current
  51. + * man page.
  52. + */
  53. + if (access (base, F_OK) != 0) {
  54. + char *dirname = mdir_name (name);
  55. + char *tempFile = appendstr (NULL, dirname, "/", include,
  56. + NULL);
  57. + free (dirname);
  58. + if (access (tempFile, F_OK) == 0) {
  59. + free (base);
  60. + base = canonicalize_filename_mode (tempFile,
  61. + CAN_EXISTING);
  62. + } else {
  63. + char *tempFileAsterisk = appendstr (NULL, tempFile,
  64. + "*", NULL);
  65. + char **possibleFiles = expand_path (tempFileAsterisk);
  66. + free (tempFileAsterisk);
  67. + if (access (possibleFiles[0], F_OK) == 0) {
  68. + free (base);
  69. + base = canonicalize_filename_mode (possibleFiles[0],
  70. + CAN_EXISTING);
  71. + }
  72. + int i;
  73. + for (i = 0; possibleFiles[i] != NULL; i++) {
  74. + free (possibleFiles[i]);
  75. + }
  76. + free (possibleFiles);
  77. + }
  78. + free (tempFile);
  79. + }
  80. free (include);
  81. debug ("ult_src: points to %s\n", base);