SHA256
1
0
forked from pool/man
OBS User unknown 2008-04-22 23:42:57 +00:00 committed by Git OBS Bridge
parent 133dedf978
commit ba881e29ac
14 changed files with 887 additions and 765 deletions

View File

@ -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 <feedback@suse.de>, 1996
# Author: Werner Fink <feedback@suse.de>, 2008
# Burchard Steinbild <feedback@suse.de>, 1996
# Florian La Roche <feedback@suse.de>, 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

View File

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

View File

@ -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 <limits.h> 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")) {

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e6dbb18464fe31cd52fb6287b63829e556a77746b81899c743c327b15ad9e434
size 746743

View File

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

View File

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

View File

@ -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 <errno.h>
#include <sys/types.h>
#include <sys/stat.h> /* for chmod() */
+#include <fcntl.h> /* for open () */
#include <dirent.h>
#include <unistd.h>
#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 */

300
man-db-2.5.1-zio.dif Normal file
View File

@ -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 <limits.h> 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

File diff suppressed because it is too large Load Diff

3
man-db-2.5.1.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:60794461043462dc1d56fe3e2b1918d837cdc348f7242594df953e3589f994ec
size 1234479

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7eb73655f06e81b910fad7a7c93b0b1ddd84fde0fec3a72c684f9e43bc7e0d9f
size 1230

3
man-db_2.5.1-3.diff.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eec1315474df7515ee2bb21fcc5533a6977de685e6128a55548d2692cf34c319
size 371

View File

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

125
man.spec
View File

@ -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 <G.Wilford@ee.surrey.ac.uk>
Fabrizio Polacco <fpolacco@debian.org>
Colin Watson <cjwatson@debian.org>
%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