OBS User unknown 2009-01-19 01:12:10 +00:00 committed by Git OBS Bridge
parent 176358f1f3
commit 506e5ba215
3 changed files with 120 additions and 2 deletions

108
man-db-2.5.2-fhs.dif Normal file
View File

@ -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 <unistd.h>
#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;
}

View File

@ -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

View File

@ -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)