From 506e5ba21533fbaba839823a95a87ff4dec684beb78a0bd6157766706c631f41 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 19 Jan 2009 01:12:10 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/man?expand=0&rev=27 --- man-db-2.5.2-fhs.dif | 108 +++++++++++++++++++++++++++++++++++++++++++ man.changes | 6 +++ man.spec | 8 +++- 3 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 man-db-2.5.2-fhs.dif diff --git a/man-db-2.5.2-fhs.dif b/man-db-2.5.2-fhs.dif new file mode 100644 index 0000000..5da121f --- /dev/null +++ b/man-db-2.5.2-fhs.dif @@ -0,0 +1,108 @@ +--- manual/files.me ++++ manual/files.me 2009-01-15 01:02:11.000000000 +0100 +@@ -135,9 +135,11 @@ manpath. + However, if the element is not mentioned in the config file, a man directory + relative to it will be sought. + The subdirectories +-.i ../man ++.i ../man , ++.i man , ++.i ../share/man , + or +-.i man ++.i share/man + relative to the path component are appended to the internal manpath if they + exist. + Finally, the internal manpath is stripped of duplicate paths before +--- src/manp.c ++++ src/manp.c 2009-01-15 01:02:11.000000000 +0100 +@@ -58,6 +58,7 @@ + #include + + #include "xgetcwd.h" ++#include "xvasprintf.h" + + #include "gettext.h" + #define _(String) gettext (String) +@@ -886,7 +887,8 @@ static char *def_path (int flag) + * directories listed in the man_db.config file. If so, and it is + * not already in the manpath, add it. If the directory is not listed + * in the man_db.config file, see if there is a subdirectory `../man' or +- * `man'. If so, and it is not already in the manpath, add it. ++ * `man', or, for FHS-compliance, `../share/man' or `share/man'. If so, ++ * and it is not already in the manpath, add it. + * Example: user has $HOME/bin in his path and the directory + * $HOME/man exists -- the directory $HOME/man will be added + * to the manpath. +@@ -941,13 +943,15 @@ static inline char *get_manpath_from_pat + + t = has_mandir (p); + if (t) { +- debug ("but does have a ../man or man " ++ debug ("but does have a ../man, man, " ++ "../share/man, or share/man " + "subdirectory\n"); + + add_dir_to_list (tmplist, t); + free (t); + } else +- debug ("and doesn't have ../man or man " ++ debug ("and doesn't have ../man, man, " ++ "../share/man, or share/man " + "subdirectories\n"); + } + } +@@ -1022,34 +1026,41 @@ static void add_dir_to_list (char **lp, + } + } + +-/* path does not exist in config file: check to see if path/../man or +- path/man exist. If so return it, if not return NULL. */ ++/* path does not exist in config file: check to see if path/../man, ++ path/man, path/../share/man, or path/share/man exist. If so return ++ it, if not return NULL. */ + static inline char *has_mandir (const char *path) + { +- char *newpath = NULL; ++ char *newpath; + + /* don't assume anything about path, especially that it ends in + "bin" or even has a '/' in it! */ + + char *subdir = strrchr (path, '/'); + if (subdir) { +- const int prefix_len = subdir + 1 - path; +- newpath = xmalloc (prefix_len + sizeof ("man") + 1); +- strncpy (newpath, path, prefix_len); +- strcpy (newpath + prefix_len, "man"); +- ++ newpath = xasprintf ("%.*s/man", subdir - path, path); + if (is_directory (newpath) == 1) + return newpath; +- else +- *newpath = '\0'; ++ free (newpath); + } + +- newpath = appendstr (newpath, path, "/man", NULL); +- ++ newpath = appendstr (NULL, path, "/man", NULL); + if (is_directory (newpath) == 1) + return newpath; ++ free (newpath); ++ ++ if (subdir) { ++ newpath = xasprintf ("%.*s/share/man", subdir - path, path); ++ if (is_directory (newpath) == 1) ++ return newpath; ++ free (newpath); ++ } + ++ newpath = appendstr (NULL, path, "/share/man", NULL); ++ if (is_directory (newpath) == 1) ++ return newpath; + free (newpath); ++ + return NULL; + } + diff --git a/man.changes b/man.changes index 0d3cb6f..6c7e1a9 100644 --- a/man.changes +++ b/man.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jan 16 17:03:24 CET 2009 - werner@suse.de + +- Add ../share/man/ to manpath expansion mentioned by + Matt_Domsch@dell.com, done for man_db by Colin Watson + ------------------------------------------------------------------- Fri Nov 28 13:15:30 CET 2008 - werner@suse.de diff --git a/man.spec b/man.spec index 084a8aa..472bc1e 100644 --- a/man.spec +++ b/man.spec @@ -1,7 +1,7 @@ # # spec file for package man (Version 2.5.2) # -# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -31,7 +31,7 @@ BuildRequires: gettext-runtime gettext-tools BuildRequires: gettext gettext-devel %endif Version: 2.5.2 -Release: 17 +Release: 18 Summary: A Program for Displaying man Pages License: GPL v2 or later Url: https://savannah.nongnu.org/projects/man-db @@ -57,6 +57,7 @@ Patch9: man-db-2.5.1-zio.dif Patch10: man-db-2.5.1-listall.dif Patch11: man-db-%{version}-catp.dif Patch12: man-db-2.5.2-fastpipe.dif +Patch13: man-db-2.5.2-fhs.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc @@ -285,6 +286,9 @@ test -d var/catman/ && rm -rf var/catman/ || true %{_localstatedir}/adm/fillup-templates/sysconfig.cron-man %changelog +* Fri Jan 16 2009 werner@suse.de +- Add ../share/man/ to manpath expansion mentioned by + Matt_Domsch@dell.com, done for man_db by Colin Watson * Fri Nov 28 2008 werner@suse.de - For listall patch: add support for multiple man pages in the same section (bnc#448283)