summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS16
-rw-r--r--configure.ac1
-rw-r--r--include/comp_src.h.in4
-rw-r--r--include/manconfig.h.in18
-rw-r--r--manual/comp.me10
-rw-r--r--src/compression.c20
-rw-r--r--src/filenames.c11
-rw-r--r--src/man.c4
-rw-r--r--src/straycats.c16
-rw-r--r--src/ult_src.c2
10 files changed, 36 insertions, 66 deletions
diff --git a/NEWS b/NEWS
index 7829c845..57b75ffa 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,19 @@
+man-db 2.9.0
+============
+
+Major changes since man-db 2.8.7:
+
+ Compatibility notes:
+ --------------------
+
+ * Remove the ability to undefine COMP_SRC at build-time to disable
+ reading compressed manual pages. This was always only a
+ micro-optimisation, and it wasn't worth the extra code complexity.
+ You can still configure without any compressors (either by not
+ having them available at build time, or by configuring with
+ "--with-gzip=" etc.) to achieve much the same practical effect,
+ although the test suite still requires at least gunzip.
+
man-db 2.8.7 (26 August 2019)
=============================
diff --git a/configure.ac b/configure.ac
index a98704da..0cbd9c28 100644
--- a/configure.ac
+++ b/configure.ac
@@ -321,7 +321,6 @@ fi
if test -n "$gzip" || test -n "$compress" || test -n "$bzip2" || test -n "$xz" || test -n "$lzip" || test -n "$lzma"
then
AC_DEFINE([COMP_CAT], [1], [Define if you have compressors and want to support compressed cat files.])
- AC_DEFINE([COMP_SRC], [1], [Define if you have compressors and want to support compressed manual source.])
fi
AC_SUBST([compressor])
AC_SUBST([compress_ext])
diff --git a/include/comp_src.h.in b/include/comp_src.h.in
index 4d6b0e75..d3ef8901 100644
--- a/include/comp_src.h.in
+++ b/include/comp_src.h.in
@@ -42,8 +42,6 @@
#ifndef MAN_COMP_SRC_H
#define MAN_COMP_SRC_H
-#ifdef COMP_SRC
-
struct compression comp_list[] = {
/* If we have gzip, incorporate the following */
@@ -93,6 +91,4 @@ struct compression comp_list[] = {
{NULL, NULL, NULL}
};
-#endif /* COMP_SRC */
-
#endif /* MAN_COMP_SRC_H */
diff --git a/include/manconfig.h.in b/include/manconfig.h.in
index 6166d9cb..859970f3 100644
--- a/include/manconfig.h.in
+++ b/include/manconfig.h.in
@@ -215,18 +215,16 @@
# define COMPRESS_EXT "@compress_ext@"
#endif /* COMP_CAT */
-#ifdef COMP_SRC
/* These are the currently supported decompressors. They are used for
decompressing cat pages and source nroff. To add further decompressors,
you will need to edit comp_src.h[.in] . Help is provided in the file */
-# define GUNZIP "@gunzip@"
-# define UNCOMPRESS "@uncompress@"
-# define BUNZIP2 "@bunzip2@"
-# define UNLZMA "@unlzma@"
-# define UNXZ "@unxz@"
-# define UNLZIP "@unlzip@"
-#endif /* COMP_SRC */
+#define GUNZIP "@gunzip@"
+#define UNCOMPRESS "@uncompress@"
+#define BUNZIP2 "@bunzip2@"
+#define UNLZMA "@unlzma@"
+#define UNXZ "@unxz@"
+#define UNLZIP "@unlzip@"
/*-----------------------------------------------------------------------*/
/* The things below here shouldn't really be changed unless you really */
@@ -287,10 +285,6 @@ extern int _nl_msg_cat_cntr;
# define locale_changed()
#endif /* ENABLE_NLS */
-/* This structure definition is only really needed if COMP_SRC==1, but it is
- used in external declarations quite freely, so it's included
- unconditionally */
-
struct compression {
/* The following are const because they should be pointers to parts
* of strings allocated elsewhere and should not be written through
diff --git a/manual/comp.me b/manual/comp.me
index 0a03d7c0..b9535f07 100644
--- a/manual/comp.me
+++ b/manual/comp.me
@@ -35,15 +35,7 @@ See
for details and an example.
.lp
Support for compressed manual pages is compiled into the \*M utilities by
-default.
-To completely disable this support, edit
-.i config.h
-and comment out the following line
-.lp
-#define COMP_SRC 1
-.lp
-This will enable a minor speed increase, but note that support for stray cats
-with any compression extension other than the default will also be disabled.
+default, depending on the decompressors available at configure time.
.BS 2 "Compressed cat pages"
.lp
\*M compresses cat files by default.
diff --git a/src/compression.c b/src/compression.c
index 73bce776..cd1028cf 100644
--- a/src/compression.c
+++ b/src/compression.c
@@ -40,7 +40,6 @@
#include "xvasprintf.h"
#include "manconfig.h"
-#ifdef COMP_SRC /* must come after manconfig.h */
#include "error.h"
#include "pipeline.h"
@@ -78,13 +77,16 @@ struct compression *comp_info (const char *filename, int want_stem)
}
}
- ext = strstr (filename, ".Z/");
- if (ext) {
- if (want_stem)
- hpux_comp.stem = xstrndup (filename, ext - filename);
- else
- hpux_comp.stem = NULL;
- return &hpux_comp;
+ if (*GUNZIP) {
+ ext = strstr (filename, ".Z/");
+ if (ext) {
+ if (want_stem)
+ hpux_comp.stem = xstrndup (filename,
+ ext - filename);
+ else
+ hpux_comp.stem = NULL;
+ return &hpux_comp;
+ }
}
return NULL;
@@ -116,5 +118,3 @@ struct compression *comp_file (const char *filename)
free (compfile);
return NULL;
}
-
-#endif /* COMP_SRC */
diff --git a/src/filenames.c b/src/filenames.c
index 69cdeda3..a3ba7e50 100644
--- a/src/filenames.c
+++ b/src/filenames.c
@@ -79,7 +79,7 @@ char *make_filename (const char *path, const char *name,
* into, to be freed by the caller, or NULL on error. The buffer will
* contain either three or four null-terminated strings: the directory name,
* the base of the file name in that directory, the section extension, and
- * optionally the compression extension (if COMP_SRC is defined).
+ * optionally the compression extension.
*
* Only the fields name, ext, sec, and comp are filled in by this function.
* name is only set if it differs from req_name; otherwise it remains at
@@ -91,13 +91,10 @@ char *filename_info (const char *file, struct mandata *info,
char *manpage = xstrdup (file);
char *slash = strrchr (manpage, '/');
char *base_name;
+ struct compression *comp;
memset (info, 0, sizeof (struct mandata));
-#ifdef COMP_SRC
- struct compression *comp;
-#endif
-
if (slash) {
*slash = '\0'; /* strip '/base_name' */
base_name = slash + 1;
@@ -109,7 +106,6 @@ char *filename_info (const char *file, struct mandata *info,
a missmatch between the section they are under and the
sectional part of their extension. */
-#ifdef COMP_SRC
comp = comp_info (base_name, 1);
if (comp) {
info->comp = comp->ext;
@@ -117,9 +113,6 @@ char *filename_info (const char *file, struct mandata *info,
free (comp->stem);
} else
info->comp = NULL;
-#else /* !COMP_SRC */
- info->comp = NULL;
-#endif /* COMP_SRC */
{
char *ext = strrchr (base_name, '.');
diff --git a/src/man.c b/src/man.c
index 207e6f68..41d900e3 100644
--- a/src/man.c
+++ b/src/man.c
@@ -2492,17 +2492,13 @@ static char *convert_name (const char *name, int fsstnd)
{
char *to_name, *t1 = NULL;
char *t2 = NULL;
-#ifdef COMP_SRC
struct compression *comp;
-#endif /* COMP_SRC */
char *namestem;
-#ifdef COMP_SRC
comp = comp_info (name, 1);
if (comp)
namestem = comp->stem;
else
-#endif /* COMP_SRC */
namestem = xstrdup (name);
#ifdef COMP_CAT
diff --git a/src/straycats.c b/src/straycats.c
index 577eab07..b07083c7 100644
--- a/src/straycats.c
+++ b/src/straycats.c
@@ -107,9 +107,7 @@ static int check_for_stray (MYDBM_FILE dbf)
char *ext, *section;
short found;
struct stat buf;
-#ifdef COMP_SRC
struct compression *comp;
-#endif
memset (&info, 0, sizeof (struct mandata));
@@ -125,18 +123,9 @@ static int check_for_stray (MYDBM_FILE dbf)
"ignoring bogus filename"),
catdir);
continue;
-
-#if defined(COMP_SRC) || defined(COMP_CAT)
-
-# if defined(COMP_SRC)
} else if (comp_info (ext, 0)) {
-# elif defined(COMP_CAT)
- } else if (strcmp (ext + 1, COMPRESS_EXT) == 0) {
-# endif /* COMP_* */
*ext = '\0';
info.comp = ext + 1;
-#endif /* COMP_SRC || COMP_CAT */
-
} else
info.comp = NULL;
@@ -165,13 +154,10 @@ static int check_for_stray (MYDBM_FILE dbf)
if (stat (mandir, &buf) == 0)
found = 1;
-#ifdef COMP_SRC
else if ((comp = comp_file (mandir))) {
found = 1;
free (comp->stem);
- }
-#endif
- else
+ } else
found = 0;
if (!found) {
diff --git a/src/ult_src.c b/src/ult_src.c
index 0b99876d..43e7a9b3 100644
--- a/src/ult_src.c
+++ b/src/ult_src.c
@@ -306,7 +306,6 @@ const char *ult_src (const char *name, const char *path,
char *decomp_base;
pipeline *decomp;
char *include;
-#ifdef COMP_SRC
struct stat st;
if (stat (base, &st) < 0) {
@@ -323,7 +322,6 @@ const char *ult_src (const char *name, const char *path,
return NULL;
}
}
-#endif
/* base may change for recursive calls to ult_src, but
* decompress_open doesn't keep its own copy.