summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmacd <jmacd@FreeBSD.org>1997-01-12 14:43:22 +0000
committerjmacd <jmacd@FreeBSD.org>1997-01-12 14:43:22 +0000
commit032a90d7cf4e900ac739766fa730891f8e3adb1e (patch)
treebe0d09322af51a4e599e07b93365366bff60e123
parent131b2f4db47c22dacfa1e19fca0decaa6dba854a (diff)
downloadFreeBSD-src-032a90d7cf4e900ac739766fa730891f8e3adb1e.zip
FreeBSD-src-032a90d7cf4e900ac739766fa730891f8e3adb1e.tar.gz
I added both features Peter Wemm requested. First, the new option
--forceentry=TEXT will override any entries contained in the info file. Second, I made it recognize that "gmp" and "gmp.info" are the same when looking for whether the info file being installed is already installed.
-rw-r--r--contrib/texinfo/util/install-info.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/contrib/texinfo/util/install-info.c b/contrib/texinfo/util/install-info.c
index 0918436..1c24bbe 100644
--- a/contrib/texinfo/util/install-info.c
+++ b/contrib/texinfo/util/install-info.c
@@ -1,7 +1,7 @@
/* install-info -- create Info directory entry(ies) for an Info file.
Copyright (C) 1996 Free Software Foundation, Inc.
-$Id: install-info.c,v 1.1.1.1 1997/01/11 02:12:38 jmacd Exp $
+$Id: install-info.c 1.1 Sun, 12 Jan 1997 00:21:13 -0800 jmacd $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -306,6 +306,10 @@ print_help ()
Options:\n\
--delete Delete existing entries in INFO-FILE;\n\
don't insert any new entries.\n\
+--defentry=TEXT Like --entry, but only use TEXT if an entry\n\
+ is not present in INFO-FILE.\n\
+--defsection=TEXT Like --section, but only use TEXT if a section\n\
+ is not present in INFO-FILE.\n\
--dir-file=NAME Specify file name of Info directory file.\n\
This is equivalent to using the DIR-FILE argument.\n\
--entry=TEXT Insert TEXT as an Info directory entry.\n\
@@ -314,6 +318,7 @@ Options:\n\
If you specify more than one entry, they are all added.\n\
If you don't specify any entries, they are determined\n\
from information in the Info file itself.\n\
+--forceentry=TEXT Like --entry, but ignore any entry in INFO-FILE.\n\
--help Display this help and exit.\n\
--info-file=FILE Specify Info file to install in the directory.\n\
This is equivalent to using the INFO-FILE argument.\n\
@@ -344,6 +349,7 @@ struct option longopts[] =
{ "defsection", required_argument, NULL, 'S' },
{ "dir-file", required_argument, NULL, 'd' },
{ "entry", required_argument, NULL, 'e' },
+ { "forceentry", required_argument, NULL, 'f' },
{ "help", no_argument, NULL, 'h' },
{ "info-dir", required_argument, NULL, 'D' },
{ "info-file", required_argument, NULL, 'i' },
@@ -396,6 +402,7 @@ main (argc, argv)
/* Nonzero means only use if not present in info file. */
int entry_default = 0;
+ int entry_force = 0;
int section_default = 0;
progname = argv[0];
@@ -437,6 +444,13 @@ main (argc, argv)
dirfile = concat (optarg, "", "/dir");
break;
+ case 'f':
+ entry_force = 1;
+ if (!optarg[0])
+ {
+ fprintf (stderr, "%s: Must provide entry name.\n", progname);
+ suggest_asking_for_help ();
+ }
case 'E':
entry_default = 1;
if (!optarg[0])
@@ -505,6 +519,9 @@ For more information about these matters, see the files named COPYING.");
}
}
+ if (entry_force)
+ entry_default = 0;
+
/* Interpret the non-option arguments as file names. */
for (; optind < argc; ++optind)
{
@@ -568,7 +585,7 @@ For more information about these matters, see the files named COPYING.");
and put them on entries_to_add. But not if entries
were specified explicitly with command options. */
- if (entries_to_add == 0 || entry_default)
+ if ( !entry_force && (entries_to_add == 0 || entry_default) )
{
char *start_of_this_entry = 0;
for (i = 0; i < input_nlines; i++)
@@ -744,8 +761,9 @@ For more information about these matters, see the files named COPYING.");
p++;
if ((dir_lines[i].size
> (p - dir_lines[i].start + infilelen_sans_info))
- && !strncmp (p, infile_sans_info, infilelen_sans_info)
- && p[infilelen_sans_info] == ')')
+ && !strncmp(p, infile_sans_info, infilelen_sans_info)
+ && ( p[infilelen_sans_info] == ')' ||
+ strncmp (p + infilelen_sans_info, ".info)", 6) == 0))
dir_lines[i].delete = 1;
}
}
OpenPOWER on IntegriCloud