diff --git a/man-db-2.5.1-zio.dif b/man-db-2.5.1-zio.dif index be18899..eb005cc 100644 --- a/man-db-2.5.1-zio.dif +++ b/man-db-2.5.1-zio.dif @@ -41,29 +41,29 @@ +dnl +if test "$zio" = "no" || test -n "$zio" +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,[ + for lib in z gz + 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]) + 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])]) ++ AC_CHECK_LIB($lib, BZ2_bzopen, [LIBS="$LIBS -Wl,--no-as-needed -l$lib" ; break]) + 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 ++++ lib/decompress.c 2008-04-23 10:48:04.431353342 +0000 @@ -36,6 +36,10 @@ # include "zlib.h" #endif /* HAVE_LIBZ */ @@ -108,7 +108,7 @@ pipeline *decompress_open (const char *filename) { command *cmd; -@@ -77,9 +107,49 @@ pipeline *decompress_open (const char *f +@@ -77,9 +107,53 @@ pipeline *decompress_open (const char *f char *ext; struct compression *comp; @@ -124,7 +124,8 @@ + cmd = command_new_function (name, &decompress_zio, "g"); + free (name); + p = pipeline_new_commands (cmd, NULL); -+ p->libzio = 1; ++ if (strcmp(program_name, "mandb") == 0) ++ p->libzio = 1; + goto got_pipeline; + } + if (ext && STREQ (ext, ".z")) { @@ -133,7 +134,8 @@ + cmd = command_new_function (name, &decompress_zio, "z"); + free (name); + p = pipeline_new_commands (cmd, NULL); -+ p->libzio = 1; ++ if (strcmp(program_name, "mandb") == 0) ++ p->libzio = 1; + goto got_pipeline; + } + if (ext && STREQ (ext, ".bz2")) { @@ -142,7 +144,8 @@ + cmd = command_new_function (name, &decompress_zio, "b"); + free (name); + p = pipeline_new_commands (cmd, NULL); -+ p->libzio = 1; ++ if (strcmp(program_name, "mandb") == 0) ++ p->libzio = 1; + goto got_pipeline; + } + if (ext && STREQ (ext, ".Z")) { @@ -151,7 +154,8 @@ + cmd = command_new_function (name, &decompress_zio, "Z"); + free (name); + p = pipeline_new_commands (cmd, NULL); -+ p->libzio = 1; ++ if (strcmp(program_name, "mandb") == 0) ++ p->libzio = 1; + goto got_pipeline; + } +#endif /* HAVE_ZIO */ @@ -160,7 +164,7 @@ 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 ++++ lib/pipeline.c 2008-04-23 10:52:16.655715088 +0000 @@ -50,6 +50,10 @@ #include "error.h" #include "pipeline.h" @@ -240,7 +244,7 @@ /* Flush all pending output so that subprocesses don't inherit it. */ fflush (NULL); -@@ -1009,6 +1046,18 @@ int pipeline_wait (pipeline *p) +@@ -1009,6 +1046,19 @@ int pipeline_wait (pipeline *p) pipeline_dump (p, stderr); } @@ -252,6 +256,7 @@ + ret = 1; + } + p->outfile = (FILE*)0; ++ p->outfd = -1; + return ret; + } +#endif @@ -259,7 +264,7 @@ assert (p->pids); /* pipeline started */ 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) p->peek_offset = 0; @@ -282,7 +287,7 @@ if (peek) p->peek_offset += r; --- 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 { pid_t *pids; int *statuses; /* -1 until command exits */ diff --git a/man-db-2.5.1.dif b/man-db-2.5.1.dif index acd4962..3947a6e 100644 --- a/man-db-2.5.1.dif +++ b/man-db-2.5.1.dif @@ -838,15 +838,18 @@ 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); } lang = lang_dir (argv_abs); + if (!lang || !*lang) + lang = internal_locale; 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) + error (0, errno, "%s", argv); + exit_status = NOT_FOUND; @@ -834,7 +837,16 @@ int main (int argc, char *argv[]) bindtextdomain (PACKAGE "-gnulib", LOCALEDIR); textdomain (PACKAGE); diff --git a/man.changes b/man.changes index 70eec51..d56c025 100644 --- a/man.changes +++ b/man.changes @@ -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 diff --git a/man.spec b/man.spec index 769a864..b385639 100644 --- a/man.spec +++ b/man.spec @@ -24,7 +24,7 @@ BuildRequires: gettext-runtime gettext-tools BuildRequires: gettext gettext-devel %endif Version: 2.5.1 -Release: 1 +Release: 3 Summary: A Program for Displaying man Pages License: GPL v2 or later 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 %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 - Make libzio interface smarter, that is if used only for simple decompression do not use a pipe (saves 30%% mandb run time)