diff --git a/cron.daily.do_mandb b/cron.daily.do_mandb index 46e2ce8..a55a817 100644 --- a/cron.daily.do_mandb +++ b/cron.daily.do_mandb @@ -6,10 +6,12 @@ # since this file will be overwritten, when updating your system. # # Copyright (c) 1996-2002 SuSE GmbH Nuernberg, Germany. +# Copyright (c) 2008 SuSE LINUX Products GmbH Nuernberg, Germany. # # please send bugfixes or comments to feedback@suse.de. # -# Author: Burchard Steinbild , 1996 +# Author: Werner Fink , 2008 +# Burchard Steinbild , 1996 # Florian La Roche , 1996 # @@ -32,21 +34,37 @@ fi # # now we do the man page stuff # -if test "$REINIT_MANDB" = yes -o ! -s /var/cache/man/index.db ; then - if test -x /usr/bin/mandb ; then - test -x /usr/bin/safe-rm -a -e /var/cache/man/index.bt && \ - /usr/bin/safe-rm /var/cache/man/index.bt - nice -n 5 ionice -c 3 /usr/bin/mandb -q -s 2> /dev/null || { +if test "$REINIT_MANDB" = yes ; then + if type -p mandb > /dev/null 2>&1 ; then + typeset -r manpaths=$(manpath -g) + typeset -i errors=0 + renice +5 -p$$ > /dev/null || true + ionice -c 3 -p$$ > /dev/null || true + unset MANPATH + IFS=: + for mp in $manpaths; do + test -d "${mp}" || continue + cp=$(MANPATH=$mp manpath -qc) + test -n "${cp}" || continue + test -d "${cp}" || continue + db=${cp}/index.db + if test -e ${db} ; then + find $mp -follow -newer $db | read -t 1 line + test $? -eq 0 || continue + fi + nice -n 5 ionice -c 3 mandb -qs ${mp} > /dev/null 2>&1 || let errors++ + done + if test $errors -ne 0 ; then echo There seem to be trouble with mandb. echo - echo please run /usr/bin/mandb an check the output... - } + echo please run mandb and check the output... + fi fi # # some applications need whatis database. If makewhatis exists, call it # - if test -x /usr/sbin/makewhatis ; then - /usr/sbin/makewhatis + if type -p makewhatis > /dev/null 2>&1 ; then + makewhatis fi fi diff --git a/man-db-2.5.0-error.dif b/man-db-2.5.0-error.dif deleted file mode 100644 index 66887d3..0000000 --- a/man-db-2.5.0-error.dif +++ /dev/null @@ -1,37 +0,0 @@ ---- lib/error.c -+++ lib/error.c 2007-12-07 18:50:29.332479427 +0100 -@@ -76,12 +76,15 @@ private_strerror (errnum) - #define strerror private_strerror - #endif - -+#include "lib/error.h" -+ - /* Print the program name and error message MESSAGE, which is a printf-style - format string with optional args. - If ERRNUM is nonzero, print its corresponding system error message. - Exit with status STATUS if it is nonzero. */ - /* VARARGS */ - -+#ifndef __GLIBC__ /* glibc exports this function */ - void - #if defined(VA_START) && __STDC__ - error (int status, int errnum, const char *message, ...) -@@ -137,3 +140,4 @@ error (status, errnum, message, va_alist - exit (status); - } - } -+#endif ---- lib/error.h -+++ lib/error.h 2007-12-07 18:51:53.803262466 +0100 -@@ -29,9 +29,9 @@ extern int errno; - #include "manconfig.h" - - #if __STDC__ && (HAVE_VPRINTF || HAVE_DOPRNT) --void error (int, int, const char *, ...) ATTRIBUTE_FORMAT_PRINTF(3, 4); -+extern void error (int, int, const char *, ...) ATTRIBUTE_FORMAT_PRINTF(3, 4); - #else --void error (); -+extern void error (); - #endif - - #endif diff --git a/man-db-2.5.0-zio.dif b/man-db-2.5.0-zio.dif deleted file mode 100644 index cb00ee0..0000000 --- a/man-db-2.5.0-zio.dif +++ /dev/null @@ -1,156 +0,0 @@ ---- config.h.in -+++ config.h.in 2007-12-07 15:50:22.900940943 +0100 -@@ -220,6 +220,9 @@ - /* Define to 1 if you have the `z' library (-lz). */ - #undef HAVE_LIBZ - -+/* Define to 1 if you have libzio for opening compressed manuals */ -+#undef HAVE_ZIO -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_LIMITS_H - ---- configure.ac -+++ configure.ac 2007-12-07 15:55:02.636618503 +0100 -@@ -98,6 +98,18 @@ AC_ARG_WITH(config-file, - fi], - : ${config_file=\$\{sysconfdir\}/man_db.conf} - : ${config_file_basename=man_db.conf}) -+AC_ARG_WITH(zio, -+[AS_HELP_STRING([--with-zio=LIBRARY], [use zlib/libbz2 wrapper library LIBRARY (libzio)])], -+ [if test -z "$withval" -o "$withval" = "yes" -+ then -+ zio=libzio -+ elif test "$withval" = "no" -+ then -+ AC_MSG_ERROR(--with-zio requires an argument) -+ else -+ zio=$withval -+ fi], -+ : ${zio=no}) - dnl - dnl Finish the argument parsing - dnl -@@ -271,6 +283,29 @@ AC_SUBST(gunzip)dnl - AC_SUBST(uncompress)dnl - AC_SUBST(bunzip2)dnl - AC_CHECK_LIB(z, gzopen) -+dnl Check for zlib and libbz2 libraries to use this together -+dnl with SuSE's libzio to open compressed info files. -+dnl -+if test "$zio" = "no" || test -n "$zio" -+then -+ AC_CHECK_HEADER(zlib.h,[ -+ for lib in z gz -+ do -+ AC_CHECK_LIB($lib, gzopen, [LIBS="$LIBS -l$lib" ; LEXLIB="$LEXLIB -l$lib" ; break]) -+ done]) -+ AC_CHECK_HEADER(bzlib.h,[ -+ for lib in bz2 bzip2 -+ do -+ AC_CHECK_LIB($lib, BZ2_bzopen, [LIBS="$LIBS -l$lib" ; LEXLIB="$LEXLIB -l$lib" ; break]) -+ done]) -+ AC_CHECK_HEADER(zio.h,[ -+ for lib in ${zio#lib} zio -+ do -+ AC_CHECK_LIB($lib, fzopen, [LIBS="$LIBS -l$lib" ; LEXLIB="$LEXLIB -l$lib" -+ AC_DEFINE([COMP_SRC],[],[]) -+ AC_DEFINE([HAVE_ZIO],[],[])]) -+ done]) -+fi - dnl - dnl to add more decompressors just follow the scheme above. - dnl ---- lib/decompress.c -+++ lib/decompress.c 2007-12-07 18:22:47.940413890 +0100 -@@ -46,6 +46,10 @@ - # include "zlib.h" - #endif /* HAVE_LIBZ */ - -+#ifdef HAVE_ZIO -+# include "zio.h" -+#endif /* HAVE_ZIO */ -+ - #include "manconfig.h" - #include "comp_src.h" - #include "pipeline.h" -@@ -76,6 +80,32 @@ static void decompress_zlib (void *data - - #endif /* HAVE_LIBZ */ - -+#ifdef HAVE_ZIO -+ -+static void decompress_zio (void *data) -+{ -+ const char *what = (const char*)data; -+ FILE *file; -+ -+ file = fdzopen(dup (fileno (stdin)), "r", what); -+ if (!file) -+ return; -+ -+ for (;;) { -+ char buffer[4096]; -+ int r = fread(buffer, sizeof(char), sizeof(buffer), file); -+ if (r <= 0) -+ break; -+ if (fwrite (buffer, 1, (size_t) r, stdout) < (size_t) r) -+ break; -+ } -+ -+ fclose(file); -+ return; -+} -+ -+#endif /* HAVE_ZIO */ -+ - pipeline *decompress_open (const char *filename) - { - command *cmd; -@@ -87,9 +117,45 @@ pipeline *decompress_open (const char *f - char *ext; - struct compression *comp; - -- if (stat (filename, &st) < 0 && !S_ISDIR (st.st_mode)) -+ if (stat (filename, &st) < 0 || S_ISDIR (st.st_mode)) - return NULL; - -+#ifdef HAVE_ZIO -+ ext = strrchr(filename, '.'); -+ if (ext && STREQ (ext, ".gz")) { -+ /* informational only; no shell quoting concerns */ -+ char *name = strappend (NULL, "zcat < ", filename, NULL); -+ cmd = command_new_function (name, &decompress_zio, "g"); -+ free (name); -+ p = pipeline_new_commands (cmd, NULL); -+ goto got_pipeline; -+ } -+ if (ext && STREQ (ext, ".z")) { -+ /* informational only; no shell quoting concerns */ -+ char *name = strappend (NULL, "zcat < ", filename, NULL); -+ cmd = command_new_function (name, &decompress_zio, "z"); -+ free (name); -+ p = pipeline_new_commands (cmd, NULL); -+ goto got_pipeline; -+ } -+ if (ext && STREQ (ext, ".bz2")) { -+ /* informational only; no shell quoting concerns */ -+ char *name = strappend (NULL, "bzcat < ", filename, NULL); -+ cmd = command_new_function (name, &decompress_zio, "b"); -+ free (name); -+ p = pipeline_new_commands (cmd, NULL); -+ goto got_pipeline; -+ } -+ if (ext && STREQ (ext, ".Z")) { -+ /* informational only; no shell quoting concerns */ -+ char *name = strappend (NULL, "zcat < ", filename, NULL); -+ cmd = command_new_function (name, &decompress_zio, "Z"); -+ free (name); -+ p = pipeline_new_commands (cmd, NULL); -+ goto got_pipeline; -+ } -+#endif /* HAVE_ZIO */ -+ - #ifdef HAVE_LIBZ - filename_len = strlen (filename); - if (filename_len > 3 && STREQ (filename + filename_len - 3, ".gz")) { diff --git a/man-db-2.5.0.tar.bz2 b/man-db-2.5.0.tar.bz2 deleted file mode 100644 index f0ac4c7..0000000 --- a/man-db-2.5.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e6dbb18464fe31cd52fb6287b63829e556a77746b81899c743c327b15ad9e434 -size 746743 diff --git a/man-db-2.5.0-chinese.dif b/man-db-2.5.1-chinese.dif similarity index 71% rename from man-db-2.5.0-chinese.dif rename to man-db-2.5.1-chinese.dif index 1f5a4f8..5be6e00 100644 --- a/man-db-2.5.0-chinese.dif +++ b/man-db-2.5.1-chinese.dif @@ -1,6 +1,6 @@ --- src/encodings.c -+++ src/encodings.c 2007-12-07 19:12:54.428222452 +0100 -@@ -110,6 +110,11 @@ static struct directory_entry directory_ ++++ src/encodings.c 2008-04-21 13:09:34.436233193 +0200 +@@ -106,6 +106,11 @@ static struct directory_entry directory_ { "cs", "ISO-8859-2", "ISO-8859-2" }, /* Czech */ { "hr", "ISO-8859-2", "ISO-8859-2" }, /* Croatian */ { "hu", "ISO-8859-2", "ISO-8859-2" }, /* Hungarian */ @@ -12,7 +12,7 @@ { "ja", "EUC-JP", "EUC-JP" }, /* Japanese */ { "ko", "EUC-KR", "EUC-KR" }, /* Korean */ { "pl", "ISO-8859-2", "ISO-8859-2" }, /* Polish */ -@@ -209,6 +214,7 @@ static struct charset_entry charset_tabl +@@ -205,6 +210,7 @@ static struct charset_entry charset_tabl { "BIG5HKSCS", "nippon" }, { "EUC-CN", "nippon" }, { "EUC-JP", "nippon" }, @@ -20,7 +20,7 @@ { "GBK", "nippon" }, #endif /* MULTIBYTE_GROFF */ -@@ -267,6 +273,7 @@ static struct less_charset_entry less_ch +@@ -263,6 +269,7 @@ static struct less_charset_entry less_ch { "UTF-8", "utf-8" }, #ifdef MULTIBYTE_GROFF @@ -28,7 +28,7 @@ { "EUC-JP", "ja" }, { "KOI8-R", "koi8-r" }, #endif /* MULTIBYTE_GROFF */ -@@ -391,6 +398,13 @@ char *get_page_encoding (const char *lan +@@ -387,6 +394,13 @@ char *get_page_encoding (const char *lan * roff encoding = UTF-8 * output encoding = UTF-8 * EUC-JP -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8 @@ -42,18 +42,16 @@ */ const char *get_source_encoding (const char *lang) { -@@ -524,8 +538,8 @@ static int compatible_encodings (const c - * rather filthy. +@@ -527,7 +541,7 @@ static int compatible_encodings (const c */ if ((STREQ (input, "BIG5") || STREQ (input, "BIG5HKSCS") || -- STREQ (input, "EUC-JP") || -- STREQ (input, "EUC-CN") || STREQ (input, "GBK")) && -+ STREQ (input, "EUC-JP") || STREQ (input, "EUC-CN") || -+ STREQ (input, "GB18030") || STREQ (input, "GBK")) && + STREQ (input, "EUC-JP") || +- STREQ (input, "EUC-CN") || STREQ (input, "GBK") || ++ STREQ (input, "EUC-CN") || STREQ (input, "GB18030") || STREQ (input, "GBK") + STREQ (input, "EUC-KR")) && STREQ (output, "UTF-8")) return 1; - #endif /* MULTIBYTE_GROFF */ -@@ -600,7 +614,7 @@ const char *get_roff_encoding (const cha +@@ -606,7 +620,7 @@ const char *get_roff_encoding (const cha STREQ (ctype, "zh_HK.UTF-8") || STREQ (ctype, "zh_SG.UTF-8") || STREQ (ctype, "zh_TW.UTF-8")) diff --git a/man-db-2.4.3-globbing.dif b/man-db-2.5.1-globbing.dif similarity index 72% rename from man-db-2.4.3-globbing.dif rename to man-db-2.5.1-globbing.dif index 3fd3f7a..ccc41c2 100644 --- a/man-db-2.4.3-globbing.dif +++ b/man-db-2.5.1-globbing.dif @@ -4,24 +4,24 @@ /* allow lookups like "3x foo" to match "../man3/foo.3x" */ if ((layout & LAYOUT_GNU) && CTYPE (isdigit, *sec) && sec[1] != '\0') { -- path = strappend (path, hier, cat ? "/cat" : "/man", "\t", +- path = appendstr (path, hier, cat ? "/cat" : "/man", "\t", - NULL); - *strrchr (path, '\t') = *sec; -- pattern = end_pattern (strappend (pattern, name, NULL), sec); +- pattern = end_pattern (appendstr (pattern, name, NULL), sec); + off_t nptr, nsec; - status = match_in_directory (path, pattern, !match_case, - &gbuf); -+ path = strappend (path, hier, cat ? "/cat" : "/man", NULL); ++ path = appendstr (path, hier, cat ? "/cat" : "/man", NULL); + nptr = strlen(path); -+ path = strappend (path, sec, NULL); ++ path = appendstr (path, sec, NULL); + nsec = nptr + strlen(sec); + + while (nsec > nptr) { + *(path + nsec--) = '\0'; + if (pattern) + *pattern = '\0'; -+ pattern = end_pattern (strappend (pattern, name, NULL), sec); ++ pattern = end_pattern (appendstr (pattern, name, NULL), sec); + status = match_in_directory (path, pattern, !match_case, &gbuf); + if ((status == 0) && (gbuf.gl_pathc != 0)) + break; diff --git a/man-db-2.5.0-security4.dif b/man-db-2.5.1-security4.dif similarity index 75% rename from man-db-2.5.0-security4.dif rename to man-db-2.5.1-security4.dif index 34c825c..d35f18f 100644 --- a/man-db-2.5.0-security4.dif +++ b/man-db-2.5.1-security4.dif @@ -1,14 +1,14 @@ --- src/mandb.c -+++ src/mandb.c 2007-12-07 18:59:06.546515903 +0100 -@@ -34,6 +34,7 @@ ++++ src/mandb.c 2008-04-21 13:06:01.440910914 +0200 +@@ -36,6 +36,7 @@ #include #include #include /* for chmod() */ +#include /* for open () */ #include + #include - #if defined(STDC_HEADERS) -@@ -393,11 +394,20 @@ static short mandb (const char *catpath, +@@ -414,11 +415,20 @@ static short mandb (const char *catpath, char pid[23]; short amount; char *dbname; @@ -16,7 +16,7 @@ dbname = mkdbname (catpath); sprintf (pid, "%d", getpid ()); - database = strappend (NULL, catpath, "/", pid, NULL); + database = appendstr (NULL, catpath, "/", pid, NULL); - + + /* Just for the case that catpath isn't a system catpath */ diff --git a/man-db-2.5.1-zio.dif b/man-db-2.5.1-zio.dif new file mode 100644 index 0000000..be18899 --- /dev/null +++ b/man-db-2.5.1-zio.dif @@ -0,0 +1,300 @@ +--- config.h.in ++++ config.h.in 2007-12-07 15:50:23.000000000 +0100 +@@ -454,6 +454,9 @@ + /* Define to 1 if you have the `z' library (-lz). */ + #undef HAVE_LIBZ + ++/* Define to 1 if you have libzio for opening compressed manuals */ ++#undef HAVE_ZIO ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_LIMITS_H + +--- configure.ac ++++ configure.ac 2008-04-21 13:18:38.854059561 +0200 +@@ -94,7 +94,18 @@ AC_ARG_WITH(sections, + sections="$withval" + fi], + [: ${sections=1 n l 8 3 2 5 4 9 6 7}]) +- ++AC_ARG_WITH(zio, ++[AS_HELP_STRING([--with-zio=LIBRARY], [use zlib/libbz2 wrapper library LIBRARY (libzio)])], ++ [if test -z "$withval" -o "$withval" = "yes" ++ then ++ zio=libzio ++ elif test "$withval" = "no" ++ then ++ AC_MSG_ERROR(--with-zio requires an argument) ++ else ++ zio=$withval ++ fi], ++ : ${zio=no}) + # Finish the argument parsing. + AC_SUBST(man_owner)dnl + AC_SUBST(man_mode)dnl +@@ -294,6 +305,29 @@ AC_SUBST(gunzip) + AC_SUBST(uncompress) + AC_SUBST(bunzip2) + MAN_COMPRESS_LIB([z], [gzopen]) ++dnl Check for zlib and libbz2 libraries to use this together ++dnl with SuSE's libzio to open compressed info files. ++dnl ++if test "$zio" = "no" || test -n "$zio" ++then ++ AC_CHECK_HEADER(zlib.h,[ ++ for lib in z gz ++ do ++ AC_CHECK_LIB($lib, gzopen, [LIBS="$LIBS -l$lib" ; LEXLIB="$LEXLIB -l$lib" ; break]) ++ done]) ++ AC_CHECK_HEADER(bzlib.h,[ ++ for lib in bz2 bzip2 ++ do ++ AC_CHECK_LIB($lib, BZ2_bzopen, [LIBS="$LIBS -l$lib" ; LEXLIB="$LEXLIB -l$lib" ; break]) ++ done]) ++ AC_CHECK_HEADER(zio.h,[ ++ for lib in ${zio#lib} zio ++ do ++ AC_CHECK_LIB($lib, fzopen, [LIBS="$LIBS -l$lib" ; LEXLIB="$LEXLIB -l$lib" ++ AC_DEFINE([COMP_SRC],[],[Define if you have compressors and want to support compressed cat files.]) ++ AC_DEFINE([HAVE_ZIO],[],[Define to 1 if you have libzio for opening compressed manuals])]) ++ done]) ++fi + dnl To add more decompressors just follow the scheme above. + + # Work out which manual page hierarchy scheme might be in use. +--- lib/decompress.c ++++ lib/decompress.c 2008-04-22 10:48:45.049189929 +0000 +@@ -36,6 +36,10 @@ + # include "zlib.h" + #endif /* HAVE_LIBZ */ + ++#ifdef HAVE_ZIO ++# include "zio.h" ++#endif /* HAVE_ZIO */ ++ + #include "manconfig.h" + #include "comp_src.h" + #include "pipeline.h" +@@ -66,6 +70,32 @@ static void decompress_zlib (void *data + + #endif /* HAVE_LIBZ */ + ++#ifdef HAVE_ZIO ++ ++static void decompress_zio (void *data) ++{ ++ const char *what = (const char*)data; ++ FILE *file; ++ ++ file = fdzopen(dup (fileno (stdin)), "r", what); ++ if (!file) ++ return; ++ ++ for (;;) { ++ char buffer[4096]; ++ int r = fread(buffer, sizeof(char), sizeof(buffer), file); ++ if (r <= 0) ++ break; ++ if (fwrite (buffer, 1, (size_t) r, stdout) < (size_t) r) ++ break; ++ } ++ ++ fclose(file); ++ return; ++} ++ ++#endif /* HAVE_ZIO */ ++ + pipeline *decompress_open (const char *filename) + { + command *cmd; +@@ -77,9 +107,49 @@ pipeline *decompress_open (const char *f + char *ext; + struct compression *comp; + +- if (stat (filename, &st) < 0 && !S_ISDIR (st.st_mode)) ++ if (stat (filename, &st) < 0 || S_ISDIR (st.st_mode)) + return NULL; + ++#ifdef HAVE_ZIO ++ ext = strrchr(filename, '.'); ++ if (ext && STREQ (ext, ".gz")) { ++ /* informational only; no shell quoting concerns */ ++ char *name = appendstr (NULL, "zcat < ", filename, NULL); ++ cmd = command_new_function (name, &decompress_zio, "g"); ++ free (name); ++ p = pipeline_new_commands (cmd, NULL); ++ p->libzio = 1; ++ goto got_pipeline; ++ } ++ if (ext && STREQ (ext, ".z")) { ++ /* informational only; no shell quoting concerns */ ++ char *name = appendstr (NULL, "zcat < ", filename, NULL); ++ cmd = command_new_function (name, &decompress_zio, "z"); ++ free (name); ++ p = pipeline_new_commands (cmd, NULL); ++ p->libzio = 1; ++ goto got_pipeline; ++ } ++ if (ext && STREQ (ext, ".bz2")) { ++ /* informational only; no shell quoting concerns */ ++ char *name = appendstr (NULL, "bzcat < ", filename, NULL); ++ cmd = command_new_function (name, &decompress_zio, "b"); ++ free (name); ++ p = pipeline_new_commands (cmd, NULL); ++ p->libzio = 1; ++ goto got_pipeline; ++ } ++ if (ext && STREQ (ext, ".Z")) { ++ /* informational only; no shell quoting concerns */ ++ char *name = appendstr (NULL, "zcat < ", filename, NULL); ++ cmd = command_new_function (name, &decompress_zio, "Z"); ++ free (name); ++ p = pipeline_new_commands (cmd, NULL); ++ p->libzio = 1; ++ goto got_pipeline; ++ } ++#endif /* HAVE_ZIO */ ++ + #ifdef HAVE_LIBZ + filename_len = strlen (filename); + if (filename_len > 3 && STREQ (filename + filename_len - 3, ".gz")) { +--- lib/pipeline.c ++++ lib/pipeline.c 2008-04-22 13:38:04.181934493 +0000 +@@ -50,6 +50,10 @@ + #include "error.h" + #include "pipeline.h" + ++#ifdef HAVE_ZIO ++# include "zio.h" ++#endif /* HAVE_ZIO */ ++ + /* ---------------------------------------------------------------------- */ + + /* Functions to build individual commands. */ +@@ -441,6 +445,9 @@ pipeline *pipeline_new (void) + p->commands = xnmalloc (p->commands_max, sizeof *p->commands); + p->pids = NULL; + p->statuses = NULL; ++#ifdef HAVE_ZIO ++ p->libzio = 0; ++#endif + p->want_in = p->want_out = 0; + p->want_infile = p->want_outfile = NULL; + p->infd = p->outfd = -1; +@@ -479,6 +486,9 @@ pipeline *pipeline_join (pipeline *p1, p + pipeline *p = XMALLOC (pipeline); + int i; + ++#ifdef HAVE_ZIO ++ assert (p->libzio); ++#endif + assert (!p1->pids); + assert (!p2->pids); + assert (!p1->statuses); +@@ -614,6 +624,9 @@ void pipeline_commands (pipeline *p, ... + + FILE *pipeline_get_infile (pipeline *p) + { ++#ifdef HAVE_ZIO ++ assert (!p->libzio); ++#endif + assert (p->pids); /* pipeline started */ + assert (p->statuses); + if (p->infile) +@@ -627,6 +640,12 @@ FILE *pipeline_get_infile (pipeline *p) + + FILE *pipeline_get_outfile (pipeline *p) + { ++#ifdef HAVE_ZIO ++ if (p->libzio) { ++ assert (p->outfile != (FILE*)0); ++ return p->outfile; ++ } ++#endif + assert (p->pids); /* pipeline started */ + assert (p->statuses); + if (p->outfile) +@@ -707,6 +726,24 @@ void pipeline_start (pipeline *p) + int infd[2]; + sigset_t set, oset; + ++#ifdef HAVE_ZIO ++ if (p->ncommands != 1) /* A pipe to the following commands required */ ++ p->libzio = 0; ++ ++ if (p->libzio) { ++ struct command_function *cmdf; ++ ++ assert (p->ncommands == 1); ++ assert (p->commands[0]->tag == COMMAND_FUNCTION); ++ assert (p->want_infile != NULL); ++ ++ cmdf = &p->commands[0]->u.function; ++ ++ p->outfile = fzopen(p->want_infile, "r"); ++ ++ return; ++ } ++#endif + /* Flush all pending output so that subprocesses don't inherit it. */ + fflush (NULL); + +@@ -1009,6 +1046,18 @@ int pipeline_wait (pipeline *p) + pipeline_dump (p, stderr); + } + ++#ifdef HAVE_ZIO ++ if (p->libzio) { ++ assert (p->outfile != (FILE*)0); ++ if (fclose (p->outfile)) { ++ error (0, errno, _("closing pipeline output stream failed")); ++ ret = 1; ++ } ++ p->outfile = (FILE*)0; ++ return ret; ++ } ++#endif ++ + assert (p->pids); /* pipeline started */ + assert (p->statuses); + +@@ -1549,11 +1598,20 @@ static const char *get_block (pipeline * + + if (!peek) + p->peek_offset = 0; +- ++#ifdef HAVE_ZIO ++ if (p->libzio) { ++ assert (p->outfile != (FILE*)0); ++ r = fread (p->buffer + readstart, sizeof(char), toread, p->outfile); ++ goto out; ++ } ++#endif + assert (p->outfd != -1); + r = read (p->outfd, p->buffer + readstart, toread); + if (r == -1) + return NULL; ++#ifdef HAVE_ZIO ++out: ++#endif + p->buflen = readstart + r; + if (peek) + p->peek_offset += r; +--- lib/pipeline.h ++++ lib/pipeline.h 2008-04-22 10:49:00.455159182 +0000 +@@ -60,6 +60,14 @@ typedef struct pipeline { + pid_t *pids; + int *statuses; /* -1 until command exits */ + ++#ifdef HAVE_ZIO ++ /* ++ * Uses for e.g. simple decompression the help of libzio. ++ * Do not fork in this case but open the compressed files. ++ */ ++ int libzio; ++#endif ++ + /* To be set by the caller. If positive, these contain + * caller-supplied file descriptors for the input and output of the + * whole pipeline. If negative, pipeline_start() will create pipes diff --git a/man-db-2.5.0.dif b/man-db-2.5.1.dif similarity index 68% rename from man-db-2.5.0.dif rename to man-db-2.5.1.dif index ba1d188..acd4962 100644 --- a/man-db-2.5.0.dif +++ b/man-db-2.5.1.dif @@ -1,62 +1,22 @@ --- .pkgextract -+++ .pkgextract 2007-12-10 12:51:40.892874000 +0100 -@@ -0,0 +1,9 @@ -+bzcat ../man-db_2.5.0-4.diff.bz2 | patch -p1 -s --suffix=.debian ++++ .pkgextract 2008-04-21 13:24:22.498193000 +0200 +@@ -0,0 +1,8 @@ ++bzcat ../man-db_2.5.1-3.diff.bz2 | patch -p1 -s --suffix=.debian +patch -p0 -s --suffix=.groff < ../man-db-2.3.19deb4.0-groff.dif -+patch -p0 -s --suffix=.err < ../man-db-2.5.0-error.dif +patch -p0 -s --suffix=.sect < ../man-db-2.4.3-section.dif -+patch -p0 -s --suffix=.secu4 < ../man-db-2.5.0-security4.dif ++patch -p0 -s --suffix=.secu4 < ../man-db-2.5.1-security4.dif +patch -p0 -s --suffix=.firefox< ../man-db-2.4.3-firefox.dif -+patch -p0 -s --suffix=.chinese< ../man-db-2.5.0-chinese.dif -+patch -p0 -s --suffix=.glob < ../man-db-2.4.3-globbing.dif -+patch -p0 -s --suffix=.zio < ../man-db-2.5.0-zio.dif ---- GNUmakefile.in -+++ GNUmakefile.in 2007-12-11 12:56:21.536072000 +0100 -@@ -35,7 +35,7 @@ - # Make targets are: # - # # - # all install uninstall mostlyclean clean distclean realclean TAGS ID # --# FILES lib src man intl libdb update RCS dist # -+# FILES lib src man libdb update RCS dist # - #------------------------------------------------------------------------# - - srcdir = @srcdir@ -@@ -51,9 +51,9 @@ USE_NLS = @USE_NLS@ - # GNUmakefile and include/Defines are automatic targets, don't add below. - INCLUDES := config.h $(addprefix include/, manconfig.h comp_src.h) - CONF = src/man_db.conf --EVERYTHING = intl lib libdb src man po --ALL = intl lib libdb src man po --INSTALL = src man intl po -+EVERYTHING = lib libdb src man po -+ALL = lib libdb src man po -+INSTALL = src man po - - include include/Defines - -@@ -163,7 +163,7 @@ __TAGS: - install: $(INCLUDES) $(CONF) - - install uninstall: -- for i in $(INSTALL); do $(MAKE) prefix=$(prefix) -C $$i $@; done -+ for i in $(INSTALL); do $(MAKE) prefix=$(prefix) DESTDIR=$(DESTDIR) -C $$i $@; done - - TAGS realclean distclean mostlyclean clean: - for i in $(EVERYTHING); do $(MAKE) prefix=$(prefix) -C $$i $@ clean=yes; done -@@ -220,7 +220,6 @@ dist: update - for file in $(FILES); do \ - cp -p $(srcdir)/$$file $(man_db)/$$file; \ - done -- $(MAKE) -C intl dist - # Maintainers may wish to run 'make -C po update-po' beforehand. - # This is not done automatically, since the .po files are stored - # in revision control. ++patch -p0 -s --suffix=.chinese< ../man-db-2.5.1-chinese.dif ++patch -p0 -s --suffix=.glob < ../man-db-2.5.1-globbing.dif ++patch -p0 -s --suffix=.zio < ../man-db-2.5.1-zio.dif --- configure.ac -+++ configure.ac 2008-01-29 19:07:22.794596000 +0100 -@@ -10,17 +10,30 @@ AC_CONFIG_HEADER(config.h) ++++ configure.ac 2008-04-21 15:16:11.651973000 +0200 +@@ -14,13 +14,26 @@ fi + + AC_CONFIG_HEADER(config.h) AC_CANONICAL_HOST - AC_ARG_PROGRAM - dnl +- ++dnl +dnl Check $PATH for the following progs and append suitable options. +dnl +AC_PROG_CC @@ -69,36 +29,54 @@ +AC_MINIX +AC_ISC_POSIX +dnl - dnl Define below date and version information to be put into man pages etc. - dnl - datemark=20071007 + # Define below date and version information to be put into man pages etc. + datemark=20080128 date=`LANG=C date -d $datemark +'%Y-%m-%d'` AC_SUBST(date)dnl - dnl + roff_version=`echo AC_PACKAGE_VERSION | sed 's/-/\\-/g'` + AC_SUBST(roff_version)dnl +m4_pattern_allow([AC_DEFINE_UNQUOTED]) - PACKAGE=AC_PACKAGE_NAME - VERSION=AC_PACKAGE_VERSION --AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", -+AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], - [Define to the name of the distribution.]) --AC_DEFINE_UNQUOTED(VERSION, "$VERSION", -+AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], - [Define to the version of the distribution.]) - AC_SUBST(PACKAGE)dnl - AC_SUBST(VERSION)dnl -@@ -119,9 +132,6 @@ AC_SUBST(config_file_basename)dnl - dnl - dnl Check $PATH for the following progs and append suitable options. - dnl + + # We have to be a bit naughty here and supply options. + # The autoconf literature states that only features that can be separately +@@ -41,12 +54,12 @@ AS_HELP_STRING([--disable-setuid], [don' + man_owner=$enableval + man_mode="4755" + AC_MSG_NOTICE([Man will be installed setuid $enableval]) +- AC_DEFINE_UNQUOTED(SECURE_MAN_UID, "$man_owner", ++ AC_DEFINE_UNQUOTED([SECURE_MAN_UID], "$man_owner", + [Define as the setuid owner of man or undefine if not installing setuid.]) + fi], + [man_owner=man + man_mode="4755" +- AC_DEFINE_UNQUOTED(SECURE_MAN_UID, "$man_owner")]) ++ AC_DEFINE_UNQUOTED([SECURE_MAN_UID], "$man_owner")]) + AC_ARG_ENABLE(undoc, + [AS_HELP_STRING([--enable-undoc=COMMAND], [suggest COMMAND for missing manual pages])], + [if test "$enableval" = "yes" || test "$enableval" = "no" +@@ -54,7 +67,7 @@ AC_ARG_ENABLE(undoc, + AC_MSG_ERROR(--enable-undoc requires an argument) + else + AC_MSG_NOTICE([Suggesting '$enableval' for missing manual pages]) +- AC_DEFINE_UNQUOTED(UNDOC_COMMAND, "$enableval", ++ AC_DEFINE_UNQUOTED([UNDOC_COMMAND], "$enableval", + [Define as the name of a command you want to suggest when a non-existent page is requested.]) + fi]) + AC_ARG_WITH(device, +@@ -115,10 +128,7 @@ AC_SUBST(config_file_dirname)dnl + AC_SUBST(sections)dnl + + # Check $PATH for the following programs and append suitable options. -AC_GNU_SOURCE -AC_PROG_CC + gl_EARLY -AC_PROG_CPP CFLAGS="$CFLAGS -Wall" if test "$GCC" = yes then -@@ -232,6 +242,14 @@ else +@@ -255,6 +265,14 @@ then fi - dnl + MAN_CHECK_PROGS([eqn], [EQN], [use EQN to preprocess equations], [eqn geqn]) +MAN_CHECK_PROGS([geqn], [GEQN], [use GEQN to preprocess equations], [geqn]) +dnl @@ -109,9 +87,9 @@ + test $geqn -ef $eqn && neqn="$eqn -T$nroff_device" +fi MAN_CHECK_PROGS([neqn], [NEQN], [use NEQN to preprocess equations for character devices], [neqn gneqn]) - dnl - dnl if we fail to find an neqn, use eqn and try to force it to output -@@ -258,9 +276,15 @@ then + # If we fail to find an neqn, use eqn and try to force it to output for an + # ascii device. As this is only relevant for equations (?), not using latin1 +@@ -280,9 +298,15 @@ then compress_ext="gz" fi MAN_CHECK_PROGS([compress], [COMPRESS], [use COMPRESS as UNIX compression utility], [compress]) @@ -129,26 +107,43 @@ if test -z "$gzip" then compressor="$compress -c" -@@ -334,9 +358,6 @@ AC_ARG_ENABLE(mandirs, - dnl - dnl check for various header files and associated libraries. - dnl --AC_AIX --AC_MINIX --AC_ISC_POSIX - dnl AC_PROG_LEX calls AC_TRY_LINK: must come after above 3 - AC_PROG_LEX - AC_HEADER_STDC -@@ -529,7 +550,6 @@ AC_CONFIG_FILES(GNUmakefile - include/Defines +@@ -334,7 +358,7 @@ dnl To add more decompressors just follo + AC_ARG_ENABLE(mandirs, + [AS_HELP_STRING([--enable-mandirs=OS], [select manual page hierarchy organization (GNU, HPUX, IRIX, Solaris, BSD)])], + [AC_MSG_NOTICE([Using $enableval hierarchy organization(s)]) +- AC_DEFINE_UNQUOTED(MANDIR_LAYOUT, "$enableval", ++ AC_DEFINE_UNQUOTED([MANDIR_LAYOUT], "$enableval", + [Define to the manual page hierarchy organization(s) in use.])], + [case $host in + *-gnu) mandirs=GNU;; +@@ -346,7 +370,7 @@ AC_ARG_ENABLE(mandirs, + esac + if test -n "$mandirs"; then + AC_MSG_NOTICE([Using $mandirs hierarchy organization]) +- AC_DEFINE_UNQUOTED(MANDIR_LAYOUT, "$mandirs") ++ AC_DEFINE_UNQUOTED([MANDIR_LAYOUT], "$mandirs") + else + AC_MSG_NOTICE([Allowing any hierarchy organization]) + AC_DEFINE(MANDIR_LAYOUT, "") +@@ -362,8 +386,7 @@ AC_HEADER_DIRENT + AC_CHECK_HEADERS(fcntl.h sys/file.h) + + # Internationalization support. +-AM_GNU_GETTEXT +-AM_GNU_GETTEXT_VERSION([0.17]) ++AM_GNU_GETTEXT([external]) + AC_SUBST(LINGUAS) + AM_ICONV + AM_CONDITIONAL([NLS], [test "$USE_NLS" = yes]) +@@ -487,6 +510,5 @@ AC_CONFIG_FILES(Makefile + tools/Makefile include/comp_src.h include/manconfig.h - intl/Makefile po/Makefile.in) AC_OUTPUT - --- mk_catdirs -+++ mk_catdirs 2007-12-10 12:51:50.430084000 +0100 ++++ mk_catdirs 2007-12-10 12:51:50.000000000 +0100 @@ -0,0 +1,24 @@ +#!/bin/sh + @@ -174,22 +169,8 @@ + +test "$(id -u)" -ne 0 || chown man:daemon -R ${CACHE} + ---- include/Defines.in -+++ include/Defines.in 2007-12-10 12:51:50.466089000 +0100 -@@ -98,7 +98,11 @@ DEFAULT_TARGETS = TAGS all install unins - debug = @debug@ - date = @date@ - version = @VERSION@ -+ifeq ($(shell id -u),0) - man_install_flags = @man_install_flags@ -+else -+man_install_flags = -m 0755 -+endif - - # some path definitions required by the manpage Makefile... - pager="@pager@" --- include/comp_src.h.in -+++ include/comp_src.h.in 2007-12-10 12:51:50.498093000 +0100 ++++ include/comp_src.h.in 2007-12-10 12:51:50.000000000 +0100 @@ -53,7 +53,7 @@ struct compression comp_list[] = { #endif /* HAVE_GZIP */ @@ -200,7 +181,7 @@ #endif /* HAVE_COMPRESS */ --- include/manconfig.h.in -+++ include/manconfig.h.in 2008-01-30 11:56:48.181631000 +0100 ++++ include/manconfig.h.in 2008-04-21 13:32:55.820086000 +0200 @@ -73,7 +73,7 @@ #undef MAN_DB_CREATES @@ -210,7 +191,7 @@ /* By default, man-db will store a whatis referenced manual page in favour of a stray cat page when they both share identical namespace. If you -@@ -136,7 +136,7 @@ +@@ -137,7 +137,7 @@ #ifndef NROFF_MISSING # ifndef NROFF @@ -219,45 +200,7 @@ # endif #endif -@@ -240,8 +240,12 @@ - #ifdef inline - /* autoconf #defines inline to be either "__inline", "__inline__" - or "" if the compiler doesn't like inline */ --# define __inline__ inline --# define __inline inline -+# ifndef __inline__ -+# define __inline__ inline -+# endif -+# ifndef __inline -+# define __inline inline -+# endif - #endif /* inline */ - - /* my gcc specs file is hacked to define __profile__ if I compile with -@@ -385,11 +389,17 @@ extern char *trim_spaces (const char *s) - extern char *lang_dir (const char *filename); - - #ifndef HAVE_BASENAME --extern char *basename (); -+# ifndef _STRING_H -+# include -+# endif - #endif /* HAVE_BASENAME */ - - #ifndef HAVE_STRSEP - extern char *strsep (char **stringp, const char *delim); -+#else -+# ifndef _STRING_H -+# include -+# endif - #endif /* !HAVE_STRSEP */ - - #ifndef HAVE_GETCWD -@@ -414,12 +424,13 @@ extern char *program_name; /* the basena - #define FAIL 1 /* usage or syntax error */ - #define FATAL 2 /* operational error */ - #define CHILD_FAIL 3 /* child failed */ --#define INTERRUPTED 4 /* Interrupted by signal */ +@@ -376,8 +376,10 @@ extern char *program_name; /* the basena #define NOT_FOUND 16 /* No action was taken */ /* System or user catpaths? Allow bitwise disjunctions of these. */ @@ -271,8 +214,8 @@ /* string macros */ #define STREQ(a,b) (strcmp(a,b) == 0) --- intl/Makefile.in -+++ intl/Makefile.in 2007-12-10 12:51:50.562101000 +0100 -@@ -177,7 +177,7 @@ libgnuintl.h.msvc-shared Makefile.msvc ++++ intl/Makefile.in 2007-12-10 12:51:51.000000000 +0100 +@@ -181,7 +181,7 @@ libgnuintl.h.msvc-shared Makefile.msvc all: all-@USE_INCLUDED_LIBINTL@ all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed @@ -281,60 +224,69 @@ all-no-yes: libgnuintl.$la all-no-no: ---- lib/basename.c -+++ lib/basename.c 2007-12-10 12:51:50.598106000 +0100 -@@ -37,11 +37,13 @@ - extern char *strrchr(); - #endif /* STDC_HEADERS */ +--- libdb/db_storage.h ++++ libdb/db_storage.h 2008-04-21 15:18:55.504996000 +0200 +@@ -70,10 +70,10 @@ struct mandata { + }; -+#ifndef HAVE_BASENAME - /* return basename of given filename */ --char *basename(char *filename) -+char *basename(const char *filename) - { - char *base; + /* used by the world */ +-extern inline struct mandata *dblookup_all (const char *page, ++extern struct mandata *dblookup_all (const char *page, + const char *section, + int match_case); +-extern inline struct mandata *dblookup_exact (const char *page, ++extern struct mandata *dblookup_exact (const char *page, + const char *section, + int match_case); + extern int dbstore (struct mandata *in, const char *base); +@@ -85,10 +85,10 @@ extern void split_content (char *cont_pt + extern int compare_ids (char a, char b); - base = strrchr(filename, '/'); - return base ? base + 1 : filename; - } -+#endif ---- lib/cleanup.c -+++ lib/cleanup.c 2007-12-10 13:07:01.233682000 +0100 -@@ -102,7 +102,7 @@ trap_signal (int signo, struct sigaction - - act.sa_handler = sighandler; - sigemptyset (&act.sa_mask); -- act.sa_flags = 0; -+ act.sa_flags = SA_ONESHOT; - return xsigaction (signo, &act, oldact); - } - ---- lib/xmalloc.c -+++ lib/xmalloc.c 2007-12-10 12:51:50.666114000 +0100 -@@ -39,6 +39,8 @@ void free (); - The caller may set it to some other value. */ - int xmalloc_exit_failure = EXIT_FAILURE; - -+#include "manconfig.h" -+ - static void * - fixup_null_alloc (size_t n) - { ---- libdb/Makefile.in -+++ libdb/Makefile.in 2007-12-10 13:08:09.382330000 +0100 -@@ -35,9 +35,6 @@ include $(top_srcdir)/include/Defines - - MANDEFS = - MANCPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir) -I$(srcdir) --ifeq ($(USE_NLS),yes) --MANCPPFLAGS += -I$(top_srcdir)/intl --endif - - # The default programs to build - ALL = db_store.o db_delete.o db_lookup.o \ + /* local to db routines */ +-extern inline void gripe_lock (char *filename); +-extern inline void gripe_corrupt_data (void); ++extern void gripe_lock (char *filename); ++extern void gripe_corrupt_data (void); + extern datum make_multi_key (const char *page, const char *ext); +-extern inline struct mandata *infoalloc (void); ++extern struct mandata *infoalloc (void); + extern char *name_to_key (const char *name); + extern char **split_data (char *content, char *start[]); + extern datum make_content (struct mandata *in); --- libdb/mydbm.h -+++ libdb/mydbm.h 2007-12-10 12:51:50.738124000 +0100 -@@ -150,7 +150,7 @@ extern __inline__ int btree_nextkeydata( ++++ libdb/mydbm.h 2008-04-21 15:20:08.366342000 +0200 +@@ -42,7 +42,7 @@ + # include + + # ifndef HAVE_GDBM_EXISTS +-extern inline int gdbm_exists(GDBM_FILE dbf, datum key); ++extern int gdbm_exists(GDBM_FILE dbf, datum key); + # endif /* !HAVE_GDBM_EXISTS */ + + /* gdbm_nextkey() is not lexicographically sorted, so we need to keep the +@@ -133,14 +133,14 @@ extern int ndbm_flclose(DBM *dbf); + typedef DBT datum; + + extern DB *btree_flopen(char *filename, int flags, int mode); +-extern inline int btree_close(DB *db); +-extern inline int btree_exists(DB *db, datum key); +-extern inline datum btree_fetch(DB *db, datum key); ++extern int btree_close(DB *db); ++extern int btree_exists(DB *db, datum key); ++extern datum btree_fetch(DB *db, datum key); + extern int btree_insert(DB *db, datum key, datum cont); +-extern inline datum btree_firstkey(DB *db); +-extern inline datum btree_nextkey(DB *db); +-extern inline int btree_replace(DB *db, datum key, datum content); +-extern inline int btree_nextkeydata(DB *db, datum *key, datum *cont); ++extern datum btree_firstkey(DB *db); ++extern datum btree_nextkey(DB *db); ++extern int btree_replace(DB *db, datum key, datum content); ++extern int btree_nextkeydata(DB *db, datum *key, datum *cont); + + # define DB_EXT ".bt" + # define MYDBM_FILE DB* +@@ -148,7 +148,7 @@ extern inline int btree_nextkeydata(DB * # define MYDBM_SET_DPTR(d, value) ((d).data = (char *) (value)) # define MYDBM_DSIZE(d) ((d).size) # define MYDBM_CTRWOPEN(file) btree_flopen(file, O_TRUNC|O_CREAT|O_RDWR, DBMODE) @@ -343,52 +295,8 @@ # define MYDBM_RWOPEN(file) btree_flopen(file, O_RDWR, DBMODE) # define MYDBM_RDOPEN(file) btree_flopen(file, O_RDONLY, DBMODE) # define MYDBM_INSERT(db, key, cont) btree_insert(db, key, cont) ---- man/Makefile.in -+++ man/Makefile.in 2007-12-11 13:10:03.780541000 +0100 -@@ -85,17 +85,17 @@ man8files = $(addprefix $(path)/man8/, $ - allmanpages := $(foreach file, $(foreach path, . $(NLS), $(man1files) $(man5files) $(man8files)), $(subst .man,.,$(wildcard $(file)))) - - # NB manpath.5 is not expanded --man.1 = $(DESTDIR)$(manroot)/$(nlspath)/$(man1dir)/$(man)$(man1ext) --manpath.1 = $(DESTDIR)$(manroot)/$(nlspath)/$(man1dir)/$(manpath)$(man1ext) --apropos.1 = $(DESTDIR)$(manroot)/$(nlspath)/$(man1dir)/$(apropos)$(man1ext) --whatis.1 = $(DESTDIR)$(manroot)/$(nlspath)/$(man1dir)/$(whatis)$(man1ext) --zsoelim.1 = $(DESTDIR)$(manroot)/$(nlspath)/$(man1dir)/$(zsoelim)$(man1ext) --lexgrog.1 = $(DESTDIR)$(manroot)/$(nlspath)/$(man1dir)/lexgrog$(man1ext) --manconv.1 = $(DESTDIR)$(manroot)/$(nlspath)/$(man1dir)/$(manconv)$(man1ext) --manpath.5 = $(DESTDIR)$(manroot)/$(nlspath)/$(man5dir)/manpath$(man5ext) --mandb.8 = $(DESTDIR)$(manroot)/$(nlspath)/$(man8dir)/$(mandb)$(man8ext) --catman.8 = $(DESTDIR)$(manroot)/$(nlspath)/$(man8dir)/$(catman)$(man8ext) --accessdb.8 = $(DESTDIR)$(manroot)/$(nlspath)/$(man8dir)/accessdb$(man8ext) -+man.1 = $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man1dir)/$(man)$(man1ext) -+manpath.1 = $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man1dir)/$(manpath)$(man1ext) -+apropos.1 = $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man1dir)/$(apropos)$(man1ext) -+whatis.1 = $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man1dir)/$(whatis)$(man1ext) -+zsoelim.1 = $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man1dir)/$(zsoelim)$(man1ext) -+lexgrog.1 = $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man1dir)/lexgrog$(man1ext) -+manconv.1 = $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man1dir)/$(manconv)$(man1ext) -+manpath.5 = $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man5dir)/manpath$(man5ext) -+mandb.8 = $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man8dir)/$(mandb)$(man8ext) -+catman.8 = $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man8dir)/$(catman)$(man8ext) -+accessdb.8 = $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man8dir)/accessdb$(man8ext) - - # Rules... We've got some rules 'round here. - %.1: %.man1 -@@ -119,9 +119,9 @@ endif - - # special targets - nlsinstall: -- $(MKINSTALLDIRS) $(DESTDIR)$(manroot)/$(nlspath)/$(man1dir) -- $(MKINSTALLDIRS) $(DESTDIR)$(manroot)/$(nlspath)/$(man5dir) -- $(MKINSTALLDIRS) $(DESTDIR)$(manroot)/$(nlspath)/$(man8dir) -+ $(MKINSTALLDIRS) $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man1dir) -+ $(MKINSTALLDIRS) $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man5dir) -+ $(MKINSTALLDIRS) $(DESTDIR)$(manroot)/$(basename $(nlspath))/$(man8dir) - $(INSTALL_DATA) $(nlspath)/man1/man.1 $(man.1) - $(INSTALL_DATA) $(nlspath)/man1/manpath.1 $(manpath.1) - $(INSTALL_DATA) $(nlspath)/man1/apropos.1 $(apropos.1) ---- man/de.UTF-8/man1/man.man1 -+++ man/de.UTF-8/man1/man.man1 2007-12-11 12:28:04.213373000 +0100 +--- man/de/man1/man.man1 ++++ man/de/man1/man.man1 2008-04-21 13:41:48.584537000 +0200 @@ -98,6 +98,7 @@ der Manualseiten gefolgt vom Typ der dor .TS tab (@); @@ -397,8 +305,8 @@ 1@Ausführbare Programme oder Shellbefehle 2@Systemaufrufe (Kernelfunktionen) 3@Bibliotheksaufrufe (Funktionen in System-Bibliotheken) ---- man/es.UTF-8/man1/man.man1 -+++ man/es.UTF-8/man1/man.man1 2007-12-10 13:11:03.360408000 +0100 +--- man/es/man1/man.man1 ++++ man/es/man1/man.man1 2008-04-21 13:41:57.397670000 +0200 @@ -101,6 +101,7 @@ del manual y los tipos de páginas que c .TS tab (@); @@ -407,8 +315,8 @@ 1@Programas ejecutables y guiones del intérprete de @órdenes 2@Llamadas del sistema (funciones servidas por el núcleo) ---- man/it.UTF-8/man1/man.man1 -+++ man/it.UTF-8/man1/man.man1 2007-12-10 12:53:23.697923000 +0100 +--- man/it/man1/man.man1 ++++ man/it/man1/man.man1 2008-04-21 13:42:01.538202000 +0200 @@ -124,6 +124,7 @@ del manuale seguiti dai tipi di pagine c .TS tab (@); @@ -417,8 +325,8 @@ 1@Programmi eseguibili e comandi della shell 2@Chiamate al sistema (funzioni fornite dal kernel) 3@Chiamate alle librerie (funzioni all'interno delle ---- man/ja.UTF-8/man1/man.man1 -+++ man/ja.UTF-8/man1/man.man1 2007-12-10 13:11:42.941431000 +0100 +--- man/ja/man1/man.man1 ++++ man/ja/man1/man.man1 2008-04-21 13:42:05.278682000 +0200 @@ -104,6 +104,7 @@ .TS tab (@); @@ -428,8 +336,8 @@ 2@システムコール (カーネルが提供する関数) 3@ライブラリコール (システムライブラリに含まれる関数) --- man/man1/man.man1 -+++ man/man1/man.man1 2007-12-10 12:53:31.282886000 +0100 -@@ -114,6 +114,7 @@ numbers of the manual followed by the ty ++++ man/man1/man.man1 2007-12-10 12:53:31.000000000 +0100 +@@ -118,6 +118,7 @@ numbers of the manual followed by the ty .TS tab (@); l l. @@ -437,42 +345,32 @@ 1@Executable programs or shell commands 2@System calls (functions provided by the kernel) 3@Library calls (functions within program libraries) ---- src/Makefile.in -+++ src/Makefile.in 2007-12-10 13:13:47.713263000 +0100 -@@ -40,7 +40,7 @@ include ../include/Defines +--- src/Makefile.am ++++ src/Makefile.am 2008-04-21 16:44:47.190572968 +0200 +@@ -170,15 +170,11 @@ apropos$(EXEEXT): whatis$(EXEEXT) + all-am: apropos$(EXEEXT) - MANDEFS = -DCONFIG_FILE=\"$(config_file)\" \ - -DLOCALEDIR=\"$(gnulocaledir)\" $(DEFS_$(subst /,_,$@)) --MANCPPFLAGS = -I../include -I$(top_srcdir) -I$(srcdir) -I../intl -+MANCPPFLAGS = -I../include -I$(top_srcdir) -I$(srcdir) -I. + install-exec-hook: +- -test -z "$(man_owner)" || \ +- chown $(man_owner) \ +- $(DESTDIR)$(bindir)/$(TRANS_MAN) \ +- $(DESTDIR)$(bindir)/$(TRANS_MANDB) +- chmod $(man_mode) \ +- $(DESTDIR)$(bindir)/$(TRANS_MAN) \ +- $(DESTDIR)$(bindir)/$(TRANS_MANDB) +- cd $(DESTDIR)$(bindir) && rm -f $(TRANS_APROPOS)$(EXEEXT) && \ +- $(LN_S) $(TRANS_WHATIS)$(EXEEXT) $(TRANS_APROPOS)$(EXEEXT) ++ $(INSTALL_PROGRAM) $(TRANS_MAN) $(DESTDIR)$(pkglibexecdir)/$(TRANS_MAN) ++ $(INSTALL_PROGRAM) $(TRANS_MANDB) $(DESTDIR)$(pkglibexecdir)/$(TRANS_MANDB) ++ $(INSTALL_PROGRAM) wrapper $(DESTDIR)$(bindir)/$(TRANS_MANDB) ++ ln -f $(DESTDIR)$(bindir)/$(TRANS_MANDB) $(DESTDIR)$(bindir)/$(TRANS_MAN) ++ $(LN_S) $(TRANS_WHATIS) $(DESTDIR)$(bindir)/$(TRANS_APROPOS) - #----------------------------------------------------------------# - # user changeable definitions can be found in ../include/Defines # -@@ -123,7 +123,7 @@ apropos: whatis.c - # Rules to test code as program unit - lexgrog: lexgrog.c compression.o descriptions.o encodings.o fake_security.o \ - ult_src.o util.o -- $(LINK.c) -DTEST $^ $(LDLIBS) -o $@ -+ $(LINK.c) -g -DTEST $^ $(LDLIBS) -o $@ - - globbing: globbing.c util.o - $(LINK.c) -DTEST $^ $(LDLIBS) -o $@ -@@ -132,8 +132,10 @@ globbing: globbing.c util.o - install: - $(MKINSTALLDIRS) $(DESTDIR)$(bindir) $(DESTDIR)$(sbindir) \ - $(DESTDIR)$(libdir)/man-db -- $(INSTALL_PROGRAM) $(man_install_flags) man $(DESTDIR)$(bindir)/$(man) -- $(INSTALL_PROGRAM) $(man_install_flags) mandb $(DESTDIR)$(bindir)/$(mandb) -+ $(INSTALL_PROGRAM) $(man_install_flags) man $(DESTDIR)$(libdir)/man-db/$(man) -+ $(INSTALL_PROGRAM) $(man_install_flags) mandb $(DESTDIR)$(libdir)/man-db/$(mandb) -+ $(INSTALL_PROGRAM) $(man_install_flags) wrapper $(DESTDIR)$(bindir)/$(mandb) -+ ln -f $(DESTDIR)$(bindir)/$(mandb) $(DESTDIR)$(bindir)/$(man) - $(INSTALL_PROGRAM) manpath $(DESTDIR)$(bindir)/$(manpath) - $(INSTALL_PROGRAM) catman $(DESTDIR)$(bindir)/$(catman) - $(INSTALL_PROGRAM) whatis $(DESTDIR)$(bindir)/$(whatis) + install-data-hook: + @if test -f $(DESTDIR)$(config_file); then \ --- src/catman.c -+++ src/catman.c 2008-01-30 12:02:20.699895000 +0100 -@@ -494,7 +494,7 @@ int main (int argc, char *argv[]) ++++ src/catman.c 2008-01-30 12:02:21.000000000 +0100 +@@ -450,7 +450,7 @@ int main (int argc, char *argv[]) char *catpath; size_t len; @@ -482,8 +380,8 @@ if (catpath) { if (is_directory (catpath) != 1) { --- src/check_mandirs.c -+++ src/check_mandirs.c 2007-12-10 13:15:48.608604000 +0100 -@@ -391,10 +391,10 @@ static short testmandirs (const char *pa ++++ src/check_mandirs.c 2007-12-10 13:15:49.000000000 +0100 +@@ -379,10 +379,10 @@ static short testmandirs (const char *pa } if (!quiet) { @@ -495,7 +393,7 @@ } add_dir_entries (path, mandir->d_name); MYDBM_CLOSE (dbf); -@@ -590,7 +590,7 @@ short update_db (const char *manpath) +@@ -571,7 +571,7 @@ short update_db (const char *manpath) return new; } @@ -504,7 +402,7 @@ return EOF; } -@@ -766,6 +766,7 @@ static short purge_whatis (const char *p +@@ -747,6 +747,7 @@ static short purge_whatis (const char *p "would delete\n", name, info->ext); return 1; } @@ -512,7 +410,7 @@ } /* Check that multi keys are correctly constructed. */ -@@ -828,6 +829,11 @@ short purge_missing (const char *manpath +@@ -809,6 +810,11 @@ short purge_missing (const char *manpath gripe_rwopen_failed (); return 0; } @@ -524,7 +422,7 @@ key = MYDBM_FIRSTKEY (dbf); -@@ -846,6 +852,14 @@ short purge_missing (const char *manpath +@@ -827,6 +833,14 @@ short purge_missing (const char *manpath continue; } @@ -537,11 +435,22 @@ + } + content = MYDBM_FETCH (dbf, key); - if (!MYDBM_DPTR (content)) - return count; + if (!MYDBM_DPTR (content)) { + nextkey = MYDBM_NEXTKEY (dbf, key); +--- src/encodings.c ++++ src/encodings.c 2008-04-21 15:49:02.153615000 +0200 +@@ -541,7 +541,7 @@ static int compatible_encodings (const c + */ + if ((STREQ (input, "BIG5") || STREQ (input, "BIG5HKSCS") || + STREQ (input, "EUC-JP") || +- STREQ (input, "EUC-CN") || STREQ (input, "GB18030") || STREQ (input, "GBK") ++ STREQ (input, "EUC-CN") || STREQ (input, "GB18030") || STREQ (input, "GBK") || + STREQ (input, "EUC-KR")) && + STREQ (output, "UTF-8")) + return 1; --- src/fake_security.c -+++ src/fake_security.c 2007-12-10 12:53:31.362896000 +0100 -@@ -45,6 +45,7 @@ extern int errno; ++++ src/fake_security.c 2007-12-10 12:53:31.000000000 +0100 +@@ -43,6 +43,7 @@ #include "security.h" uid_t ruid, euid, uid; @@ -550,17 +459,17 @@ #ifdef SECURE_MAN_UID static struct passwd *man_owner; --- src/lexgrog.l -+++ src/lexgrog.l 2007-12-10 16:36:13.786133000 +0100 -@@ -67,7 +67,7 @@ extern int errno; ++++ src/lexgrog.l 2007-12-10 16:36:14.000000000 +0100 +@@ -51,7 +51,7 @@ + #include "security.h" #include "encodings.h" - #include "ult_src.h" -#define YY_READ_BUF_SIZE 1024 +#define YY_READ_BUF_SIZE YY_BUF_SIZE #define MAX_NAME 2048 #ifdef PROFILE -@@ -75,10 +75,10 @@ static int ctr[YY_NUM_RULES]; +@@ -59,10 +59,10 @@ static int ctr[YY_NUM_RULES]; # define YY_USER_ACTION ++ctr[yy_act]; #endif @@ -575,7 +484,7 @@ static char newname[MAX_NAME]; static char *p_name; -@@ -87,6 +87,7 @@ static char filters[MAX_FILTERS]; +@@ -71,6 +71,7 @@ static char filters[MAX_FILTERS]; static int fill_mode; static int waiting_for_quote; @@ -583,7 +492,7 @@ static pipeline *decomp; -@@ -131,7 +132,7 @@ static const char args[] = "mcwfE:hV"; +@@ -87,7 +88,7 @@ static pipeline *decomp; %} %option ecs meta-ecs @@ -592,7 +501,7 @@ %option nostdinit %option warn %option noyywrap nounput -@@ -160,8 +161,9 @@ font_change \\f([[:upper:]1-4]|\({upper} +@@ -116,8 +117,9 @@ font_change \\f([[:upper:]1-4]|\({upper} size_change \\s[+-]?{digit} style_change ({font_change}{size_change}?|{size_change}{font_change}?) typeface \.(B[IR]?|I[BR]?|R[BI]) @@ -603,7 +512,7 @@ /* Please add to this list if you know how. */ /* Note that, since flex only supports UTF-8 by accident, character classes -@@ -194,7 +196,26 @@ vi_name TÊN +@@ -150,7 +152,26 @@ vi_name TÊN zh_CN_name 名{blank}?称{blank}?.* zh_TW_name (名{blank}?稱|命令名){blank}?.* name ({bg_name}|{cs_name}|{da_name}|{de_name}|{en_name}|{es_name}|{fi_name}|{fr_name}|{hu_name}|{id_name}|{it_name}|{ja_name}|{ko_name}|{latin_name}|{nl_name}|{pl_name}|{ru_name}|{sk_name}|{sr_name}|{sv_name}|{tr_name}|{vi_name}|{zh_CN_name}|{zh_TW_name}) @@ -631,7 +540,7 @@ /* eptgrv : eqn, pic, tbl, grap, refer, vgrind */ tbl_request \.TS -@@ -208,8 +229,13 @@ vgrind_request \.vS +@@ -164,8 +185,13 @@ vgrind_request \.vS %% /* begin NAME section processing */ @@ -647,7 +556,7 @@ /* general text matching */ \.[^Ss\r\n].* | -@@ -260,6 +286,7 @@ vgrind_request \.vS +@@ -216,6 +242,7 @@ vgrind_request \.vS {bol}\.sp{blank}* | /* vertical spacing */ {bol}\.ig{blank}* | /* block comment */ {bol}\.de[1i]?{blank}* | /* macro definition */ @@ -655,7 +564,7 @@ {empty}{bol}.+ | <> { /* terminate the string */ *p_name = '\0'; -@@ -285,28 +312,31 @@ vgrind_request \.vS +@@ -241,28 +268,31 @@ vgrind_request \.vS {bol}{typeface}{blank}+ | /* type face commands */ {bol}\.ft{blank}.* | /* font change */ {bol}\.V[be]{blank}.* | /* pod2man, verbatim mode */ @@ -693,7 +602,7 @@ /* escape sequences and special characters */ { -@@ -322,6 +352,7 @@ vgrind_request \.vS +@@ -278,6 +308,7 @@ vgrind_request \.vS {next}\\[|^&!%acdpruz{}\r\n] /* various useless control chars */ {next}\\[bhlLvx]{blank}*'[^']+' /* various inline functions */ @@ -701,7 +610,7 @@ {next}\\\$[1-9] /* interpolate arg */ {next}\\\*(\({alpha})?{alpha} /* interpolate string */ -@@ -350,11 +381,8 @@ vgrind_request \.vS +@@ -306,11 +337,8 @@ vgrind_request \.vS for later processing */ { {bol}\.br{blank}* | @@ -714,7 +623,7 @@ {bol}\.RS{blank}.* | {bol}\.RE{blank}.* add_char_to_whatis ((char) 0x11); } -@@ -367,7 +395,7 @@ vgrind_request \.vS +@@ -323,7 +351,7 @@ vgrind_request \.vS [[:alnum:]]* add_str_to_whatis (yytext, yyleng); /* normalise the period (,) separators */ @@ -723,7 +632,7 @@ {blank}*,{blank}* add_str_to_whatis (", ", 2); {bol}. { -@@ -383,7 +411,7 @@ vgrind_request \.vS +@@ -339,7 +367,7 @@ vgrind_request \.vS %% /* print warning and force scanner to terminate */ @@ -732,7 +641,7 @@ { error (0, 0, _("warning: whatis for %s exceeds %d bytes, truncating."), -@@ -393,7 +421,7 @@ static void too_big (void) +@@ -349,7 +377,7 @@ static void too_big (void) } /* append a string to newname if enough room */ @@ -741,7 +650,7 @@ { if (p_name - newname + length >= MAX_NAME) too_big (); -@@ -404,8 +432,10 @@ static void add_str_to_whatis (const cha +@@ -360,8 +388,10 @@ static void add_str_to_whatis (const cha } /* append a char to newname if enough room */ @@ -753,7 +662,7 @@ if (p_name - newname + 1 >= MAX_NAME) too_big (); else if (waiting_for_quote && c == '"') -@@ -417,14 +447,30 @@ static void add_char_to_whatis (unsigned +@@ -373,14 +403,30 @@ static void add_char_to_whatis (unsigned /* append the " - " separator to newname, trimming the first space if one's * already there */ @@ -786,7 +695,7 @@ { /* If we are mid p_name and the last added char was not a space, * best add one. -@@ -500,6 +546,7 @@ int find_name_decompressed (pipeline *p, +@@ -456,6 +502,7 @@ int find_name_decompressed (pipeline *p, fill_mode = 1; waiting_for_quote = 0; @@ -795,16 +704,16 @@ if (p_lg->type) BEGIN (CAT_FILE); --- src/man.c -+++ src/man.c 2008-02-26 13:05:42.254465287 +0100 -@@ -98,6 +98,7 @@ static char *cwd; ++++ src/man.c 2008-04-21 17:53:02.498707988 +0200 +@@ -66,6 +66,7 @@ static char *cwd; #include #include #include +#include - #if HAVE_SYS_WAIT_H - # include -@@ -147,6 +148,8 @@ extern int errno; + #include "argp.h" + #include "dirname.h" +@@ -104,6 +105,8 @@ static char *cwd; #ifdef SECURE_MAN_UID extern uid_t ruid; extern uid_t euid; @@ -813,7 +722,7 @@ #endif /* SECURE_MAN_UID */ /* the default preprocessor sequence */ -@@ -177,6 +180,10 @@ const char *lang; +@@ -134,6 +137,10 @@ const char *lang; static int global_manpath = -1; /* global or user manual page hierarchy? */ static int skip; /* page exists but has been skipped */ @@ -824,18 +733,13 @@ #if defined _AIX || defined __sgi char **global_argv; -@@ -249,7 +256,7 @@ static char *tmp_cat_file; /* for open_c +@@ -224,12 +231,12 @@ static char *tmp_cat_file; /* for open_c static int tmp_cat_fd; static int created_tmp_cat; /* dto. */ static int man_modtime; /* modtime of man page, for commit_tmp_cat() */ -#endif +#endif /* MAN_CATS */ - static const struct option long_options[] = - { -@@ -295,9 +302,9 @@ static const struct option long_options[ - static const char args[] = "7DlM:P:S:adfhH::kVum:p:tT::wWe:L:Zcr:X::E:iIC:"; - # ifdef TROFF_IS_GROFF -static int ditroff; +static int ditroff = 0; @@ -845,7 +749,7 @@ static const char *html_pager; # endif /* TROFF_IS_GROFF */ -@@ -400,25 +407,6 @@ static void gripe_no_name (const char *s +@@ -537,25 +544,6 @@ static void gripe_no_name (const char *s exit (FAIL); } @@ -855,14 +759,14 @@ -static void set_term (void) -{ - if (tms_set) -- tcsetattr (fileno (stdin), TCSANOW, &tms); +- tcsetattr (STDIN_FILENO, TCSANOW, &tms); -} - -static void get_term (void) -{ -- if (isatty (fileno (stdout))) { +- if (isatty (STDOUT_FILENO)) { - debug ("is a tty\n"); -- tcgetattr (fileno (stdin), &tms); +- tcgetattr (STDIN_FILENO, &tms); - if (!tms_set++) - atexit (set_term); - } @@ -871,7 +775,7 @@ static int get_roff_line_length (void) { int line_length = get_line_length (); -@@ -503,11 +491,11 @@ static __inline__ char **manopt_to_env ( +@@ -640,11 +628,11 @@ static inline char **manopt_to_env (int { char *manopt, *opt_start, **argv; @@ -885,7 +789,7 @@ /* allocate space for the program name */ *argc = 0; -@@ -624,37 +612,52 @@ static int local_man_loop (const char *a +@@ -760,30 +748,43 @@ static int local_man_loop (const char *a display (NULL, "", NULL, "(stdin)", NULL); else { struct stat st; @@ -899,11 +803,11 @@ + if (strcmp(argv, file)) { + char *dlm; + pwd = strdupa(argv); -+ ++ + if ((dlm = strrchr(pwd, '/'))) + *dlm = '\0'; + } -+ ++ + if (pwd[0]) { + debug ("chdir %s\n", pwd); + if (chdir (pwd)) { @@ -934,31 +838,17 @@ return NOT_FOUND; } - if (exit_status == OK) { - char *argv_copy = xstrdup (argv); - lang = lang_dir (argv); -- if (!display (NULL, argv, NULL, basename (argv_copy), +@@ -801,6 +802,8 @@ static int local_man_loop (const char *a + argv_abs = xstrdup (argv); + } + lang = lang_dir (argv_abs); + if (!lang || !*lang) + lang = internal_locale; -+ if (!display (NULL, file, NULL, basename (argv_copy), - NULL)) { + free (argv_abs); + if (!display (NULL, argv, NULL, argv_base, NULL)) { if (local_mf) - error (0, errno, "%s", argv); -@@ -668,12 +671,6 @@ static int local_man_loop (const char *a - return exit_status; - } - --static void int_handler (int signo) --{ -- debug ("\ninterrupt signal %d handler\n", signo); -- exit (INTERRUPTED); --} -- - int main (int argc, char *argv[]) - { - int argc_env, exit_status = OK; -@@ -692,7 +689,16 @@ int main (int argc, char *argv[]) - bindtextdomain (PACKAGE, LOCALEDIR); +@@ -834,7 +837,16 @@ int main (int argc, char *argv[]) + bindtextdomain (PACKAGE "-gnulib", LOCALEDIR); textdomain (PACKAGE); - internal_locale = setlocale (LC_MESSAGES, NULL); @@ -975,16 +865,7 @@ /* Use LANGUAGE only when LC_MESSAGES locale category is * neither "C" nor "POSIX". */ if (internal_locale && strcmp (internal_locale, "C") && -@@ -745,8 +751,6 @@ int main (int argc, char *argv[]) - init_security (); - #endif /* SECURE_MAN_UID */ - -- signal (SIGINT, int_handler); -- - pipeline_install_sigchld (); - - read_config_file (); -@@ -755,9 +759,13 @@ int main (int argc, char *argv[]) +@@ -904,9 +916,13 @@ int main (int argc, char *argv[]) if (external) do_extern (argc, argv); @@ -998,8 +879,8 @@ + } #endif /* SECURE_MAN_UID */ - #ifdef HAVE_SETLOCALE -@@ -776,6 +784,7 @@ int main (int argc, char *argv[]) + /* close this locale and reinitialise if a new locale was +@@ -924,6 +940,7 @@ int main (int argc, char *argv[]) setenv ("LANGUAGE", internal_locale, 1); ++_nl_msg_cat_cntr; multiple_locale = NULL; @@ -1007,7 +888,7 @@ } } -@@ -838,6 +847,22 @@ int main (int argc, char *argv[]) +@@ -978,6 +995,22 @@ int main (int argc, char *argv[]) } if (manp == NULL) { @@ -1021,7 +902,7 @@ + * Use strsep () to not intermix with strtok () + */ + for (ptr = strsep (&tmp_locale, ":"); ptr; ptr = strsep (&tmp_locale, ":")) { -+ if (debug) ++ if (debug_level) + fprintf (stderr, "checking for locale %s\n", ptr); + manp = add_nls_manpath (manp, ptr); + } @@ -1030,7 +911,7 @@ char tmp_locale[3]; int idx; -@@ -859,6 +884,7 @@ int main (int argc, char *argv[]) +@@ -999,6 +1032,7 @@ int main (int argc, char *argv[]) debug ("checking for locale %s\n", tmp_locale); manp = add_nls_manpath (manp, tmp_locale); } @@ -1038,7 +919,7 @@ } else free (get_manpath (NULL)); -@@ -1177,7 +1203,7 @@ static __inline__ const char *is_section +@@ -1155,7 +1189,7 @@ static inline const char *is_section (co } /* Snarf pre-processors from file, return (static) string or NULL on failure */ @@ -1047,7 +928,7 @@ { static char *directive = NULL; -@@ -1196,7 +1222,8 @@ static const char *get_preprocessors_fro +@@ -1174,7 +1208,8 @@ static const char *get_preprocessors_fro if (!line) return NULL; @@ -1057,7 +938,7 @@ const char *newline = strchr (line, '\n'); if (newline) directive = xstrndup (line + 4, newline - (line + 4)); -@@ -1204,6 +1231,25 @@ static const char *get_preprocessors_fro +@@ -1182,6 +1217,25 @@ static const char *get_preprocessors_fro directive = xstrdup (line + 4); } @@ -1083,7 +964,7 @@ /* if we didn't find PP_COOKIE, then directive == NULL */ #endif return directive; -@@ -1212,7 +1258,7 @@ static const char *get_preprocessors_fro +@@ -1190,7 +1244,7 @@ static const char *get_preprocessors_fro /* Determine pre-processors, set save_cat and return (static) string */ @@ -1092,7 +973,7 @@ { const char *pp_string; const char *pp_source; -@@ -1226,7 +1272,7 @@ static const char *get_preprocessors (pi +@@ -1204,7 +1258,7 @@ static const char *get_preprocessors (pi } else if ((pp_string = preprocessors)) { pp_source = "command line"; save_cat = 0; @@ -1101,44 +982,49 @@ pp_source = "file"; save_cat = 1; } else if ((pp_string = getenv ("MANROFFSEQ"))) { -@@ -1251,6 +1297,7 @@ static pipeline *make_roff_command (cons - pipeline *decomp, const char *dbfilters) +@@ -1230,6 +1284,7 @@ static pipeline *make_roff_command (cons { const char *pp_string; -+ char *pp_encoding; + const char *roff_opt; ++ const char *pp_encoding; char *fmt_prog; pipeline *p = pipeline_new (); command *cmd; -@@ -1259,13 +1306,13 @@ static pipeline *make_roff_command (cons +@@ -1239,8 +1294,8 @@ static pipeline *make_roff_command (cons + #ifndef ALT_EXT_FORMAT dir = dir; /* not used unless looking for formatters in catdir */ #endif - +- - pp_string = get_preprocessors (decomp, dbfilters); + pp_encoding = (char*)0; + pp_string = get_preprocessors (decomp, dbfilters, pp_encoding); + roff_opt = getenv ("MANROFFOPT"); + if (!roff_opt) +@@ -1249,8 +1304,7 @@ static pipeline *make_roff_command (cons #ifdef ALT_EXT_FORMAT /* Check both external formatter locations */ - if (dir) { + if (dir && !recode) { - char *catpath = get_catpath - (dir, global_manpath ? SYSTEM_CAT : USER_CAT); + char *catpath = get_catpath (dir, global_manpath ? SYSTEM_CATP : USER_CATP); /* If we have an alternate catpath */ if (catpath) { -@@ -1318,7 +1365,10 @@ static pipeline *make_roff_command (cons - - #define STRC(s, otherwise) ((s) ? (s) : (otherwise)) - -- page_encoding = get_page_encoding (lang); -+ if (pp_encoding) -+ page_encoding = pp_encoding; -+ else -+ page_encoding = get_page_encoding (lang); - source_encoding = get_source_encoding (lang); - debug ("page_encoding = %s\n", page_encoding); - debug ("source_encoding = %s\n", source_encoding); -@@ -1632,6 +1682,18 @@ static void setenv_less (const char *tit +@@ -1295,8 +1349,10 @@ static pipeline *make_roff_command (cons + if (!recode) + pipeline_command_argstr (p, get_def ("soelim", + SOELIM)); +- +- page_encoding = get_page_encoding (lang); ++ if (pp_encoding) ++ page_encoding = pp_encoding; ++ else ++ page_encoding = get_page_encoding (lang); + source_encoding = get_source_encoding (lang); + debug ("page_encoding = %s\n", page_encoding); + debug ("source_encoding = %s\n", source_encoding); +@@ -1637,6 +1693,18 @@ static void setenv_less (const char *tit free (less_opts); } @@ -1157,7 +1043,7 @@ /* Return pipeline to display file. NULL means stdin. * * TODO: htmlout case is pretty weird now. I'd like the intelligence to be -@@ -1644,6 +1706,9 @@ static pipeline *make_display_command (c +@@ -1649,6 +1717,9 @@ static pipeline *make_display_command (c setenv_less (title); @@ -1167,7 +1053,7 @@ if (file) { if (ascii) { p = pipeline_new (); -@@ -1686,7 +1751,7 @@ static pipeline *make_display_command (c +@@ -1691,7 +1762,7 @@ static pipeline *make_display_command (c return p; } @@ -1176,7 +1062,7 @@ /* return a (malloced) temporary name in cat_file's directory */ static char *tmp_cat_filename (const char *cat_file) { -@@ -1789,8 +1854,6 @@ static int commit_tmp_cat (const char *c +@@ -1794,8 +1865,6 @@ static int commit_tmp_cat (const char *c return status; } @@ -1185,7 +1071,7 @@ /* Return pipeline to write formatted manual page to for saving as cat file. */ static pipeline *open_cat_stream (const char *cat_file) { -@@ -1864,6 +1927,7 @@ static int close_cat_stream (pipeline *c +@@ -1869,6 +1938,7 @@ static int close_cat_stream (pipeline *c free (tmp_cat_file); return status; } @@ -1193,7 +1079,7 @@ /* TODO: This should all be refactored after work on the decompression * library is complete. -@@ -1876,6 +1940,7 @@ void discard_stderr (pipeline *p) +@@ -1881,6 +1951,7 @@ void discard_stderr (pipeline *p) p->commands[i]->discard_err = 1; } @@ -1201,7 +1087,7 @@ /* * format a manual page with format_cmd, display it with disp_cmd, and * save it to cat_file -@@ -2037,6 +2102,7 @@ static void format_display (pipeline *de +@@ -2042,6 +2113,7 @@ static void format_display (pipeline *de regain_effective_privs (); } @@ -1209,7 +1095,7 @@ /* "Display" a page in catman mode, which amounts to saving it. */ /* TODO: merge with format_display_and_save? */ static void display_catman (const char *cat_file, pipeline *decomp, -@@ -2074,6 +2140,7 @@ static void display_catman (const char * +@@ -2080,6 +2152,7 @@ static void display_catman (const char * pop_cleanup(); free (tmpcat); } @@ -1217,7 +1103,7 @@ /* * optionally chdir to dir, if necessary update cat_file from man_file -@@ -2096,10 +2163,18 @@ static int display (const char *dir, con +@@ -2102,10 +2175,18 @@ static int display (const char *dir, con if (dir) { debug ("chdir %s\n", dir); @@ -1236,7 +1122,7 @@ } /* define format_cmd */ -@@ -2112,11 +2187,10 @@ static int display (const char *dir, con +@@ -2118,11 +2199,10 @@ static int display (const char *dir, con if (decomp) { pipeline_start (decomp); @@ -1250,7 +1136,7 @@ /* Get modification time, for commit_tmp_cat(). */ if (man_file && *man_file) { struct stat stb; -@@ -2125,7 +2199,7 @@ static int display (const char *dir, con +@@ -2131,7 +2211,7 @@ static int display (const char *dir, con else man_modtime = stb.st_mtime; } @@ -1259,15 +1145,15 @@ display_to_stdout = troff; #ifdef TROFF_IS_GROFF if (htmlout) -@@ -2236,6 +2310,7 @@ static int display (const char *dir, con - printf ("%s", cat_file); +@@ -2248,6 +2328,7 @@ static int display (const char *dir, con } - putchar ('\n'); + if (printed) + putchar ('\n'); +#ifdef MAN_CATS } else if (catman) { if (format) { if (!save_cat) -@@ -2247,6 +2322,7 @@ static int display (const char *dir, con +@@ -2259,6 +2340,7 @@ static int display (const char *dir, con display_catman (cat_file, decomp, format_cmd); } @@ -1275,7 +1161,7 @@ } else if (format) { /* no cat or out of date */ pipeline *disp_cmd; -@@ -2296,8 +2372,10 @@ static int display (const char *dir, con +@@ -2309,8 +2391,10 @@ static int display (const char *dir, con } } @@ -1288,7 +1174,7 @@ if (!prompt) prompt = found; -@@ -2338,8 +2416,7 @@ static char *find_cat_file (const char * +@@ -2351,8 +2435,7 @@ static char *find_cat_file (const char * */ if (!STREQ (man_file, original)) { global_manpath = is_global_mandir (man_file); @@ -1298,7 +1184,7 @@ if (cat_path) { cat_file = convert_name (cat_path, 0); -@@ -2366,8 +2443,7 @@ static char *find_cat_file (const char * +@@ -2379,8 +2462,7 @@ static char *find_cat_file (const char * } global_manpath = is_global_mandir (original); @@ -1308,7 +1194,7 @@ if (cat_path) { cat_file = convert_name (cat_path, 0); -@@ -2860,9 +2936,7 @@ static int display_database (struct cand +@@ -2869,9 +2951,7 @@ static int display_database (struct cand if (access (file, R_OK) != 0) { char *catpath; @@ -1319,7 +1205,7 @@ if (catpath && strcmp (catpath, candp->path) != 0) { file = make_filename (catpath, name, -@@ -2899,7 +2973,7 @@ static int display_database_check (struc +@@ -2908,7 +2988,7 @@ static int display_database_check (struc #ifdef MAN_DB_UPDATES if (!exists && !skip) { debug ("dbdelete_wrapper (%s, %p)\n", @@ -1328,7 +1214,7 @@ dbdelete_wrapper (candp->req_name, candp->source); } #endif /* MAN_DB_UPDATES */ -@@ -2977,7 +3051,7 @@ static int try_db (const char *manpath, +@@ -2986,7 +3066,7 @@ static int try_db (const char *manpath, /* find out where our db for this manpath should be */ @@ -1337,8 +1223,23 @@ if (catpath) { database = mkdbname (catpath); free (catpath); +--- src/man.h ++++ src/man.h 2008-04-21 15:19:42.495024000 +0200 +@@ -22,10 +22,10 @@ + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +-static inline const char *is_section (const char *name); ++static const char *is_section (const char *name); + static const char **get_section_list (void); + static int man (const char *name, int *found); + static int display (const char *dir, const char *man_file, + const char *cat_file, const char *title, + const char *dbfilters); +-static inline int do_prompt (const char *name); ++static int do_prompt (const char *name); --- src/man_db.conf.in -+++ src/man_db.conf.in 2007-12-11 13:27:28.109209000 +0100 ++++ src/man_db.conf.in 2007-12-11 13:27:28.000000000 +0100 @@ -20,6 +20,15 @@ MANDATORY_MANPATH /usr/man MANDATORY_MANPATH /usr/share/man @@ -1516,18 +1417,9 @@ #DEFINE eqn @eqn@ #DEFINE neqn @neqn@ #DEFINE tbl @tbl@ -@@ -107,7 +239,7 @@ MANDB_MAP /opt/man /var/cache/man/opt - # is that you only need to explicitly list extensions if you want to force a - # particular order. Sections with extensions should usually be adjacent to - # their main section (e.g. "1 1mh 8 ..."). --SECTION 1 n l 8 3 2 3posix 3pm 3perl 5 4 9 6 7 -+SECTION 0 1 n l 8 3 2 5 4 9 6 7 1x 3x 4x 5x 6x 8x 1bind 3bind 5bind 7bind 8bind 1cn 8cn 1m 1mh 5mh 8mh 1netpbm 3netpbm 5netpbm 0p 1p 3p 1pgsql 3C++ 3blt 3blt 3curses 3ncurses 3form 3menu 3db 3gdbm 3f 3gk 3mm 3paper 3perl 3pgsql 3pm 3posix 3pq 3qt 3pub 3readline 1ssl 3ssl 5ssl 7ssl 3t 3tk 3tcl 3tclx 3tix 5mm 5pgsql 7l 7nr 8C++ 8c Cg g s m - #--------------------------------------------------------- - # Flags. - # NOCACHE keeps man from creating cat pages. --- src/mandb.c -+++ src/mandb.c 2008-01-30 12:01:40.242753000 +0100 -@@ -143,6 +143,8 @@ static const char *xtmpfile; ++++ src/mandb.c 2008-01-30 12:01:40.000000000 +0100 +@@ -185,6 +185,8 @@ static const char *xtmpfile; #ifdef SECURE_MAN_UID extern uid_t ruid; extern uid_t euid; @@ -1536,7 +1428,7 @@ #endif /* SECURE_MAN_UID */ static char *manpathlist[MAXDIRS]; -@@ -463,10 +465,13 @@ static short process_manpath (const char +@@ -484,10 +486,13 @@ static short process_manpath (const char short amount = 0; if (global_manpath) { /* system db */ @@ -1553,7 +1445,7 @@ if (!catpath) catpath = xstrdup (manpath); } -@@ -497,7 +502,7 @@ static short process_manpath (const char +@@ -518,7 +523,7 @@ static short process_manpath (const char if (!opt_test && amount) { finish_up (); #ifdef SECURE_MAN_UID @@ -1562,7 +1454,7 @@ do_chown (man_owner->pw_uid); #endif /* SECURE_MAN_UID */ } -@@ -610,8 +615,14 @@ int main (int argc, char *argv[]) +@@ -586,8 +591,14 @@ int main (int argc, char *argv[]) error (FAIL, 0, _("the setuid man user \"%s\" does not exist"), MAN_OWNER); @@ -1580,16 +1472,8 @@ --- src/manp.c -+++ src/manp.c 2008-01-30 12:01:02.982017000 +0100 -@@ -63,6 +63,7 @@ - # include - #else /* no string(s) header */ - extern char *strtok(); -+extern char *strsep(); - extern char *strchr(); - extern char *strstr(); - #endif -@@ -86,6 +87,7 @@ extern int errno; ++++ src/manp.c 2008-01-30 12:01:03.000000000 +0100 +@@ -70,6 +70,7 @@ #include "security.h" #include "encodings.h" #include "manp.h" @@ -1597,7 +1481,7 @@ struct list { char *key; -@@ -694,6 +696,8 @@ char *get_manpath (const char *systems) +@@ -673,6 +674,8 @@ char *get_manpath (const char *systems) #ifdef SECURE_MAN_UID extern uid_t ruid; /* initial real user id */ extern uid_t euid; /* initial effective user id */ @@ -1606,7 +1490,7 @@ #endif /* SECURE_MAN_UID */ /* create the catman hierarchy if it doesn't exist */ -@@ -722,6 +726,8 @@ mkcatdirs (const char *mandir, const cha +@@ -701,6 +704,8 @@ mkcatdirs (const char *mandir, const cha #ifdef SECURE_MAN_UID if (ruid == 0) chown (catdir, man_owner->pw_uid, 0); @@ -1615,7 +1499,7 @@ #endif /* SECURE_MAN_UID */ drop_effective_privs (); } -@@ -732,9 +738,14 @@ mkcatdirs (const char *mandir, const cha +@@ -711,9 +716,14 @@ mkcatdirs (const char *mandir, const cha int j; regain_effective_privs (); debug ("creating catdir hierarchy %s ", catdir); @@ -1633,7 +1517,7 @@ if ((is_directory (manname) == 1) && (is_directory (catname) != 1)) { if (mkdir (catname, -@@ -743,11 +754,12 @@ mkcatdirs (const char *mandir, const cha +@@ -722,11 +732,12 @@ mkcatdirs (const char *mandir, const cha error (0, 0, _("warning: cannot create catdir %s"), catname); debug ("warning: cannot create catdir %s\n", catname); } else @@ -1649,7 +1533,7 @@ #endif /* SECURE_MAN_UID */ } } -@@ -886,7 +898,7 @@ static char *def_path (int flag) +@@ -865,7 +876,7 @@ static char *def_path (int flag) /* If we have complete config file failure... */ if (!manpath) @@ -1658,7 +1542,7 @@ return manpath; } -@@ -1155,8 +1167,8 @@ char *get_catpath (const char *name, int +@@ -1134,8 +1145,8 @@ char *get_catpath (const char *name, int struct list *list; for (list = namestore; list; list = list->next) @@ -1669,21 +1553,21 @@ size_t manlen = strlen (list->key); if (STRNEQ (name, list->key, manlen)) { const char *suffix = name + manlen; -@@ -1164,16 +1176,30 @@ char *get_catpath (const char *name, int +@@ -1143,16 +1154,30 @@ char *get_catpath (const char *name, int if (*suffix == '/') { ++suffix; -- catpath = strappend (catpath, "/", +- catpath = appendstr (catpath, "/", - NULL); -+ catpath = strappend (catpath, "/", NULL); ++ catpath = appendstr (catpath, "/", NULL); } if (STRNEQ (suffix, "man", 3)) { suffix += 3; -- catpath = strappend (catpath, "cat", +- catpath = appendstr (catpath, "cat", - NULL); -+ catpath = strappend (catpath, "cat", NULL); ++ catpath = appendstr (catpath, "cat", NULL); } - catpath = strappend (catpath, suffix, NULL); + catpath = appendstr (catpath, suffix, NULL); - return catpath; + if (cattype & FILE_CATP) + return catpath; @@ -1706,8 +1590,8 @@ } --- src/security.c -+++ src/security.c 2007-12-10 14:24:24.347643000 +0100 -@@ -87,10 +87,13 @@ extern int errno; ++++ src/security.c 2007-12-10 14:24:24.000000000 +0100 +@@ -76,10 +76,13 @@ # ifdef POSIX_SAVED_IDS # if defined (HAVE_SETEUID) # define SET_EUID(euid) seteuid(euid) @@ -1721,7 +1605,7 @@ # endif /* HAVE_SETEUID */ /* Sort out the function to use to swap ruid with euid. Used if no suid. */ -@@ -98,8 +101,10 @@ extern int errno; +@@ -87,8 +90,10 @@ # else /* !POSIX_SAVED_IDS */ # if defined (HAVE_SETREUID) # define SWAP_UIDS(ida, idb) setreuid(idb, ida) @@ -1732,7 +1616,7 @@ # warning Using setresuid() whithout _POSIX_SAVED_IDS! # endif /* HAVE_SETREUID */ # endif /* POSIX_SAVED_IDS */ -@@ -111,7 +116,10 @@ extern int errno; +@@ -100,7 +105,10 @@ uid_t ruid; /* initial real user id */ uid_t euid; /* initial effective user id */ @@ -1743,7 +1627,7 @@ static struct passwd *man_owner; -@@ -125,10 +133,17 @@ static __inline__ void gripe_set_euid (v +@@ -114,10 +122,17 @@ static inline void gripe_set_euid (void) error (FATAL, errno, _("can't set effective uid")); } @@ -1761,7 +1645,7 @@ debug ("ruid=%d, euid=%d\n", (int) ruid, (int) euid); priv_drop_count = 0; drop_effective_privs (); -@@ -202,6 +217,28 @@ void regain_effective_privs (void) +@@ -191,6 +206,28 @@ void regain_effective_privs (void) uid = euid; } @@ -1790,42 +1674,30 @@ #endif /* SECURE_MAN_UID */ } ---- src/straycats.c -+++ src/straycats.c 2008-01-30 11:57:57.562451000 +0100 -@@ -48,6 +48,7 @@ extern char *strrchr(); +--- src/security.h ++++ src/security.h 2008-04-21 15:19:18.783982000 +0200 +@@ -25,8 +25,8 @@ + #include + /* security.c */ +-extern inline void drop_effective_privs (void); +-extern inline void regain_effective_privs (void); ++extern void drop_effective_privs (void); ++extern void regain_effective_privs (void); + extern int do_system_drop_privs (struct pipeline *p); + extern int remove_with_dropped_privs (const char *filename); + extern void init_security (void); +--- src/straycats.c ++++ src/straycats.c 2008-04-21 15:47:04.158440000 +0200 +@@ -35,6 +35,7 @@ #include #include + #include +#include - #if defined(HAVE_UNISTD_H) - # include -@@ -102,12 +103,6 @@ static int check_for_stray (void) - struct dirent *catlist; - size_t lenman, lencat; - int strays = 0; --#ifdef HAVE_CANONICALIZE_FILE_NAME -- /* no PATH_MAX then */ -- char *fullpath; --#else -- char fullpath[PATH_MAX]; --#endif - - cdir = opendir (catdir); - if (!cdir) { -@@ -197,6 +192,11 @@ static int check_for_stray (void) - found = 0; - - if (!found) { -+#ifdef HAVE_CANONICALIZE_FILE_NAME -+ char *fullpath; /* no PATH_MAX then */ -+#else -+ char fullpath[PATH_MAX]; -+#endif - pipeline *decomp; - struct mandata *exists; - lexgrog lg; -@@ -312,13 +312,17 @@ static int check_for_stray (void) + #ifdef HAVE_DIRENT_H + # include +@@ -268,13 +269,17 @@ static int check_for_stray (void) if (lg.whatis) free (lg.whatis); @@ -1834,11 +1706,11 @@ + pipeline_free (decomp); next_exists: - free_mandata_struct (exists); -- free (mandir_copy); +- free (mandir_base); + if (exists) + free_mandata_struct (exists); -+ if (mandir_copy) -+ free (mandir_copy); ++ if (mandir_base) ++ free (mandir_base); } next_section: - free (section); @@ -1847,7 +1719,7 @@ } closedir (cdir); return strays; -@@ -382,7 +386,7 @@ int straycats (const char *manpath) +@@ -338,7 +343,7 @@ int straycats (const char *manpath) return 0; } @@ -1857,8 +1729,8 @@ /* look in the usual catpath location */ mandir = xstrdup (manpath); --- src/ult_src.c -+++ src/ult_src.c 2007-12-10 14:34:00.376977000 +0100 -@@ -328,12 +328,17 @@ const char *ult_src (const char *name, c ++++ src/ult_src.c 2007-12-10 14:34:00.000000000 +0100 +@@ -289,12 +289,17 @@ const char *ult_src (const char *name, c } pipeline_start (decomp); @@ -1880,7 +1752,7 @@ if (include) { const char *ult; --- src/ult_src.h -+++ src/ult_src.h 2007-12-10 13:24:29.922796000 +0100 ++++ src/ult_src.h 2007-12-10 13:24:30.000000000 +0100 @@ -21,9 +21,10 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -1896,20 +1768,20 @@ extern const char *ult_src (const char *name, const char *path, struct stat *buf, int flags); --- src/util.c -+++ src/util.c 2007-12-10 13:24:29.958801000 +0100 -@@ -58,6 +58,9 @@ extern char *strcpy(); - # include - #endif /* HAVE_UNISTD_H */ ++++ src/util.c 2007-12-10 13:24:30.000000000 +0100 +@@ -43,6 +43,9 @@ + #include + #include +#include +#define _(String) gettext (String) + #include "manconfig.h" - #include "libdb/mydbm.h" /* for full definition of MAN_DB */ - #include "lib/pipeline.h" + + #include "pipeline.h" --- src/whatis.c -+++ src/whatis.c 2008-01-30 12:01:59.721229000 +0100 -@@ -687,7 +687,7 @@ static int search (char *page) ++++ src/whatis.c 2008-04-21 13:21:57.483571000 +0200 +@@ -651,7 +651,7 @@ static int search (char *page) debug ("lower(%s) = \"%s\"\n", page, lowpage); for (mp = manpathlist; *mp; mp++) { @@ -1919,8 +1791,8 @@ if (catpath) { database = mkdbname (catpath); --- src/wrapper.c -+++ src/wrapper.c 2008-01-07 13:06:01.941835000 +0100 -@@ -25,6 +25,7 @@ ++++ src/wrapper.c 2008-01-07 13:06:02.000000000 +0100 +@@ -29,6 +29,7 @@ #include #include #include @@ -1952,8 +1824,8 @@ struct passwd *pwd; argc = argc; /* not used */ -@@ -83,57 +85,56 @@ int main (int argc, char **argv) - program_name = xstrdup (basename (argv[0])); +@@ -84,57 +86,56 @@ int main (int argc, char **argv) + program_name = base_name (argv[0]); ruid = getuid (); - fakeroot = getenv ("FAKEROOTKEY"); diff --git a/man-db-2.5.1.tar.bz2 b/man-db-2.5.1.tar.bz2 new file mode 100644 index 0000000..fada10d --- /dev/null +++ b/man-db-2.5.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60794461043462dc1d56fe3e2b1918d837cdc348f7242594df953e3589f994ec +size 1234479 diff --git a/man-db_2.5.0-4.diff.bz2 b/man-db_2.5.0-4.diff.bz2 deleted file mode 100644 index 065f162..0000000 --- a/man-db_2.5.0-4.diff.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7eb73655f06e81b910fad7a7c93b0b1ddd84fde0fec3a72c684f9e43bc7e0d9f -size 1230 diff --git a/man-db_2.5.1-3.diff.bz2 b/man-db_2.5.1-3.diff.bz2 new file mode 100644 index 0000000..9f8ff51 --- /dev/null +++ b/man-db_2.5.1-3.diff.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eec1315474df7515ee2bb21fcc5533a6977de685e6128a55548d2692cf34c319 +size 371 diff --git a/man.changes b/man.changes index 8432ca9..70eec51 100644 --- a/man.changes +++ b/man.changes @@ -1,3 +1,53 @@ +------------------------------------------------------------------- +Tue Apr 22 15:45:22 CEST 2008 - werner@suse.de + +- Make libzio interface smarter, that is if used only for simple + decompression do not use a pipe (saves 30% mandb run time) + (bnc#381830) +- Make cron.daily.do_mandb smarter, that is check if anything + has changes in the global manual paths that needs to run mandb + (bnc#381830) +- Update to bug fix version 2.5.1 + * The manual is now built automatically, avoiding some ordering + problems on 'make distclean'. + * Manual pages are converted to the proper input encoding for troff + output as well as nroff output. + * The -t, -T, -X, and -Z options to man work again; in 2.5.0, they + read input from stdin rather than from the manual page. + * apropos and whatis no longer segfault when given an explicit + locale using -L. + * man now understands that groff's ascii device takes ASCII input, + not ISO-8859-1. + * man no longer discards stderr when writing to a file or a pipe; + this was broken by an overenthusiastic change in 2.5.0. + * manconv now falls back to the next encoding in its list if any + characters in an entire 64KB block fail to decode using the + current encoding, as was originally intended. + * manconv is more careful about extracting coding: directives from + manual pages. + * Ctrl-C and Ctrl-\ now work again at the prompt issued by 'man -a'. + * There is a new --with-sections configure option to change the + default value of SECTION in the configuration file. + * Automake is now used to generate Makefiles. Among other things, + this fixes VPATH builds and some bugs in dependency generation, + and should allow building with non-GNU versions of make. + * man-db now uses the Gnulib portability library, allowing the + removal of earlier haphazard portability code. While this results + in a somewhat larger source distribution, it makes man-db easier + to maintain and should make it easier to build on systems to which + the maintainer does not have access. + * In the process of switching to Gnulib, the last vestiges of + pre-C89 support have been removed; they were documented to be + broken anyway. + * If the MANROFFOPT environment variable is set, man now appends its + value to the *roff command line. + * man now accepts a --recode option to output a source manual page + converted to a specified encoding. + * For compatibility with System V, man accepts -s as an alias for + -S, and permits sections to be comma-separated as well as + colon-separated. + * man now accepts a --warnings option to enable groff warnings. + ------------------------------------------------------------------- Tue Feb 26 13:10:39 CET 2008 - werner@suse.de diff --git a/man.spec b/man.spec index f8e340d..769a864 100644 --- a/man.spec +++ b/man.spec @@ -1,5 +1,5 @@ # -# spec file for package man (Version 2.5.0) +# spec file for package man (Version 2.5.1) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -23,12 +23,13 @@ BuildRequires: gettext-runtime gettext-tools %else BuildRequires: gettext gettext-devel %endif -Version: 2.5.0 -Release: 22 +Version: 2.5.1 +Release: 1 Summary: A Program for Displaying man Pages License: GPL v2 or later +Url: https://savannah.nongnu.org/projects/man-db Group: System/Base -PreReq: fileutils fillup +PreReq: coreutils fillup Provides: man_db Requires: groff >= 1.18 less AutoReqProv: on @@ -38,14 +39,13 @@ Source2: cron.daily.do_mandb Source3: cron.daily.clean_catman Source4: mancoding Patch0: man-db-%{version}.dif -Patch1: man-db_%{version}-4.diff.bz2 +Patch1: man-db_%{version}-3.diff.bz2 Patch2: man-db-2.3.19deb4.0-groff.dif -Patch3: man-db-%{version}-error.dif Patch4: man-db-2.4.3-section.dif Patch5: man-db-%{version}-security4.dif Patch6: man-db-2.4.3-firefox.dif Patch7: man-db-%{version}-chinese.dif -Patch8: man-db-2.4.3-globbing.dif +Patch8: man-db-%{version}-globbing.dif Patch9: man-db-%{version}-zio.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc @@ -59,12 +59,13 @@ printer (using groff). Authors: -------- G. Wilford + Fabrizio Polacco + Colin Watson %prep %setup -n man-db-%{version} %patch1 -p1 -b .debian %patch2 -p0 -b .groff -%patch3 -p0 -b .err %patch4 -p0 -b .sect %patch5 -p0 -b .secu4 %patch6 -p0 -b .firefox @@ -75,20 +76,26 @@ Authors: %build %{?suse_update_config:%{suse_update_config -f tools }} +%if %suse_version > 1030 gettextize --force --copy --no-changelog - rm -f configure GNUmakefile +%endif + rm -f configure CFLAGS="${RPM_OPT_FLAGS} -funroll-loops -pipe -D_GNU_SOURCE -D_SVID_SOURCE -Wall" LDFLAGS= LIBS= export CFLAGS LDFLAGS LIBS %if %suse_version > 1030 - if test -s /usr/share/aclocal/gettext.m4 ; then - cp -vp /usr/share/aclocal/gettext.m4 m4/ - fi - aclocal -I ${PWD}/m4 - autoconf -B ${PWD}/m4 + aclocal -I ${PWD}/m4 -I ${PWD}/gnulib/m4 + autoconf -B ${PWD}/m4 -B ${PWD}/gnulib/m4 %else - autoconf + sed -ri 's/(m4_PACKAGE_VERSION,[[:blank:]]*\[)2.61(\])/\12.60\2/' aclocal.m4 + sed -ri 's/(AM_INIT_AUTOMAKE\(\[)1.10/\11.9.6/' configure.ac + sed -ri 's/intl//' Makefile.am + aclocal -I ${PWD}/m4 -I ${PWD}/gnulib/m4 + autoconf -B ${PWD}/m4 -B ${PWD}/gnulib/m4 + mkdir -p tools + touch tools/compile + export MKDIR_P="mkdir -p" %endif ./configure \ --enable-dups \ @@ -97,6 +104,7 @@ Authors: --prefix=%{_prefix} \ --mandir=%{_mandir} \ --localstatedir=%{_localstatedir} \ + --libexecdir=%{_prefix}/lib \ --with-zio \ --with-gnu-ld \ --disable-rpath \ @@ -104,12 +112,29 @@ Authors: --with-db=gdbm \ --enable-nls \ --with-config-file=%{_sysconfdir}/manpath.config \ - --without-included-gettext -%if %suse_version > 1030 - sed -ri 's/@GETTEXT_MACRO_VERSION@/0.17/' po/Makefile -%endif + --without-included-gettext \ + --with-sections="0 1 n l 8 3 2 5 4 9 6 7 \ + 1x 3x 4x 5x 6x 8x \ + 1bind 3bind 5bind 7bind 8bind \ + 1cn 8cn \ + 1m 1mh 5mh 8mh \ + 1netpbm 3netpbm 5netpbm \ + 0p 1p 3p 3posix \ + 1pgsql 3pgsql 5pgsql\ + 3C++ 8C++ \ + 3blt \ + 3curses 3ncurses 3form 3menu \ + 3db 3gdbm 3f 3gk 3paper \ + 3mm 5mm \ + 3perl 3pm 3pq \ + 3qt 3pub 3readline \ + 1ssl 3ssl 5ssl 7ssl \ + 3t 3tk 3tcl 3tclx 3tix \ + 7l 7nr \ + 8c \ + Cg g s m" make nls=all - for man in $(find man/*.UTF-8 -type f); do + for man in $(find man/ -type f -a -name '*.man[0-9]'); do pp="$(head -n 1 $man)" case "$pp" in \'\\\"*\ -\*-\ coding:\ *\ -\*-) @@ -126,6 +151,9 @@ Authors: done %install +%if %suse_version <= 1030 + export MKDIR_P="mkdir -p" +%endif rm -rf %{buildroot}%{_localstatedir}/cache/man mkdir -p %{buildroot}%{_prefix}/lib/man-db mkdir -p %{buildroot}%{_bindir} @@ -157,7 +185,7 @@ Authors: install -m 0644 %{SOURCE1} %{buildroot}%{_localstatedir}/adm/fillup-templates install -m 0744 %{SOURCE2} %{buildroot}/etc/cron.daily/suse-do_mandb install -m 0744 %{SOURCE3} %{buildroot}/etc/cron.daily/suse-clean_catman -%find_lang man-db +%find_lang man-db --all-name %pre test -d var/catman/ && rm -rf var/catman/ || true @@ -188,11 +216,13 @@ test -d var/catman/ && rm -rf var/catman/ || true %attr(0755,root,root) %{_prefix}/lib/man-db/man %attr(0755,root,root) %{_prefix}/lib/man-db/mandb %attr(0755,man,man) %{_prefix}/lib/man-db/manconv +%attr(0755,man,man) %{_prefix}/lib/man-db/globbing %else %dir %attr(0711,root,root) %{_prefix}/lib/man-db %attr(0711,root,root) %{_prefix}/lib/man-db/man %attr(0711,root,root) %{_prefix}/lib/man-db/mandb %attr(0711,man,man) %{_prefix}/lib/man-db/manconv +%attr(0711,man,man) %{_prefix}/lib/man-db/globbing %endif %{_sbindir}/accessdb %{_datadir}/groff/site-tmac/tmac.andb @@ -240,6 +270,53 @@ test -d var/catman/ && rm -rf var/catman/ || true %{_localstatedir}/adm/fillup-templates/sysconfig.cron-man %changelog +* Tue Apr 22 2008 werner@suse.de +- Make libzio interface smarter, that is if used only for simple + decompression do not use a pipe (saves 30%% mandb run time) + (bnc#381830) +- Make cron.daily.do_mandb smarter, that is check if anything + has changes in the global manual paths that needs to run mandb + (bnc#381830) +- Update to bug fix version 2.5.1 + * The manual is now built automatically, avoiding some ordering + problems on 'make distclean'. + * Manual pages are converted to the proper input encoding for troff + output as well as nroff output. + * The -t, -T, -X, and -Z options to man work again; in 2.5.0, they + read input from stdin rather than from the manual page. + * apropos and whatis no longer segfault when given an explicit + locale using -L. + * man now understands that groff's ascii device takes ASCII input, + not ISO-8859-1. + * man no longer discards stderr when writing to a file or a pipe; + this was broken by an overenthusiastic change in 2.5.0. + * manconv now falls back to the next encoding in its list if any + characters in an entire 64KB block fail to decode using the + current encoding, as was originally intended. + * manconv is more careful about extracting coding: directives from + manual pages. + * Ctrl-C and Ctrl-\ now work again at the prompt issued by 'man -a'. + * There is a new --with-sections configure option to change the + default value of SECTION in the configuration file. + * Automake is now used to generate Makefiles. Among other things, + this fixes VPATH builds and some bugs in dependency generation, + and should allow building with non-GNU versions of make. + * man-db now uses the Gnulib portability library, allowing the + removal of earlier haphazard portability code. While this results + in a somewhat larger source distribution, it makes man-db easier + to maintain and should make it easier to build on systems to which + the maintainer does not have access. + * In the process of switching to Gnulib, the last vestiges of + pre-C89 support have been removed; they were documented to be + broken anyway. + * If the MANROFFOPT environment variable is set, man now appends its + value to the *roff command line. + * man now accepts a --recode option to output a source manual page + converted to a specified encoding. + * For compatibility with System V, man accepts -s as an alias for + -S, and permits sections to be comma-separated as well as + colon-separated. + * man now accepts a --warnings option to enable groff warnings. * Tue Feb 26 2008 werner@suse.de - Ensure to find local manual pages even in sub directories * Wed Jan 30 2008 werner@suse.de @@ -451,7 +528,7 @@ test -d var/catman/ && rm -rf var/catman/ || true - Port libz patch to this version - Map UTF-8 man pages to appropiate groff command - Make it work -* Sun Jun 17 2001 bk@suse.de +* Mon Jun 18 2001 bk@suse.de - new location of tmac files is /usr/share/groff/site-tmac, needed for groff 1.17 and does not work with older versions * Thu Jun 07 2001 werner@suse.de @@ -508,10 +585,10 @@ test -d var/catman/ && rm -rf var/catman/ || true - Make mandir depending on the RPM macro %%_mandir - Make zsoemlin zlib interface functions more compatible to cookie I/O functions (type changed in new glibc 2.1 and higher) -* Thu Mar 16 2000 werner@suse.de +* Fri Mar 17 2000 werner@suse.de - Make lexgrog knowing the japanese multibyte string of section NAME - Make flex use memory aligned tables. -* Wed Mar 08 2000 werner@suse.de +* Thu Mar 09 2000 werner@suse.de - Security fix in straycats: Check if we got a temporary file! * Thu Mar 02 2000 ro@suse.de - added usr/share/man/allman