-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1853 2012/01/29 01:47:05 tom Exp $
+-- $Id: NEWS,v 1.1854 2012/02/04 22:25:57 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20120204
+ + improved tic -D option, avoid making target directory and provide
+ better diagnostics.
+
20120128
+ add mach-gnu (Debian #614316, patch by Samuel Thibault)
+ add mach-gnu-color, tweaks to mach-gnu terminfo -TD
+ amend fix intended to separate fixups for acsc to allow "tic -cv" to
give verbose warnings (cf: 20110730).
+ modify misc/gen-edit.sh to make the location of the tabset directory
- consistent with misc/Makefile.in, i.., using ${datadir}/tabset
+ consistent with misc/Makefile.in, i.e., using ${datadir}/tabset
(Debian #653435, patch by Sven Joachim).
20120121
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.855 2012/01/28 15:26:26 tom Exp $
+# $Id: dist.mk,v 1.856 2012/02/04 16:54:39 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 9
-NCURSES_PATCH = 20120128
+NCURSES_PATCH = 20120204
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
.\"***************************************************************************
-.\" Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
+.\" Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: tic.1m,v 1.53 2011/12/17 23:13:19 tom Exp $
+.\" $Id: tic.1m,v 1.54 2012/02/04 23:09:43 tom Exp $
.TH @TIC@ 1M ""
.ds n 5
.ds d @TERMINFO@
.PP
As described in \fBterm\fR(\*n), the database may be either a directory
tree (one file per terminal entry) or a hashed database (one record per entry).
-The \fB@TIC@\fR writes only one type of entry, depending on how it was built:
+The \fB@TIC@\fR command writes only one type of entry,
+depending on how it was built:
.bP
For directory trees, the top-level directory, e.g., /usr/share/terminfo,
specifies the location of the database.
The default name for the hashed database is the same as the
default directory name (only adding a ".db" suffix).
.PP
+In either case (directory or hashed database),
+\fB@TIC@\fP will create the container if it does not exist.
+For a directory, this would be the "terminfo" leaf,
+versus a "terminfo.db" file.
+.PP
The results are normally placed in the system terminfo database \fB\*d\fR.
-The compiled terminal description can be placed in a different terminfo database.
+The compiled terminal description can be placed
+in a different terminfo database.
There are two ways to achieve this:
.bP
-First, you may override the system default by setting the variable
-\fBTERMINFO\fR in your shell environment to a valid database
-location, e.g., an existing directory (for directory trees) or
-valid location for a hashed database.
+First, you may override the system default either by
+using the \fB\-o\fP option,
+or by setting the variable \fBTERMINFO\fR
+in your shell environment to a valid database location.
.bP
Secondly, if \fB@TIC@\fR cannot write in \fI\*d\fR
or the location specified using your TERMINFO variable,
if that location exists, the entry is placed there.
.PP
Libraries that read terminfo entries are expected to check for
+.bP
a location specified with the TERMINFO variable first,
-look at \fI$HOME/.terminfo\fR if TERMINFO is not set, and
-finally look in \fI\*d\fR.
+.bP
+look in \fI$HOME/.terminfo\fR if TERMINFO is not set, next
+.bP
+directories listed in the TERMINFO_DIRS symbol, and
+.bP
+finally look in the system terminfo database (\fI\*d\fR).
+.SS OPTIONS
.TP
\fB\-0\fR
restricts the output to a single line
make an extended table entry for that.
User-defined capability strings
whose name begins with ``k'' are treated as function keys.
+.SS PARAMETERS
.TP
\fIfile\fR
contains one or more \fBterminfo\fR terminal descriptions in source
All values computed in construction of the hash table
.LP
If the debug level \fIn\fR is not given, it is taken to be one.
+.SS PROCESSING
.PP
All but one of the capabilities recognized by \fB@TIC@\fR are documented
in \fBterminfo\fR(\*n).
\fBentry_name_1\fR before \fBuse=\fR for these capabilities to be
canceled in \fBentry_name_1\fR.
.PP
-If the environment variable \fBTERMINFO\fR is set, the compiled
-results are placed there instead of \fB\*d\fR.
-.PP
Total compiled entries cannot exceed 4096 bytes.
The name field cannot
exceed 512 bytes.
/****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <sys/stat.h>
#include <dump_entry.h>
+#include <hashed_db.h>
#include <transform.h>
-MODULE_ID("$Id: tic.c,v 1.157 2011/12/31 21:11:59 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.160 2012/02/05 01:39:39 tom Exp $")
const char *_nc_progname = "tic";
return result;
}
+static const char *
+valid_db_path(const char *nominal)
+{
+ struct stat sb;
+#if USE_HASHED_DB
+ char suffix[] = DBM_SUFFIX;
+ size_t need = strlen(nominal) + sizeof(suffix);
+ char *result = malloc(need);
+
+ strcpy(result, nominal);
+ if (strcmp(result + need - sizeof(suffix), suffix)) {
+ strcat(result, suffix);
+ }
+#else
+ char *result = strdup(nominal);
+#endif
+
+ DEBUG(1, ("** stat(%s)", result));
+ if (stat(result, &sb) >= 0) {
+#if USE_HASHED_DB
+ if (!S_ISREG(sb.st_mode)
+ || access(result, R_OK | W_OK) != 0) {
+ DEBUG(1, ("...not a writable file"));
+ free(result);
+ result = 0;
+ }
+#else
+ if (!S_ISDIR(sb.st_mode)
+ || access(result, R_OK | W_OK | X_OK) != 0) {
+ DEBUG(1, ("...not a writable directory"));
+ free(result);
+ result = 0;
+ }
+#endif
+ } else {
+ /* check if parent is directory and is writable */
+ unsigned leaf = _nc_pathlast(result);
+
+ DEBUG(1, ("...not found"));
+ if (leaf) {
+ char save = result[leaf];
+ result[leaf] = 0;
+ if (stat(result, &sb) >= 0
+ && S_ISDIR(sb.st_mode)
+ && access(result, R_OK | W_OK | X_OK) == 0) {
+ result[leaf] = save;
+ } else {
+ DEBUG(1, ("...parent directory %s is not writable", result));
+ free(result);
+ result = 0;
+ }
+ } else {
+ DEBUG(1, ("... no parent directory"));
+ free(result);
+ result = 0;
+ }
+ }
+ return result;
+}
+
/*
- * Show the databases that tic knows about. The location to which it writes is
- * always the first one. If that is not writable, then tic errors out before
- * reaching this function.
+ * Show the databases to which tic could write. The location to which it
+ * writes is always the first one. If none are writable, print an error
+ * message.
*/
static void
-show_databases(void)
+show_databases(const char *outdir)
{
- DBDIRS state;
- int offset;
- const char *path;
+ bool specific = (outdir != 0) || getenv("TERMINFO") != 0;
+ const char *result;
+ const char *tried = 0;
+
+ if (outdir == 0) {
+ outdir = _nc_tic_dir(0);
+ }
+ if ((result = valid_db_path(outdir)) != 0) {
+ printf("%s\n", result);
+ } else {
+ tried = outdir;
+ }
- _nc_first_db(&state, &offset);
- while ((path = _nc_next_db(&state, &offset)) != 0) {
- printf("%s\n", path);
+ if ((outdir = _nc_home_terminfo())) {
+ if ((result = valid_db_path(outdir)) != 0) {
+ printf("%s\n", result);
+ } else if (!specific) {
+ tried = outdir;
+ }
+ }
+
+ /*
+ * If we can write in neither location, give an error message.
+ */
+ if (tried) {
+ fflush(stdout);
+ fprintf(stderr, "%s: %s (no permission)\n", _nc_progname, tried);
+ ExitProgram(EXIT_FAILURE);
}
- _nc_last_db();
}
+#define VtoTrace(opt) (unsigned) ((opt > 0) ? opt : (opt == 0))
+
int
main(int argc, char *argv[])
{
sortmode = S_TERMCAP;
break;
case 'D':
- _nc_set_writedir(outdir);
- show_databases();
+ debug_level = VtoTrace(v_opt);
+ set_trace_level(debug_level);
+ show_databases(outdir);
ExitProgram(EXIT_SUCCESS);
break;
case 'I':
last_opt = this_opt;
}
- debug_level = (unsigned) ((v_opt > 0) ? v_opt : (v_opt == 0));
+ debug_level = VtoTrace(v_opt);
set_trace_level(debug_level);
if (_nc_tracing) {
*/
if (namelst && (!infodump && !capdump)) {
(void) fprintf(stderr,
- "Sorry, -e can't be used without -I or -C\n");
+ "%s: Sorry, -e can't be used without -I or -C\n",
+ _nc_progname);
cleanup(namelst);
ExitProgram(EXIT_FAILURE);
}
* authorization. *
****************************************************************************/
/*
- * $Id: movewindow.c,v 1.33 2012/01/15 00:30:35 tom Exp $
+ * $Id: movewindow.c,v 1.34 2012/02/05 01:16:47 tom Exp $
*
* Demonstrate move functions for windows and derived windows from the curses
* library.
max_line, max_col,
TRUE,
&more)) != 0) {
- int y0, x0;
-
- getbegyx(parent, y0, x0);
if (mvderwin(win, tmp->y, tmp->x) != ERR) {
refresh_all(win);
doupdate();