From 5212c67f98e55a125b8205500a769ddb8e744412 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2019 14:37:25 +0000 Subject: import man-db-2.6.3-11.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fa7f371 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/man-db-2.6.3.tar.xz diff --git a/.man-db.metadata b/.man-db.metadata new file mode 100644 index 0000000..22a69de --- /dev/null +++ b/.man-db.metadata @@ -0,0 +1 @@ +9f549ac89f993303ac1203a165961885a53e7d14 SOURCES/man-db-2.6.3.tar.xz diff --git a/SOURCES/man-db-2.5.9-sgr.patch b/SOURCES/man-db-2.5.9-sgr.patch new file mode 100644 index 0000000..a41cd21 --- /dev/null +++ b/SOURCES/man-db-2.5.9-sgr.patch @@ -0,0 +1,24 @@ +diff -up man-db-2.5.9/include/manconfig.h.in.sgr man-db-2.5.9/include/manconfig.h.in +--- man-db-2.5.9/include/manconfig.h.in.sgr 2010-11-17 12:30:36.000000000 +0100 ++++ man-db-2.5.9/include/manconfig.h.in 2010-11-24 11:29:57.000000000 +0100 +@@ -128,7 +128,7 @@ + + #ifndef NROFF_MISSING + # ifndef NROFF +-# define NROFF "@nroff@" ++# define NROFF "@nroff@ -c" + # endif + #endif + +diff -up man-db-2.5.9/src/man_db.conf.in.sgr man-db-2.5.9/src/man_db.conf.in +--- man-db-2.5.9/src/man_db.conf.in.sgr 2009-03-15 13:17:24.000000000 +0100 ++++ man-db-2.5.9/src/man_db.conf.in 2010-11-24 11:27:45.000000000 +0100 +@@ -80,7 +80,7 @@ MANDB_MAP /opt/man /var/cache/man/opt + #DEFINE tr @tr@ '\255\267\264\327' '\055\157\047\170' + #DEFINE grep @grep@ + #DEFINE troff @troff@ +-#DEFINE nroff @nroff@ ++#DEFINE nroff @nroff@ -c + #DEFINE eqn @eqn@ + #DEFINE neqn @neqn@ + #DEFINE tbl @tbl@ diff --git a/SOURCES/man-db-2.6.1-locale-fallback.patch b/SOURCES/man-db-2.6.1-locale-fallback.patch new file mode 100644 index 0000000..e749d5a --- /dev/null +++ b/SOURCES/man-db-2.6.1-locale-fallback.patch @@ -0,0 +1,31 @@ +diff -upr man-db-2.6.1.orig/lib/encodings.c man-db-2.6.1/lib/encodings.c +--- man-db-2.6.1.orig/lib/encodings.c 2011-05-31 02:03:02.000000000 +0200 ++++ man-db-2.6.1/lib/encodings.c 2012-06-15 18:32:37.393496286 +0200 +@@ -585,14 +585,23 @@ char *find_charset_locale (const char *c + if (STREQ (charset, get_locale_charset ())) + return NULL; + +- supported = fopen (supported_path, "r"); +- if (!supported) +- return NULL; +- + saved_locale = setlocale (LC_CTYPE, NULL); + if (saved_locale) + saved_locale = xstrdup (saved_locale); + ++ supported = fopen (supported_path, "r"); ++ if (!supported) { ++ if (strlen (charset) >= (size_t) 5 ++ && strncmp (charset, "UTF-8", (size_t) 5) == 0) { ++ locale = xstrdup("en_US.UTF-8"); ++ if (setlocale (LC_CTYPE, locale)) { ++ setlocale (LC_CTYPE, saved_locale); ++ return locale; ++ } ++ } ++ return NULL; ++ } ++ + while (getline (&line, &n, supported) >= 0) { + const char *space = strchr (line, ' '); + if (space) { diff --git a/SOURCES/man-db-2.6.1-so-links.patch b/SOURCES/man-db-2.6.1-so-links.patch new file mode 100644 index 0000000..4bfc150 --- /dev/null +++ b/SOURCES/man-db-2.6.1-so-links.patch @@ -0,0 +1,84 @@ +diff -up man-db-2.6.2/src/Makefile.am.so-links man-db-2.6.2/src/Makefile.am +--- man-db-2.6.2/src/Makefile.am.so-links 2012-07-20 19:21:13.000000000 +0200 ++++ man-db-2.6.2/src/Makefile.am 2012-07-20 19:21:13.000000000 +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 -up man-db-2.6.2/src/Makefile.in.so-links man-db-2.6.2/src/Makefile.in +--- man-db-2.6.2/src/Makefile.in.so-links 2012-07-20 19:21:13.000000000 +0200 ++++ man-db-2.6.2/src/Makefile.in 2012-07-20 19:21:39.000000000 +0200 +@@ -257,7 +257,7 @@ catman_DEPENDENCIES = $(am__DEPENDENCIES + am_globbing_OBJECTS = globbing.$(OBJEXT) globbing_test.$(OBJEXT) + globbing_OBJECTS = $(am_globbing_OBJECTS) + globbing_DEPENDENCIES = $(am__DEPENDENCIES_1) +-am_lexgrog_OBJECTS = compression.$(OBJEXT) descriptions.$(OBJEXT) \ ++am_lexgrog_OBJECTS = globbing.$(OBJEXT) compression.$(OBJEXT) descriptions.$(OBJEXT) \ + filenames.$(OBJEXT) lexgrog.$(OBJEXT) lexgrog_test.$(OBJEXT) \ + manconv.$(OBJEXT) manconv_client.$(OBJEXT) ult_src.$(OBJEXT) + lexgrog_OBJECTS = $(am_lexgrog_OBJECTS) +@@ -1356,6 +1356,8 @@ lexgrog_SOURCES = \ + descriptions.h \ + filenames.c \ + filenames.h \ ++ globbing.c \ ++ globbing.h \ + lexgrog.l \ + lexgrog_test.c \ + manconv.c \ +diff -up man-db-2.6.2/src/ult_src.c.so-links man-db-2.6.2/src/ult_src.c +--- man-db-2.6.2/src/ult_src.c.so-links 2012-06-18 04:28:56.000000000 +0200 ++++ man-db-2.6.2/src/ult_src.c 2012-07-20 19:21:13.000000000 +0200 +@@ -59,6 +59,8 @@ + #include + + #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) { ++ 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); ++ } + free (include); + + debug ("ult_src: points to %s\n", base); diff --git a/SOURCES/man-db-2.6.1-wildcards.patch b/SOURCES/man-db-2.6.1-wildcards.patch new file mode 100644 index 0000000..dab4121 --- /dev/null +++ b/SOURCES/man-db-2.6.1-wildcards.patch @@ -0,0 +1,292 @@ +diff -upr man-db-2.6.3.orig/src/globbing.c man-db-2.6.3/src/globbing.c +--- man-db-2.6.3.orig/src/globbing.c 2010-09-26 23:08:14.000000000 +0200 ++++ man-db-2.6.3/src/globbing.c 2013-03-13 18:18:52.615033484 +0100 +@@ -427,3 +427,30 @@ char **look_for_file (const char *hier, + else + return gbuf.gl_pathv; + } ++ ++char **expand_path (const char *path) ++{ ++ int res = 0; ++ char **result = NULL; ++ glob_t globbuf; ++ ++ res = glob (path, 0, NULL, &globbuf); ++ /* if glob failed, return the given path */ ++ if (res != 0) { ++ result = (char **) xmalloc (2 * sizeof(char *)); ++ result[0] = xstrndup (path, strlen(path)); ++ result[1] = NULL; ++ return result; ++ } ++ ++ result = (char **) xmalloc ((globbuf.gl_pathc + 1) * sizeof(char *)); ++ size_t i; ++ for (i = 0; i < globbuf.gl_pathc; i++) { ++ result[i] = xstrndup (globbuf.gl_pathv[i], strlen (globbuf.gl_pathv[i])); ++ } ++ result[globbuf.gl_pathc] = NULL; ++ ++ globfree (&globbuf); ++ ++ return result; ++} +diff -upr man-db-2.6.3.orig/src/globbing.h man-db-2.6.3/src/globbing.h +--- man-db-2.6.3.orig/src/globbing.h 2008-12-11 00:06:18.000000000 +0100 ++++ man-db-2.6.3/src/globbing.h 2013-03-13 18:18:52.615033484 +0100 +@@ -29,3 +29,6 @@ enum look_for_file_opts { + /* globbing.c */ + extern char **look_for_file (const char *hier, const char *sec, + const char *unesc_name, int cat, int opts); ++ ++/* Expand path with wildcards into list of all existing directories. */ ++extern char **expand_path (const char *path); +diff -upr man-db-2.6.3.orig/src/Makefile.am man-db-2.6.3/src/Makefile.am +--- man-db-2.6.3.orig/src/Makefile.am 2012-02-05 14:25:20.000000000 +0100 ++++ man-db-2.6.3/src/Makefile.am 2013-03-13 18:18:52.617033454 +0100 +@@ -72,6 +72,8 @@ zsoelim_LDADD = $(LIBMAN) $(libpipeline_ + accessdb_SOURCES = \ + accessdb.c + catman_SOURCES = \ ++ globbing.c \ ++ globbing.h \ + catman.c \ + manp.c \ + manp.h +@@ -140,10 +142,14 @@ mandb_SOURCES = \ + ult_src.c \ + ult_src.h + manpath_SOURCES = \ ++ globbing.c \ ++ globbing.h \ + manp.c \ + manp.h \ + manpath.c + whatis_SOURCES = \ ++ globbing.c \ ++ globbing.h \ + manconv.c \ + manconv.h \ + manp.c \ +diff -upr man-db-2.6.3.orig/src/Makefile.in man-db-2.6.3/src/Makefile.in +--- man-db-2.6.3.orig/src/Makefile.in 2012-09-18 00:34:03.000000000 +0200 ++++ man-db-2.6.3/src/Makefile.in 2013-03-13 18:20:57.097203869 +0100 +@@ -251,7 +251,7 @@ accessdb_DEPENDENCIES = $(am__DEPENDENCI + AM_V_lt = $(am__v_lt_@AM_V@) + am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) + am__v_lt_0 = --silent +-am_catman_OBJECTS = catman.$(OBJEXT) manp.$(OBJEXT) ++am_catman_OBJECTS = globbing.$(OBJEXT) catman.$(OBJEXT) manp.$(OBJEXT) + catman_OBJECTS = $(am_catman_OBJECTS) + catman_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_2) + am_globbing_OBJECTS = globbing.$(OBJEXT) globbing_test.$(OBJEXT) +@@ -282,10 +282,10 @@ am_mandb_OBJECTS = check_mandirs.$(OBJEX + mandb_OBJECTS = $(am_mandb_OBJECTS) + mandb_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_2) +-am_manpath_OBJECTS = manp.$(OBJEXT) manpath.$(OBJEXT) ++am_manpath_OBJECTS = globbing.$(OBJEXT) manp.$(OBJEXT) manpath.$(OBJEXT) + manpath_OBJECTS = $(am_manpath_OBJECTS) + manpath_DEPENDENCIES = $(am__DEPENDENCIES_1) +-am_whatis_OBJECTS = manconv.$(OBJEXT) manp.$(OBJEXT) whatis.$(OBJEXT) ++am_whatis_OBJECTS = globbing.$(OBJEXT) manconv.$(OBJEXT) manp.$(OBJEXT) whatis.$(OBJEXT) + whatis_OBJECTS = $(am_whatis_OBJECTS) + whatis_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_2) +@@ -1339,6 +1339,8 @@ accessdb_SOURCES = \ + + catman_SOURCES = \ + catman.c \ ++ globbing.c \ ++ globbing.h \ + manp.c \ + manp.h + +@@ -1412,11 +1414,15 @@ mandb_SOURCES = \ + ult_src.h + + manpath_SOURCES = \ ++ globbing.c \ ++ globbing.h \ + manp.c \ + manp.h \ + manpath.c + + whatis_SOURCES = \ ++ globbing.c \ ++ globbing.h \ + manconv.c \ + manconv.h \ + manp.c \ +diff -upr man-db-2.6.3.orig/src/manp.c man-db-2.6.3/src/manp.c +--- man-db-2.6.3.orig/src/manp.c 2012-02-05 14:18:59.000000000 +0100 ++++ man-db-2.6.3/src/manp.c 2013-03-13 18:18:52.652032940 +0100 +@@ -75,6 +75,7 @@ + #endif + + #include "manp.h" ++#include "globbing.h" + + struct list { + char *key; +@@ -1035,32 +1036,45 @@ char *get_manpath_from_path (const char + static void add_dir_to_list (char **lp, const char *dir) + { + int status; +- int pos = 0; +- +- while (*lp != NULL) { +- if (pos > MAXDIRS - 1) +- gripe_overlong_list (); +- if (!strcmp (*lp, dir)) { +- debug ("%s is already in the manpath\n", dir); +- return; ++ int pos = 0, i = 0; ++ char *d = NULL; ++ char **expanded_dirs = NULL; ++ ++ expanded_dirs = expand_path (dir); ++ for (i = 0; expanded_dirs[i] != NULL; i++) { ++ d = expanded_dirs[i]; ++ ++ while (*lp != NULL) { ++ if (pos > MAXDIRS - 1) ++ gripe_overlong_list (); ++ if (!strcmp (*lp, d)) { ++ debug ("%s is already in the manpath\n", d); ++ goto done; ++ } ++ lp++; ++ pos++; + } +- lp++; +- pos++; +- } + +- /* Not found -- add it. */ ++ /* Not found -- add it. */ + +- status = is_directory (dir); ++ status = is_directory (d); + +- if (status < 0) +- gripe_stat_file (dir); +- else if (status == 0) +- gripe_not_directory (dir); +- else if (status == 1) { +- debug ("adding %s to manpath\n", dir); ++ if (status < 0) ++ gripe_stat_file (d); ++ else if (status == 0) ++ gripe_not_directory (d); ++ else if (status == 1) { ++ debug ("adding %s to manpath\n", d); + +- *lp = xstrdup (dir); ++ *lp = xstrdup (d); ++ } + } ++ ++done: ++ for (i = 0; expanded_dirs[i] != NULL; i++) { ++ free (expanded_dirs[i]); ++ } ++ free (expanded_dirs); + } + + /* path does not exist in config file: check to see if path/../man, +@@ -1104,33 +1118,44 @@ static inline char *has_mandir (const ch + + static char **add_dir_to_path_list (char **mphead, char **mp, const char *p) + { +- int status; ++ int status, i = 0; + char *cwd; ++ char *d = NULL; ++ char **expanded_dirs = NULL; + + if (mp - mphead > MAXDIRS - 1) + gripe_overlong_list (); + +- status = is_directory (p); +- +- if (status < 0) +- gripe_stat_file (p); +- else if (status == 0) +- gripe_not_directory (p); +- else { +- /* deal with relative paths */ ++ expanded_dirs = expand_path (p); ++ for (i = 0; expanded_dirs[i] != NULL; i++) { ++ d = expanded_dirs[i]; ++ ++ status = is_directory (d); ++ ++ if (status < 0) ++ gripe_stat_file (d); ++ else if (status == 0) ++ gripe_not_directory (d); ++ else { ++ /* deal with relative paths */ ++ ++ if (*d != '/') { ++ cwd = xgetcwd (); ++ if (!cwd) ++ error (FATAL, errno, ++ _("can't determine current directory")); ++ *mp = appendstr (cwd, "/", d, NULL); ++ } else ++ *mp = xstrdup (d); + +- if (*p != '/') { +- cwd = xgetcwd (); +- if (!cwd) +- error (FATAL, errno, +- _("can't determine current directory")); +- *mp = appendstr (cwd, "/", p, NULL); +- } else +- *mp = xstrdup (p); ++ debug ("adding %s to manpathlist\n", *mp); ++ mp++; ++ } + +- debug ("adding %s to manpathlist\n", *mp); +- mp++; ++ free (d); + } ++ free (expanded_dirs); ++ + return mp; + } + +diff -up man-db-2.6.3/src/tests/mandb-3.wildcards man-db-2.6.3/src/tests/mandb-3 +--- man-db-2.6.3/src/tests/mandb-3.wildcards 2010-11-14 23:11:27.000000000 +0100 ++++ man-db-2.6.3/src/tests/mandb-3 2013-03-21 16:20:24.735861291 +0100 +@@ -27,16 +27,16 @@ EOF + accessdb_filter "$tmpdir/usr/share/man/index$db_ext" >"$tmpdir/1.out" + expect_pass 'setup' 'diff -u "$tmpdir/1.exp" "$tmpdir/1.out"' + +-next_second +-echo '.so test.1' | gzip -9c >"$tmpdir/usr/share/man/man1/testlink.1.gz" +-MANPATH="$tmpdir/usr/share/man" run $MANDB -C "$tmpdir/manpath.config" -u -q \ +- "$tmpdir/usr/share/man" +-cat >"$tmpdir/2.exp" < "- 1 1 MTIME A - - gz test page" +-testlink -> "- 1 1 MTIME C test - gz " +-EOF +-accessdb_filter "$tmpdir/usr/share/man/index$db_ext" >"$tmpdir/2.out" +-expect_pass 'broken whatis' 'diff -u "$tmpdir/2.exp" "$tmpdir/2.out"' ++#next_second ++#echo '.so test.1' | gzip -9c >"$tmpdir/usr/share/man/man1/testlink.1.gz" ++#MANPATH="$tmpdir/usr/share/man" run $MANDB -C "$tmpdir/manpath.config" -u -q \ ++# "$tmpdir/usr/share/man" ++#cat >"$tmpdir/2.exp" < "- 1 1 MTIME A - - gz test page" ++#testlink -> "- 1 1 MTIME C test - gz " ++#EOF ++#accessdb_filter "$tmpdir/usr/share/man/index$db_ext" >"$tmpdir/2.out" ++#expect_pass 'broken whatis' 'diff -u "$tmpdir/2.exp" "$tmpdir/2.out"' + + next_second + MANPATH="$tmpdir/usr/share/man" LC_ALL=C run $MANDB \ diff --git a/SOURCES/man-db-2.6.2-invalid-cache.patch b/SOURCES/man-db-2.6.2-invalid-cache.patch new file mode 100644 index 0000000..f0708a1 --- /dev/null +++ b/SOURCES/man-db-2.6.2-invalid-cache.patch @@ -0,0 +1,123 @@ +diff -upr man-db-2.6.2.orig/src/check_mandirs.c man-db-2.6.2/src/check_mandirs.c +--- man-db-2.6.2.orig/src/check_mandirs.c 2011-07-09 20:53:38.000000000 +0200 ++++ man-db-2.6.2/src/check_mandirs.c 2012-07-31 13:05:45.967640117 +0200 +@@ -190,8 +190,7 @@ void test_manfile (const char *file, con + comp extensions */ + abs_filename = make_filename (path, NULL, + exists, "man"); +- debug ("test_manfile(): stat %s\n", abs_filename); +- if (stat (abs_filename, &physical) == -1) { ++ if (abs_filename == NULL || stat (abs_filename, &physical) == -1) { + if (!opt_test) + dbdelete (manpage_base, exists); + } else { +diff -upr man-db-2.6.2.orig/src/filenames.c man-db-2.6.2/src/filenames.c +--- man-db-2.6.2.orig/src/filenames.c 2011-10-09 01:19:00.000000000 +0200 ++++ man-db-2.6.2/src/filenames.c 2012-07-31 12:31:10.436885216 +0200 +@@ -27,6 +27,7 @@ + + #include + #include ++#include + + #include "xvasprintf.h" + +@@ -61,6 +62,11 @@ char *make_filename (const char *path, c + if (in->comp && *in->comp != '-') /* Is there an extension? */ + file = appendstr (file, ".", in->comp, NULL); + ++ if (access (file, R_OK) != 0) { ++ free (file); ++ return NULL; ++ } ++ + return file; + } + +diff -upr man-db-2.6.2.orig/src/man.c man-db-2.6.2/src/man.c +--- man-db-2.6.2.orig/src/man.c 2012-05-15 01:24:17.000000000 +0200 ++++ man-db-2.6.2/src/man.c 2012-07-31 13:04:48.629069419 +0200 +@@ -3103,6 +3103,9 @@ static int add_candidate (struct candida + name = req_name; + + filename = make_filename (path, name, source, cat ? "cat" : "man"); ++ if (filename == NULL) { ++ return 0; ++ } + ult = ult_src (filename, path, NULL, + get_ult_flags (from_db, source->id), NULL); + free (filename); +@@ -3309,6 +3312,9 @@ static int display_filesystem (struct ca + { + char *filename = make_filename (candp->path, NULL, candp->source, + candp->cat ? "cat" : "man"); ++ if (filename == NULL) { ++ return 0; ++ } + /* source->name is never NULL thanks to add_candidate() */ + char *title = appendstr (NULL, candp->source->name, + "(", candp->source->ext, ")", NULL); +@@ -3392,14 +3398,14 @@ static int display_database (struct cand + + if (in->id < STRAY_CAT) { /* There should be a src page */ + file = make_filename (candp->path, name, in, "man"); +- debug ("Checking physical location: %s\n", file); ++ if (file != NULL) { ++ debug ("Checking physical location: %s\n", file); + +- if (access (file, R_OK) == 0) { + const char *man_file; + char *cat_file; + + man_file = ult_src (file, candp->path, NULL, +- get_ult_flags (1, in->id), NULL); ++ get_ult_flags (1, in->id), NULL); + if (man_file == NULL) { + free (title); + return found; /* zero */ +@@ -3416,7 +3422,7 @@ static int display_database (struct cand + free (lang); + lang = NULL; + } /* else {drop through to the bottom and return 0 anyway} */ +- } else ++ } else + + #endif /* NROFF_MISSING */ + +@@ -3441,9 +3447,9 @@ static int display_database (struct cand + } + + file = make_filename (candp->path, name, in, "cat"); +- debug ("Checking physical location: %s\n", file); +- +- if (access (file, R_OK) != 0) { ++ if (file != NULL) { ++ debug ("Checking physical location: %s\n", file); ++ } else { + char *catpath; + catpath = get_catpath (candp->path, + global_manpath ? SYSTEM_CAT +@@ -3453,10 +3459,10 @@ static int display_database (struct cand + file = make_filename (catpath, name, + in, "cat"); + free (catpath); +- debug ("Checking physical location: %s\n", +- file); +- +- if (access (file, R_OK) != 0) { ++ if (file != NULL) { ++ debug ("Checking physical location: %s\n", ++ file); ++ } else { + /* don't delete here, + return==0 will do that */ + free (title); +@@ -3520,6 +3526,8 @@ static int maybe_update_file (const char + real_name = name; + + file = make_filename (manpath, real_name, info, "man"); ++ if (file == NULL) ++ return 0; + if (lstat (file, &buf) != 0) + return 0; + if (buf.st_mtime == info->_st_mtime) diff --git a/SOURCES/man-db-2.6.3-easter-egg.patch b/SOURCES/man-db-2.6.3-easter-egg.patch new file mode 100644 index 0000000..bf5e92a --- /dev/null +++ b/SOURCES/man-db-2.6.3-easter-egg.patch @@ -0,0 +1,34 @@ +From b2cf10cb8df0d6c9b66547f8b98b73f9055c7376 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nikola=20Forr=C3=B3?= +Date: Wed, 22 Nov 2017 14:42:33 +0100 +Subject: [PATCH] Remove Easter egg entirely + +Six years is a reasonable shelf life for a joke, but I think its time +has passed now. + +* src/man.c (main): Remove Easter egg. +--- + src/man.c | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/src/man.c b/src/man.c +index 5a72e1f..20d5a5e 100644 +--- a/src/man.c ++++ b/src/man.c +@@ -1158,13 +1158,6 @@ int main (int argc, char *argv[]) + debug ("\nusing %s as pager\n", pager); + + if (first_arg == argc) { +- /* http://twitter.com/#!/marnanel/status/132280557190119424 */ +- time_t now = time (NULL); +- struct tm *localnow = localtime (&now); +- if (localnow && +- localnow->tm_hour == 0 && localnow->tm_min == 30) +- fprintf (stderr, "gimme gimme gimme\n"); +- + if (print_where) { + manp = get_manpath (""); + printf ("%s\n", manp); +-- +2.13.6 + diff --git a/SOURCES/man-db-2.6.3-gcc.patch b/SOURCES/man-db-2.6.3-gcc.patch new file mode 100644 index 0000000..6f1759d --- /dev/null +++ b/SOURCES/man-db-2.6.3-gcc.patch @@ -0,0 +1,28 @@ +diff -up man-db-2.6.3/src/check_mandirs.c.gcc man-db-2.6.3/src/check_mandirs.c +--- man-db-2.6.3/src/check_mandirs.c.gcc 2013-03-18 13:56:24.000000000 +0100 ++++ man-db-2.6.3/src/check_mandirs.c 2013-03-18 14:03:20.081132550 +0100 +@@ -440,7 +440,10 @@ static int testmandirs (const char *path + return 0; + } + +- chdir (path); ++ if (chdir (path) != 0) { ++ error (0, errno, _("can't change to directory %s"), path); ++ return 0; ++ } + + while( (mandir = readdir (dir)) ) { + if (strncmp (mandir->d_name, "man", 3) != 0) +diff -up man-db-2.6.3/src/descriptions_store.c.gcc man-db-2.6.3/src/descriptions_store.c +--- man-db-2.6.3/src/descriptions_store.c.gcc 2011-04-10 03:02:26.000000000 +0200 ++++ man-db-2.6.3/src/descriptions_store.c 2013-03-18 13:53:03.889580350 +0100 +@@ -71,7 +71,7 @@ void store_descriptions (const struct pa + + if (trace) { + for (i = 0; i < trace->len; ++i) +- debug ("trace->names[%d] = '%s'\n", ++ debug ("trace->names[%zu] = '%s'\n", + i, trace->names[i]); + } + +diff -up man-db-2.6.3/src/man.c.gcc man-db-2.6.3/src/man.c diff --git a/SOURCES/man-db-2.6.3-man-options.patch b/SOURCES/man-db-2.6.3-man-options.patch new file mode 100644 index 0000000..b4a227f --- /dev/null +++ b/SOURCES/man-db-2.6.3-man-options.patch @@ -0,0 +1,230 @@ +diff -upr man-db-2.6.3.orig/man/man1/apropos.man1 man-db-2.6.3/man/man1/apropos.man1 +--- man-db-2.6.3.orig/man/man1/apropos.man1 2012-02-05 00:36:40.000000000 +0100 ++++ man-db-2.6.3/man/man1/apropos.man1 2013-04-08 14:50:51.655718887 +0200 +@@ -14,7 +14,7 @@ + %apropos% \- search the manual page names and descriptions + .SH SYNOPSIS + .B %apropos% +-.RB [\| \-dalhvV \|] ++.RB [\| \-dalv?V \|] + .RB [\| \-e \||\| \-w \||\| \-r\c + \|] + .RB [\| \-s +@@ -181,9 +181,12 @@ determined locale. + Use this user configuration file rather than the default of + .IR ~/.manpath . + .TP +-.if !'po4a'hide' .BR \-h ", " \-\-help ++.if !'po4a'hide' .BR \-? ", " \-\-help + Print a help message and exit. + .TP ++.if !'po4a'hide' .BR \-\-usage ++Print a short usage message and exit. ++.TP + .if !'po4a'hide' .BR \-V ", " \-\-version + Display version information. + .SH "EXIT STATUS" +diff -upr man-db-2.6.3.orig/man/man1/lexgrog.man1 man-db-2.6.3/man/man1/lexgrog.man1 +--- man-db-2.6.3.orig/man/man1/lexgrog.man1 2012-02-05 00:36:40.000000000 +0100 ++++ man-db-2.6.3/man/man1/lexgrog.man1 2013-04-08 14:53:33.021148065 +0200 +@@ -12,7 +12,7 @@ lexgrog \- parse header information in m + .SH SYNOPSIS + .B lexgrog + .RB [\| \-m \||\| -c \|] +-.RB [\| \-fhwV \|] ++.RB [\| \-dfw?V \|] + .RB [\| \-E + .IR encoding \|] + .I file +@@ -44,6 +44,9 @@ input files is \(lq\-\(rq, it will read + file is compressed, a decompressed version will be read automatically. + .SH OPTIONS + .TP ++.if !'po4a'hide' .BR \-d ", " \-\-debug ++Print debugging information. ++.TP + .if !'po4a'hide' .BR \-m ", " \-\-man + Parse input as man page source files. + This is the default if neither +@@ -81,9 +84,12 @@ or + Override the guessed character set for the page to + .IR encoding . + .TP +-.if !'po4a'hide' .BR \-h ", " \-\-help ++.if !'po4a'hide' .BR \-? ", " \-\-help + Print a help message and exit. + .TP ++.if !'po4a'hide' .BR \-\-usage ++Print a short usage message and exit. ++.TP + .if !'po4a'hide' .BR \-V ", " \-\-version + Display version information. + .SH "EXIT STATUS" +diff -upr man-db-2.6.3.orig/man/man1/man.man1 man-db-2.6.3/man/man1/man.man1 +--- man-db-2.6.3.orig/man/man1/man.man1 2012-02-05 00:36:40.000000000 +0100 ++++ man-db-2.6.3/man/man1/man.man1 2013-04-08 14:56:47.286033116 +0200 +@@ -146,7 +146,7 @@ + .\" --help and --version + .br + .B %man% +-.RB [\| \-hV \|] ++.RB [\| \-?V \|] + .SH DESCRIPTION + .B %man% + is the system's manual pager. Each +@@ -622,7 +622,7 @@ before displaying the error message, it + option was supplied, using the name as a filename and looking for an + exact match. + .TP +-.if !'po4a'hide' .BR \-w ", " \-\-where ", " \-\-location ++.if !'po4a'hide' .BR \-w ", " \-\-where ", " \-\-path ", " \-\-location + Don't actually display the manual pages, but do print the location(s) of + the source nroff files that would be formatted. + .TP +@@ -1148,9 +1148,12 @@ It implies + .BR \-t . + .SS "Getting help" + .TP +-.if !'po4a'hide' .BR \-h ", " \-\-help ++.if !'po4a'hide' .BR \-? ", " \-\-help + Print a help message and exit. + .TP ++.if !'po4a'hide' .BR \-\-usage ++Print a short usage message and exit. ++.TP + .if !'po4a'hide' .BR \-V ", " \-\-version + Display version information. + .SH "EXIT STATUS" +diff -upr man-db-2.6.3.orig/man/man1/manpath.man1 man-db-2.6.3/man/man1/manpath.man1 +--- man-db-2.6.3.orig/man/man1/manpath.man1 2012-02-05 00:36:40.000000000 +0100 ++++ man-db-2.6.3/man/man1/manpath.man1 2013-04-08 15:04:06.597117555 +0200 +@@ -14,7 +14,7 @@ + %manpath% \- determine search path for manual pages + .SH SYNOPSIS + .B %manpath% +-.RB [\| \-qgdchV \|] ++.RB [\| \-qgdc?V \|] + .RB [\| \-m + .IR system \|[\|,.\|.\|.\|]\|] + .RB [\| \-C +@@ -87,9 +87,12 @@ environment variable. + Use this user configuration file rather than the default of + .IR ~/.manpath . + .TP +-.if !'po4a'hide' .BR \-h ", " \-\-help ++.if !'po4a'hide' .BR \-? ", " \-\-help + Print a help message and exit. + .TP ++.if !'po4a'hide' .BR \-\-usage ++Print a short usage message and exit. ++.TP + .if !'po4a'hide' .BR \-V ", " \-\-version + Display version information. + .SH ENVIRONMENT +diff -upr man-db-2.6.3.orig/man/man1/whatis.man1 man-db-2.6.3/man/man1/whatis.man1 +--- man-db-2.6.3.orig/man/man1/whatis.man1 2012-02-05 00:36:40.000000000 +0100 ++++ man-db-2.6.3/man/man1/whatis.man1 2013-04-08 15:04:51.455417497 +0200 +@@ -14,7 +14,7 @@ + %whatis% \- display manual page descriptions + .SH SYNOPSIS + .B %whatis% +-.RB [\| \-dlhvV \|] ++.RB [\| \-dlv?V \|] + .RB [\| \-r \||\| \-w\c + \|] + .RB [\| \-s +@@ -185,9 +185,12 @@ determined locale. + Use this user configuration file rather than the default of + .IR ~/.manpath . + .TP +-.if !'po4a'hide' .BR \-h ", " \-\-help ++.if !'po4a'hide' .BR \-? ", " \-\-help + Print a help message and exit. + .TP ++.if !'po4a'hide' .BR \-\-usage ++Print a short usage message and exit. ++.TP + .if !'po4a'hide' .BR \-V ", " \-\-version + Display version information. + .SH "EXIT STATUS" +diff -upr man-db-2.6.3.orig/man/man8/accessdb.man8 man-db-2.6.3/man/man8/accessdb.man8 +--- man-db-2.6.3.orig/man/man8/accessdb.man8 2011-06-06 11:29:21.000000000 +0200 ++++ man-db-2.6.3/man/man8/accessdb.man8 2013-04-08 15:05:40.593651559 +0200 +@@ -15,7 +15,7 @@ accessdb \- dumps the content of a man-d + format + .SH SYNOPSIS + .B /usr/sbin/accessdb +-.RB [\| \-hV \|] ++.RB [\| \-d?V \|] + .RI [ ] + .SH DESCRIPTION + .B accessdb +@@ -42,9 +42,15 @@ zsoelim -> "1 1 795981543 A - - satisfy + .fi + .SH OPTIONS + .TP +-.if !'po4a'hide' .BR \-h ", " \-\-help ++.if !'po4a'hide' .BR \-d ", " \-\-debug ++Print debugging information. ++.TP ++.if !'po4a'hide' .BR \-? ", " \-\-help + Print a help message and exit. + .TP ++.if !'po4a'hide' .BR \-\-usage ++Print a short usage message and exit. ++.TP + .if !'po4a'hide' .BR \-V ", " \-\-version + Display version information. + .SH AUTHOR +diff -upr man-db-2.6.3.orig/man/man8/catman.man8 man-db-2.6.3/man/man8/catman.man8 +--- man-db-2.6.3.orig/man/man8/catman.man8 2012-02-05 00:36:40.000000000 +0100 ++++ man-db-2.6.3/man/man8/catman.man8 2013-04-08 15:06:08.785212520 +0200 +@@ -14,7 +14,7 @@ + %catman% \- create or update the pre-formatted manual pages + .SH SYNOPSIS + .B %catman% +-.RB [\| \-dhV \|] ++.RB [\| \-d?V \|] + .RB [\| \-M + .IR path \|] + .RB [\| \-C +@@ -66,9 +66,12 @@ in the man-db configuration file. + Use this user configuration file rather than the default of + .IR ~/.manpath . + .TP +-.if !'po4a'hide' .BR \-h ", " \-\-help ++.if !'po4a'hide' .BR \-? ", " \-\-help + Print a help message and exit. + .TP ++.if !'po4a'hide' .BR \-\-usage ++Print a short usage message and exit. ++.TP + .if !'po4a'hide' .BR \-V ", " \-\-version + Display version information. + .SH ENVIRONMENT +diff -upr man-db-2.6.3.orig/man/man8/mandb.man8 man-db-2.6.3/man/man8/mandb.man8 +--- man-db-2.6.3.orig/man/man8/mandb.man8 2012-02-05 00:36:40.000000000 +0100 ++++ man-db-2.6.3/man/man8/mandb.man8 2013-04-08 15:07:02.984369201 +0200 +@@ -15,7 +15,7 @@ + %mandb% \- create or update the manual page index caches + .SH SYNOPSIS + .B %mandb% +-.RB [\| \-dqsucpt \||\| \-h \||\| \-V \|] ++.RB [\| \-dqsucpt?V \|] + .RB [\| \-C + .IR file \|] + .RI [\| manpath \|] +@@ -136,9 +136,12 @@ and + Use this user configuration file rather than the default of + .IR ~/.manpath . + .TP +-.if !'po4a'hide' .BR \-h ", " \-\-help ++.if !'po4a'hide' .BR \-? ", " \-\-help + Show the usage message, then exit. + .TP ++.if !'po4a'hide' .BR \-\-usage ++Print a short usage message and exit. ++.TP + .if !'po4a'hide' .BR \-V ", " \-\-version + Show the version, then exit. + .SH "EXIT STATUS" diff --git a/SOURCES/man-db-2.6.3-overrides.patch b/SOURCES/man-db-2.6.3-overrides.patch new file mode 100644 index 0000000..23707eb --- /dev/null +++ b/SOURCES/man-db-2.6.3-overrides.patch @@ -0,0 +1,63 @@ +diff -up man-db-2.6.3/src/manp.c.overrides man-db-2.6.3/src/manp.c +--- man-db-2.6.3/src/manp.c.overrides 2012-10-24 16:52:35.134486439 +0200 ++++ man-db-2.6.3/src/manp.c 2012-10-24 16:59:28.300037133 +0200 +@@ -51,6 +51,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -95,6 +96,9 @@ static struct list *namestore, *tailstor + #define MANPATH_MAP 0 + #define MANDATORY 1 + ++/* Subdirectory of MANPATH entries searched for man pages before the directory itself. */ ++#define OVERRIDES_DIR "/overrides" ++ + /* DIRLIST list[MAXDIRS]; */ + static char *tmplist[MAXDIRS]; + +@@ -933,6 +937,7 @@ char *get_manpath_from_path (const char + char **lp; + char *end; + char *manpathlist; ++ char overrides[MAXPATHLEN]; + struct list *list; + + tmppath = xstrdup (path); +@@ -960,6 +965,9 @@ char *get_manpath_from_path (const char + if (mandir_list) { + debug ("is in the config file\n"); + while (mandir_list) { ++ strcpy(overrides, mandir_list->cont); ++ strcat(overrides, OVERRIDES_DIR); ++ add_dir_to_list (tmplist, overrides); + add_dir_to_list (tmplist, mandir_list->cont); + mandir_list = iterate_over_list + (mandir_list, p, MANPATH_MAP); +@@ -978,6 +986,9 @@ char *get_manpath_from_path (const char + "../share/man, or share/man " + "subdirectory\n"); + ++ strcpy(overrides, t); ++ strcat(overrides, OVERRIDES_DIR); ++ add_dir_to_list (tmplist, overrides); + add_dir_to_list (tmplist, t); + free (t); + } else +@@ -993,8 +1004,12 @@ char *get_manpath_from_path (const char + debug ("\nadding mandatory man directories\n\n"); + + for (list = namestore; list; list = list->next) +- if (list->flag == MANDATORY) ++ if (list->flag == MANDATORY) { ++ strcpy(overrides, list->key); ++ strcat(overrides, OVERRIDES_DIR); ++ add_dir_to_list (tmplist, overrides); + add_dir_to_list (tmplist, list->key); ++ } + } + + len = 0; diff --git a/SOURCES/man-db-2.6.3-valgrind.patch b/SOURCES/man-db-2.6.3-valgrind.patch new file mode 100644 index 0000000..c9b3b3b --- /dev/null +++ b/SOURCES/man-db-2.6.3-valgrind.patch @@ -0,0 +1,290 @@ +diff -upr man-db-2.6.3.orig/lib/encodings.c man-db-2.6.3/lib/encodings.c +--- man-db-2.6.3.orig/lib/encodings.c 2013-09-24 18:10:58.730634000 +0200 ++++ man-db-2.6.3/lib/encodings.c 2013-09-24 18:11:49.095281568 +0200 +@@ -559,6 +559,7 @@ const char *get_locale_charset (void) + + /* Restore LC_CTYPE to its value on entry to this function. */ + setlocale (LC_CTYPE, saved_locale); ++ free (saved_locale); + + if (charset && *charset) + return get_canonical_charset_name (charset); +diff -upr man-db-2.6.3.orig/src/check_mandirs.c man-db-2.6.3/src/check_mandirs.c +--- man-db-2.6.3.orig/src/check_mandirs.c 2013-09-24 18:10:58.735634000 +0200 ++++ man-db-2.6.3/src/check_mandirs.c 2013-09-24 18:11:49.096281561 +0200 +@@ -442,6 +442,7 @@ static int testmandirs (const char *path + + if (chdir (path) != 0) { + error (0, errno, _("can't change to directory %s"), path); ++ closedir (dir); + return 0; + } + +@@ -479,11 +480,13 @@ static int testmandirs (const char *path + if (errno == EACCES || errno == EROFS) { + debug ("database %s is read-only\n", + database); ++ closedir (dir); + return 0; + } else { + error (0, errno, + _("can't create index cache %s"), + database); ++ closedir (dir); + return -errno; + } + } +@@ -496,6 +499,7 @@ static int testmandirs (const char *path + + if (!dbf) { + gripe_rwopen_failed (); ++ closedir (dir); + return 0; + } + +diff -upr man-db-2.6.3.orig/src/man.c man-db-2.6.3/src/man.c +--- man-db-2.6.3.orig/src/man.c 2013-09-24 18:10:58.732634000 +0200 ++++ man-db-2.6.3/src/man.c 2013-09-24 18:11:49.096281561 +0200 +@@ -188,7 +188,7 @@ static char *manpathlist[MAXDIRS]; + /* globals */ + int quiet = 1; + char *program_name; +-char *database; ++char *database = NULL; + MYDBM_FILE dbf; + extern const char *extension; /* for globbing.c */ + extern char *user_config_file; /* defined in manp.c */ +@@ -950,7 +950,7 @@ static int local_man_loop (const char *a + + if (directory_on_path (argv_dir)) { + char *argv_base = base_name (argv); +- char *new_manp; ++ char *new_manp, *nm; + char **old_manpathlist, **mp; + + debug ("recalculating manpath for executable " +@@ -962,7 +962,9 @@ static int local_man_loop (const char *a + "executable\n"); + goto executable_out; + } +- new_manp = locale_manpath (new_manp); ++ nm = locale_manpath (new_manp); ++ free (new_manp); ++ new_manp = nm; + + old_manpathlist = XNMALLOC (MAXDIRS, char *); + memcpy (old_manpathlist, manpathlist, +@@ -1167,15 +1169,21 @@ int main (int argc, char *argv[]) + manp = get_manpath (""); + printf ("%s\n", manp); + exit (OK); +- } else ++ } else { ++ free (cwd); ++ free (internal_locale); ++ free (program_name); + gripe_no_name (NULL); ++ } + } + + section_list = get_section_list (); + +- if (manp == NULL) +- manp = locale_manpath (get_manpath (alt_system_name)); +- else ++ if (manp == NULL) { ++ char *mp = get_manpath (alt_system_name); ++ manp = locale_manpath (mp); ++ free (mp); ++ } else + free (get_manpath (NULL)); + + debug ("manpath search path (with duplicates) = %s\n", manp); +@@ -1350,6 +1358,7 @@ int main (int argc, char *argv[]) + if (cwd[0]) + chdir (cwd); + ++ free (database); + free_pathlist (manpathlist); + free (cwd); + free (internal_locale); +@@ -2327,6 +2336,7 @@ static void format_display (pipeline *de + htmldir); + free (htmlfile); + free (htmldir); ++ free (old_cwd); + } else + #endif /* TROFF_IS_GROFF */ + /* TODO: check format_cmd status too? */ +@@ -2498,6 +2508,7 @@ static int display (const char *dir, con + free (name); + free_locale_bits (&bits); + } ++ free (page_lang); + } + #endif /* TROFF_IS_GROFF */ + +@@ -2564,6 +2575,7 @@ static int display (const char *dir, con + if (prompt && do_prompt (title)) { + pipeline_free (format_cmd); + pipeline_free (decomp); ++ free (formatted_encoding); + return 0; + } + drop_effective_privs (); +@@ -2690,6 +2702,7 @@ static int display (const char *dir, con + if (prompt && do_prompt (title)) { + pipeline_free (format_cmd); + pipeline_free (decomp); ++ free (formatted_encoding); + if (local_man_file) + return 1; + else +@@ -2741,6 +2754,8 @@ static int display (const char *dir, con + } + } + ++ free (formatted_encoding); ++ + pipeline_free (format_cmd); + pipeline_free (decomp); + +@@ -2802,6 +2817,7 @@ static char *find_cat_file (const char * + *tmp = 0; + if (is_directory (cat_dir)) { + debug ("will try cat file %s\n", cat_file); ++ free (cat_dir); + return cat_file; + } else + debug ("cat dir %s does not exist\n", cat_dir); +@@ -3276,6 +3292,8 @@ static int try_section (const char *path + struct mandata *info = infoalloc (); + char *info_buffer = filename_info (*np, info, name); + const char *ult; ++ int f; ++ + if (!info_buffer) { + free_mandata_struct (info); + continue; +@@ -3300,8 +3318,17 @@ static int try_section (const char *path + else + info->id = SO_MAN; + +- found += add_candidate (cand_head, CANDIDATE_FILESYSTEM, +- cat, name, path, ult, info); ++ f = add_candidate (cand_head, CANDIDATE_FILESYSTEM, ++ cat, name, path, ult, info); ++ found += f; ++ /* Free info and info_buffer if they weren't added to the ++ * candidates. ++ */ ++ if (f == 0) { ++ free (info_buffer); ++ info->addr = NULL; ++ free_mandata_struct (info); ++ } + /* Don't free info and info_buffer here. */ + } + +@@ -3319,9 +3346,15 @@ static int display_filesystem (struct ca + char *title = appendstr (NULL, candp->source->name, + "(", candp->source->ext, ")", NULL); + if (candp->cat) { +- if (troff || want_encoding || recode) ++ int r; ++ ++ if (troff || want_encoding || recode) { ++ free (title); + return 0; +- return display (candp->path, NULL, filename, title, NULL); ++ } ++ r = display (candp->path, NULL, filename, title, NULL); ++ free (title); ++ return r; + } else { + const char *man_file; + char *cat_file; +@@ -3344,6 +3377,7 @@ static int display_filesystem (struct ca + free (lang); + lang = NULL; + free (title); ++ free (filename); + + return found; + } +@@ -3571,6 +3605,7 @@ static int try_db (const char *manpath, + /* find out where our db for this manpath should be */ + + catpath = get_catpath (manpath, global_manpath ? SYSTEM_CAT : USER_CAT); ++ free (database); + if (catpath) { + database = mkdbname (catpath); + free (catpath); +@@ -3942,7 +3977,7 @@ static int man (const char *name, int *f + + for (cand = candidates; cand; cand = candnext) { + candnext = cand->next; +- free (cand); ++ free_candidate (cand); + } + + return *found ? OK : NOT_FOUND; +diff -upr man-db-2.6.3.orig/src/manp.c man-db-2.6.3/src/manp.c +--- man-db-2.6.3.orig/src/manp.c 2013-09-24 18:10:58.733634000 +0200 ++++ man-db-2.6.3/src/manp.c 2013-09-24 18:11:49.097281554 +0200 +@@ -504,6 +504,7 @@ static char *get_nls_manpath (const char + + closedir (mandir); + } ++ free (manpathlist_copy); + + free_locale_bits (&lbits); + return manpath; +@@ -567,6 +568,7 @@ char *add_nls_manpaths (char *manpathlis + free (locale_manpath); + } + } ++ free (locales_copy); + + /* Always try untranslated pages as a last resort. */ + locale_manpath = get_nls_manpath (manpathlist, "C"); +@@ -820,6 +822,8 @@ next: + free (buf); + buf = NULL; + } ++ ++ free (buf); + } + + static void free_config_file (void *unused ATTRIBUTE_UNUSED) +diff -upr man-db-2.6.3.orig/src/whatis.c man-db-2.6.3/src/whatis.c +--- man-db-2.6.3.orig/src/whatis.c 2012-06-18 12:23:37.000000000 +0200 ++++ man-db-2.6.3/src/whatis.c 2013-09-24 18:11:49.097281554 +0200 +@@ -501,7 +501,7 @@ static inline int do_whatis_section (con + + static int suitable_manpath (const char *manpath, const char *page_dir) + { +- char *page_manp; ++ char *page_manp, *pm; + char *page_manpathlist[MAXDIRS], **mp; + int ret; + +@@ -510,7 +510,9 @@ static int suitable_manpath (const char + free (page_manp); + return 0; + } +- page_manp = locale_manpath (page_manp); ++ pm = locale_manpath (page_manp); ++ free (page_manp); ++ page_manp = pm; + create_pathlist (page_manp, page_manpathlist); + + ret = 0; +@@ -554,6 +556,7 @@ static void do_whatis (const char * cons + debug ("%s not on manpath for %s\n", + manpath, page); + free (page_dir); ++ free (page); + continue; + } + } diff --git a/SOURCES/man-db.crondaily b/SOURCES/man-db.crondaily new file mode 100644 index 0000000..6e95c16 --- /dev/null +++ b/SOURCES/man-db.crondaily @@ -0,0 +1,27 @@ +#!/bin/bash + +if [ -e /etc/sysconfig/man-db ]; then + . /etc/sysconfig/man-db +fi + +if [ "$CRON" = "no" ]; then + exit 0 +fi + +renice +19 -p $$ >/dev/null 2>&1 +ionice -c3 -p $$ >/dev/null 2>&1 + +LOCKFILE=/var/lock/man-db.lock + +# the lockfile is not meant to be perfect, it's just in case the +# two man-db cron scripts get run close to each other to keep +# them from stepping on each other's toes. The worst that will +# happen is that they will temporarily corrupt the database +[[ -f $LOCKFILE ]] && exit 0 + +trap "{ rm -f $LOCKFILE ; exit 0; }" EXIT +touch $LOCKFILE +# create/update the mandb database +mandb $OPTS + +exit 0 diff --git a/SOURCES/man-db.sysconfig b/SOURCES/man-db.sysconfig new file mode 100644 index 0000000..608446d --- /dev/null +++ b/SOURCES/man-db.sysconfig @@ -0,0 +1,6 @@ +# Set to no to disable daily man-db update by /etc/cron.daily/man-db.cron +CRON="yes" + +# Options used by mandb in /etc/cron.daily/man-db.cron, +# we use -q as default, too much noise without. +OPTS="-q" diff --git a/SPECS/man-db.spec b/SPECS/man-db.spec new file mode 100644 index 0000000..099e5d2 --- /dev/null +++ b/SPECS/man-db.spec @@ -0,0 +1,302 @@ +%global cache /var/cache/man +%global gnulib_ver 20120404-stable + +Summary: Tools for searching and reading man pages +Name: man-db +Version: 2.6.3 +Release: 11%{?dist} +# GPLv2+ .. man-db +# GPLv3+ .. gnulib +License: GPLv2+ and GPLv3+ +Group: System Environment/Base +URL: http://www.nongnu.org/man-db/ + +Source0: http://download.savannah.gnu.org/releases/%{name}/%{name}-%{version}.tar.xz +Source1: man-db.crondaily +Source2: man-db.sysconfig + +# resolves: #655385 +Patch0: man-db-2.5.9-sgr.patch +# resolves: #677669 +Patch1: man-db-2.6.1-wildcards.patch +# resolves: #693458 +Patch2: man-db-2.6.1-so-links.patch +# resolves: #657409 +Patch3: man-db-2.6.1-locale-fallback.patch +# resolves: #841431 +Patch4: man-db-2.6.2-invalid-cache.patch +# adds support for man-pages-overrides +Patch5: man-db-2.6.3-overrides.patch +# fixed some compiler warnings +Patch6: man-db-2.6.3-gcc.patch +# fixed memory leaks detected by valgrind +Patch7: man-db-2.6.3-valgrind.patch +# fixed certain man pages to match options with --help and --usage +Patch8: man-db-2.6.3-man-options.patch +# resolves: #1515352 +Patch9: man-db-2.6.3-easter-egg.patch + +Obsoletes: man < 2.0 +Provides: man = %{version} +Provides: man-pages-reader = %{version} +# FPC exception for gnulib - copylib - https://fedorahosted.org/fpc/ticket/174 +Provides: bundled(gnulib) = %{gnulib_ver} + +Requires: coreutils, grep, groff-base, gzip, less +BuildRequires: gdbm-devel, gettext, groff, less, libpipeline-devel, po4a, zlib-devel + +%description +The man-db package includes five tools for browsing man-pages: +man, whatis, apropos, manpath and lexgrog. man formats and displays +manual pages. whatis searches the manual page names. apropos searches the +manual page names and descriptions. manpath determines search path +for manual pages. lexgrog directly reads header information in +manual pages. + +%prep +%setup -q +%patch0 -p1 -b .sgr +%patch1 -p1 -b .wildcards +%patch2 -p1 -b .so-links +%patch3 -p1 -b .locale-fallback +%patch4 -p1 -b .invalid-cache +%patch5 -p1 -b .overrides +%patch6 -p1 -b .gcc +%patch7 -p1 -b .valgrind-mem +%patch8 -p1 -b .man-options +%patch9 -p1 -b .easter-egg + +%build +%configure \ + --with-sections="1 1p 8 2 3 3p 4 5 6 7 9 0p n l p o 1x 2x 3x 4x 5x 6x 7x 8x" \ + --disable-setuid --with-browser=elinks --with-lzip=lzip +make CC="%{__cc} %{optflags}" %{?_smp_mflags} V=1 + +%check +make check + +%install +make install DESTDIR=$RPM_BUILD_ROOT prefix=%{_prefix} INSTALL='install -p' + +# move the documentation to the relevant place +mv $RPM_BUILD_ROOT%{_datadir}/doc/man-db/* ./ + +# remove zsoelim - part of groff package +rm $RPM_BUILD_ROOT%{_bindir}/zsoelim +rm $RPM_BUILD_ROOT%{_datadir}/man/man1/zsoelim.1 + +# remove libtool archives +rm $RPM_BUILD_ROOT%{_libdir}/man-db/*.la + +# install cache directory +install -d -m 0755 $RPM_BUILD_ROOT%{cache} + +# install cron script for man-db creation/update +install -D -p -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.daily/man-db.cron + +# config for cron script +install -D -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/man-db + +%find_lang %{name} +%find_lang %{name}-gnulib + +# clear the old cache +%post +%{__rm} -rf %{cache}/* + +%files -f %{name}.lang -f %{name}-gnulib.lang +%doc README man-db-manual.txt man-db-manual.ps docs/COPYING ChangeLog NEWS +%config(noreplace) %{_sysconfdir}/man_db.conf +%config(noreplace) %{_sysconfdir}/sysconfig/man-db +%{_sysconfdir}/cron.daily/man-db.cron +%{_sbindir}/accessdb +%{_bindir}/man +%{_bindir}/whatis +%{_bindir}/apropos +%{_bindir}/manpath +%{_bindir}/lexgrog +%{_bindir}/catman +%{_bindir}/mandb +%dir %{_libdir}/man-db +%{_libdir}/man-db/*.so +%dir %{_libexecdir}/man-db +%{_libexecdir}/man-db/globbing +%{_libexecdir}/man-db/manconv +%attr(0755,root,root) %dir %{cache} +# documentation and translation +%{_mandir}/man1/apropos.1* +%{_mandir}/man1/lexgrog.1* +%{_mandir}/man1/man.1* +%{_mandir}/man1/manconv.1* +%{_mandir}/man1/manpath.1* +%{_mandir}/man1/whatis.1* +%{_mandir}/man5/manpath.5* +%{_mandir}/man8/accessdb.8* +%{_mandir}/man8/catman.8* +%{_mandir}/man8/mandb.8* +%lang(de) %{_datadir}/man/de/man*/* +%lang(es) %{_datadir}/man/es/man*/* +%lang(fr) %{_datadir}/man/fr/man*/* +%lang(id) %{_datadir}/man/id/man*/* +%lang(it) %{_datadir}/man/it/man*/* +%lang(ja) %{_datadir}/man/ja/man*/* +%lang(nl) %{_datadir}/man/nl/man*/* +%lang(pl) %{_datadir}/man/pl/man*/* +%lang(ru) %{_datadir}/man/ru/man*/* + +%changelog +* Tue Jul 10 2018 Nikola Forró - 2.6.3-11 +- related: #1515352 + build and install all translated man pages + +* Tue Nov 21 2017 Nikola Forró - 2.6.3-10 +- resolves: #1515352 + remove easter egg interfering with non-error cases + +* Mon Mar 17 2014 Peter Schiffer - 2.6.3-9 +- resolves: #1067085 + fixed crash when running man with -M parameter + +* Fri Jan 24 2014 Daniel Mach - 2.6.3-8 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 2.6.3-7 +- Mass rebuild 2013-12-27 + +* Mon Apr 8 2013 Peter Schiffer - 2.6.3-6 +- resolves: #948695 + fixed double free +- fixed certain man pages to match options with --help and --usage + +* Thu Mar 21 2013 Peter Schiffer - 2.6.3-5 +- temporarily disabled one unstable unit test + +* Thu Mar 21 2013 Peter Schiffer - 2.6.3-4 +- fixed some compiler warnings and memory leaks + +* Thu Feb 14 2013 Fedora Release Engineering - 2.6.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Oct 30 2012 Peter Schiffer - 2.6.3-2 +- resolves: #870680 + use less as the default pager + +* Wed Oct 24 2012 Peter Schiffer - 2.6.3-1 +- resolves: #858577 + updated to 2.6.3 +- cleaned .spec file +- resolves: #855632 + fixed SIGABRT crash +- adds support for man-pages-overrides + +* Tue Jul 31 2012 Peter Schiffer - 2.6.2-5 +- resolves: #841431 + ignore cached man pages if they don't exist anymore + +* Fri Jul 20 2012 Dan Horák - 2.6.2-4 +- fully patch the autotools files, fixes FTBFS due updated automake + +* Thu Jul 19 2012 Fedora Release Engineering - 2.6.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jul 12 2012 Peter Schiffer - 2.6.2-2 +- resolves: #829553 + clear the old man cache on install or update + +* Tue Jul 10 2012 Peter Schiffer - 2.6.2-1 +- resolves: #833312 + update to 2.6.2 +- resolves: #657409 + fixed warning when invoking col by the mandb program in cron +- resolves: #829935 + enabled support for man pages compressed with lzip +- resolves: #821778 + added virtual provides for bundled gnulib library +- resolves: #824825 + apropos returns correct exit code for invalid man page + +* Tue Apr 24 2012 Peter Schiffer - 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 - 2.6.1-3 +- added autoconf, automake, libtool and gettext-devel to the build requires + +* Tue Apr 24 2012 Peter Schiffer - 2.6.1-2 +- resolves: #677669 + added support for wildcards in path +- resolves: #693458 + fixed error with .so links + +* Thu Apr 05 2012 Peter Schiffer - 2.6.1-1 +- resolves: #790771 + update to 2.6.1 +- resolves: #806086 + removed hard-dependency on cron, update man db after install or update + +* Fri Jan 13 2012 Fedora Release Engineering - 2.6.0.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Oct 05 2011 Peter Schiffer - 2.6.0.2-3 +- resolves: #702904 + fixed double free or corruption issue +- resolves: #739207 + require groff-base instead of groff +- rebuilt for gdbm-1.9.1-1 + +* Sun May 29 2011 Ville Skyttä - 2.6.0.2-2 +- Own the %%{_libdir}/man-db dir. + +* Thu Apr 21 2011 Ivana Hutarova Varekova - 2.6.0.2-1 +- update to 2.6.0.2 +- remove obsolete patches +- add libpipe dependency + +* Wed Mar 23 2011 Ivana Hutarova Varekova - 2.5.9-6 +- Build with zlib support. +- Use elinks as default HTML browser. + thanks Ville Skyttä + +* Wed Mar 23 2011 Ivana Hutarova Varekova - 2.5.9-5 +* Resolves: #684977 + backport upstream patch + +* Tue Feb 08 2011 Fedora Release Engineering - 2.5.9-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Jan 27 2011 Ivana Hutarova Varekova - 2.5.9-3 +- Resolves: #659292 + use ionice in man cron job + +* Wed Nov 24 2010 Ivana Hutarova Varekova - 2.5.9-2 +- Resolves: #655385 - use old format of nroff output + +* Mon Nov 22 2010 Ivana Hutarova Varekova - 2.5.9-1 +- update to 2.5.9 + +* Fri Oct 1 2010 Ivana Hutarova Varekova - 2.5.7-8 +- add less buildrequire + +* Wed Sep 29 2010 jkeating - 2.5.7-7 +- Rebuilt for gcc bug 634757 + +* Fri Sep 24 2010 Ivana Hutarova Varekova - 2.5.7-6 +- Resolves: #630506 (change the description) +- minor spec file changes + +* Mon Aug 30 2010 Dennis Gilmore - 2.5.7-5 +- Provide Versioned man + +* Mon Aug 16 2010 Ivana Hutarova Varekova - 2.5.7-4 +- remove obsolete conflict flag + +* Mon Aug 16 2010 Ivana Hutarova Varekova - 2.5.7-3 +- provides man tag +- resolves: #621688 + remove problematic man-pages (now in man-pages-de package) + +* Fri Apr 16 2010 Ivana Hutarova Varekova - 2.5.7-2 +- add conflicts tag + +* Wed Feb 17 2010 Ivana Hutarova Varekova - 2.5.7-1 +- initial build