OBS User unknown 2008-04-23 23:43:14 +00:00 committed by Git OBS Bridge
parent ba881e29ac
commit b56f7565c4
4 changed files with 39 additions and 22 deletions

View File

@ -41,29 +41,29 @@
+dnl +dnl
+if test "$zio" = "no" || test -n "$zio" +if test "$zio" = "no" || test -n "$zio"
+then +then
+ AC_CHECK_HEADER(zio.h,[
+ for lib in ${zio#lib} zio
+ do
+ AC_CHECK_LIB($lib, fzopen, [LIBS="-l$lib $LIBS"
+ 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])
+ AC_CHECK_HEADER(zlib.h,[ + AC_CHECK_HEADER(zlib.h,[
+ for lib in z gz + for lib in z gz
+ do + do
+ AC_CHECK_LIB($lib, gzopen, [LIBS="$LIBS -l$lib" ; LEXLIB="$LEXLIB -l$lib" ; break]) + AC_CHECK_LIB($lib, gzopen, [LIBS="$LIBS -Wl,--no-as-needed -l$lib" ; break])
+ done]) + done])
+ AC_CHECK_HEADER(bzlib.h,[ + AC_CHECK_HEADER(bzlib.h,[
+ for lib in bz2 bzip2 + for lib in bz2 bzip2
+ do + do
+ AC_CHECK_LIB($lib, BZ2_bzopen, [LIBS="$LIBS -l$lib" ; LEXLIB="$LEXLIB -l$lib" ; break]) + AC_CHECK_LIB($lib, BZ2_bzopen, [LIBS="$LIBS -Wl,--no-as-needed -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]) + done])
+fi +fi
dnl To add more decompressors just follow the scheme above. dnl To add more decompressors just follow the scheme above.
# Work out which manual page hierarchy scheme might be in use. # Work out which manual page hierarchy scheme might be in use.
--- lib/decompress.c --- lib/decompress.c
+++ lib/decompress.c 2008-04-22 10:48:45.049189929 +0000 +++ lib/decompress.c 2008-04-23 10:48:04.431353342 +0000
@@ -36,6 +36,10 @@ @@ -36,6 +36,10 @@
# include "zlib.h" # include "zlib.h"
#endif /* HAVE_LIBZ */ #endif /* HAVE_LIBZ */
@ -108,7 +108,7 @@
pipeline *decompress_open (const char *filename) pipeline *decompress_open (const char *filename)
{ {
command *cmd; command *cmd;
@@ -77,9 +107,49 @@ pipeline *decompress_open (const char *f @@ -77,9 +107,53 @@ pipeline *decompress_open (const char *f
char *ext; char *ext;
struct compression *comp; struct compression *comp;
@ -124,6 +124,7 @@
+ cmd = command_new_function (name, &decompress_zio, "g"); + cmd = command_new_function (name, &decompress_zio, "g");
+ free (name); + free (name);
+ p = pipeline_new_commands (cmd, NULL); + p = pipeline_new_commands (cmd, NULL);
+ if (strcmp(program_name, "mandb") == 0)
+ p->libzio = 1; + p->libzio = 1;
+ goto got_pipeline; + goto got_pipeline;
+ } + }
@ -133,6 +134,7 @@
+ cmd = command_new_function (name, &decompress_zio, "z"); + cmd = command_new_function (name, &decompress_zio, "z");
+ free (name); + free (name);
+ p = pipeline_new_commands (cmd, NULL); + p = pipeline_new_commands (cmd, NULL);
+ if (strcmp(program_name, "mandb") == 0)
+ p->libzio = 1; + p->libzio = 1;
+ goto got_pipeline; + goto got_pipeline;
+ } + }
@ -142,6 +144,7 @@
+ cmd = command_new_function (name, &decompress_zio, "b"); + cmd = command_new_function (name, &decompress_zio, "b");
+ free (name); + free (name);
+ p = pipeline_new_commands (cmd, NULL); + p = pipeline_new_commands (cmd, NULL);
+ if (strcmp(program_name, "mandb") == 0)
+ p->libzio = 1; + p->libzio = 1;
+ goto got_pipeline; + goto got_pipeline;
+ } + }
@ -151,6 +154,7 @@
+ cmd = command_new_function (name, &decompress_zio, "Z"); + cmd = command_new_function (name, &decompress_zio, "Z");
+ free (name); + free (name);
+ p = pipeline_new_commands (cmd, NULL); + p = pipeline_new_commands (cmd, NULL);
+ if (strcmp(program_name, "mandb") == 0)
+ p->libzio = 1; + p->libzio = 1;
+ goto got_pipeline; + goto got_pipeline;
+ } + }
@ -160,7 +164,7 @@
filename_len = strlen (filename); filename_len = strlen (filename);
if (filename_len > 3 && STREQ (filename + filename_len - 3, ".gz")) { if (filename_len > 3 && STREQ (filename + filename_len - 3, ".gz")) {
--- lib/pipeline.c --- lib/pipeline.c
+++ lib/pipeline.c 2008-04-22 13:38:04.181934493 +0000 +++ lib/pipeline.c 2008-04-23 10:52:16.655715088 +0000
@@ -50,6 +50,10 @@ @@ -50,6 +50,10 @@
#include "error.h" #include "error.h"
#include "pipeline.h" #include "pipeline.h"
@ -240,7 +244,7 @@
/* Flush all pending output so that subprocesses don't inherit it. */ /* Flush all pending output so that subprocesses don't inherit it. */
fflush (NULL); fflush (NULL);
@@ -1009,6 +1046,18 @@ int pipeline_wait (pipeline *p) @@ -1009,6 +1046,19 @@ int pipeline_wait (pipeline *p)
pipeline_dump (p, stderr); pipeline_dump (p, stderr);
} }
@ -252,6 +256,7 @@
+ ret = 1; + ret = 1;
+ } + }
+ p->outfile = (FILE*)0; + p->outfile = (FILE*)0;
+ p->outfd = -1;
+ return ret; + return ret;
+ } + }
+#endif +#endif
@ -259,7 +264,7 @@
assert (p->pids); /* pipeline started */ assert (p->pids); /* pipeline started */
assert (p->statuses); assert (p->statuses);
@@ -1549,11 +1598,20 @@ static const char *get_block (pipeline * @@ -1549,11 +1599,20 @@ static const char *get_block (pipeline *
if (!peek) if (!peek)
p->peek_offset = 0; p->peek_offset = 0;
@ -282,7 +287,7 @@
if (peek) if (peek)
p->peek_offset += r; p->peek_offset += r;
--- lib/pipeline.h --- lib/pipeline.h
+++ lib/pipeline.h 2008-04-22 10:49:00.455159182 +0000 +++ lib/pipeline.h 2008-04-22 13:52:44.846881571 +0000
@@ -60,6 +60,14 @@ typedef struct pipeline { @@ -60,6 +60,14 @@ typedef struct pipeline {
pid_t *pids; pid_t *pids;
int *statuses; /* -1 until command exits */ int *statuses; /* -1 until command exits */

View File

@ -838,15 +838,18 @@
return NOT_FOUND; return NOT_FOUND;
} }
@@ -801,6 +802,8 @@ static int local_man_loop (const char *a @@ -801,8 +802,10 @@ static int local_man_loop (const char *a
argv_abs = xstrdup (argv); argv_abs = xstrdup (argv);
} }
lang = lang_dir (argv_abs); lang = lang_dir (argv_abs);
+ if (!lang || !*lang) + if (!lang || !*lang)
+ lang = internal_locale; + lang = internal_locale;
free (argv_abs); free (argv_abs);
if (!display (NULL, argv, NULL, argv_base, NULL)) { - if (!display (NULL, argv, NULL, argv_base, NULL)) {
+ if (!display (NULL, file, NULL, argv_base, NULL)) {
if (local_mf) if (local_mf)
error (0, errno, "%s", argv);
exit_status = NOT_FOUND;
@@ -834,7 +837,16 @@ int main (int argc, char *argv[]) @@ -834,7 +837,16 @@ int main (int argc, char *argv[])
bindtextdomain (PACKAGE "-gnulib", LOCALEDIR); bindtextdomain (PACKAGE "-gnulib", LOCALEDIR);
textdomain (PACKAGE); textdomain (PACKAGE);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Apr 23 13:12:12 CEST 2008 - werner@suse.de
- Use speedup for bnc#381830 only in mandb as man would be break
- Avoid trouble with -Wl,--as-needed therefore fore -lbz2 and -lz
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Apr 22 15:45:22 CEST 2008 - werner@suse.de Tue Apr 22 15:45:22 CEST 2008 - werner@suse.de

View File

@ -24,7 +24,7 @@ BuildRequires: gettext-runtime gettext-tools
BuildRequires: gettext gettext-devel BuildRequires: gettext gettext-devel
%endif %endif
Version: 2.5.1 Version: 2.5.1
Release: 1 Release: 3
Summary: A Program for Displaying man Pages Summary: A Program for Displaying man Pages
License: GPL v2 or later License: GPL v2 or later
Url: https://savannah.nongnu.org/projects/man-db Url: https://savannah.nongnu.org/projects/man-db
@ -270,6 +270,9 @@ test -d var/catman/ && rm -rf var/catman/ || true
%{_localstatedir}/adm/fillup-templates/sysconfig.cron-man %{_localstatedir}/adm/fillup-templates/sysconfig.cron-man
%changelog %changelog
* Wed Apr 23 2008 werner@suse.de
- Use speedup for bnc#381830 only in mandb as man would be break
- Avoid trouble with -Wl,--as-needed therefore fore -lbz2 and -lz
* Tue Apr 22 2008 werner@suse.de * Tue Apr 22 2008 werner@suse.de
- Make libzio interface smarter, that is if used only for simple - Make libzio interface smarter, that is if used only for simple
decompression do not use a pipe (saves 30%% mandb run time) decompression do not use a pipe (saves 30%% mandb run time)