Retire configure --enable-debug in favour of find -D ...

* find/defs.h (enum DebugOption): add DebugTime.
* find/util.c (debugassoc): -D time sets the DebugTime debug flag.
* find/oldfind.c (main): print the value of options.cur_day_start
when "-D time" is in effect (instead of when DEBUG is #defined).
* find/ftsfind.c (main): Likewise.
* find/pred.c (pred_table): Instantiate pred_table even if DEBUG
is not #defined.
* find/parser.c (parse_version): DEBUG is no longer a (distinct)
feature.
* configure.ac: Remove the --enable-debug option (all debugging is
now controlled via find's -D option).  Don't #define the
preprocessor macro DEBUG.
* NEWS: Mention this change.
This commit is contained in:
James Youngman
2015-12-30 23:43:23 +00:00
parent 869d1d4333
commit 9951518076
8 changed files with 14 additions and 29 deletions

5
NEWS
View File

@@ -6,11 +6,14 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
Updated the Hungarian and Slovak translations.
** Changes to find
** Changes to the build process
The configure option --enable-id-cache has been removed. It has been
a no-op since findnutils-4.5.15.
The configure option --enable-debug has been removed. Debugging in
find is now controlled by its -D option only.
* Major changes in release 4.6.0, 2015-12-28
** Stable Release

View File

@@ -15,10 +15,6 @@ AC_SUBST(AUXDIR,$ac_aux_dir)
dnl check for --with-fts
FIND_WITH_FTS
AC_ARG_ENABLE(debug,
AS_HELP_STRING(--enable-debug,Enable debugging output which is likely to be interesting to people debugging findutils),
[ac_cv_debug=$enableval],[ac_cv_debug=no])
AC_ARG_ENABLE(leaf-optimisation,
AS_HELP_STRING(--enable-leaf-optimisation,Enable an optimisation which saves lstat calls to identify subdirectories on filesystems having traditional Unix semantics),
[ac_cv_leaf_optimisation=$enableval],[ac_cv_leaf_optimisation=yes])
@@ -35,14 +31,6 @@ AC_ARG_ENABLE(d_type-optimisation,
[ac_cv_d_type=$enableval],[])
AC_MSG_CHECKING([whether debug output should be produced])
if test x$ac_cv_debug = xno; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
AC_DEFINE([DEBUG], 1, [Define if you want to see find's innards])
fi
AC_MSG_CHECKING([for leaf optimisation])
if test x$ac_cv_leaf_optimisation = xno; then
AC_MSG_RESULT([no])

View File

@@ -256,8 +256,7 @@ struct predicate
/* Pointer to the function that implements this predicate. */
PRED_FUNC pred_func;
/* Only used for debugging, but defined unconditionally so individual
modules can be compiled with -DDEBUG. */
/* Used for debugging */
const char *p_name;
/* The type of this node. There are two kinds. The first is real
@@ -532,7 +531,8 @@ enum DebugOption
DebugTreeOpt = 1 << 3,
DebugHelp = 1 << 4,
DebugExec = 1 << 5,
DebugSuccessRates = 1 << 6
DebugSuccessRates = 1 << 6,
DebugTime = 1 << 7
};
struct options

View File

@@ -701,9 +701,9 @@ main (int argc, char **argv)
if (options.debug_options & DebugStat)
options.xstat = debug_stat;
#ifdef DEBUG
fprintf (stderr, "cur_day_start = %s", ctime (&options.cur_day_start));
#endif /* DEBUG */
if (options.debug_options & DebugTime)
fprintf (stderr, "cur_day_start = %s", ctime (&options.cur_day_start));
/* We are now processing the part of the "find" command line

View File

@@ -226,9 +226,8 @@ main (int argc, char **argv)
if (options.debug_options & DebugStat)
options.xstat = debug_stat;
#ifdef DEBUG
fprintf (stderr, "cur_day_start = %s", ctime (&options.cur_day_start));
#endif /* DEBUG */
if (options.debug_options & DebugTime)
fprintf (stderr, "cur_day_start = %s", ctime (&options.cur_day_start));
/* state.cwd_dir_fd has to be initialized before we call build_expression_tree ()
* because command-line parsing may lead us to stat some files.

View File

@@ -2590,10 +2590,6 @@ parse_version (const struct parser_table* entry, char **argv, int *arg_ptr)
printf ("CACHE_IDS(ignored) ");
has_features = true;
#endif
#if DEBUG
printf ("DEBUG ");
has_features = true;
#endif
#if defined HAVE_STRUCT_DIRENT_D_TYPE
printf ("D_TYPE ");
has_features = true;

View File

@@ -76,7 +76,6 @@
static bool match_lname (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr, bool ignore_case);
#ifdef DEBUG
struct pred_assoc
{
PRED_FUNC pred_func;
@@ -145,7 +144,6 @@ struct pred_assoc pred_table[] =
{pred_context, "context"},
{0, "none "}
};
#endif
/* Returns ts1 - ts2 */
static double ts_difference (struct timespec ts1,

View File

@@ -73,7 +73,8 @@ static struct debug_option_assoc debugassoc[] =
{ "stat", DebugStat, "Trace calls to stat(2) and lstat(2)" },
{ "rates", DebugSuccessRates, "Indicate how often each predicate succeeded" },
{ "opt", DebugExpressionTree|DebugTreeOpt, "Show diagnostic information relating to optimisation" },
{ "exec", DebugExec, "Show diagnostic information relating to -exec, -execdir, -ok and -okdir" }
{ "exec", DebugExec, "Show diagnostic information relating to -exec, -execdir, -ok and -okdir" },
{ "time", DebugTime, "Show diagnostic information relating to time-of-day and timestamp comparisons" }
};
#define N_DEBUGASSOC (sizeof(debugassoc)/sizeof(debugassoc[0]))