1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775
|
#! /bin/sh
#
# @configure_input@
#
# $Id: install-inf.in 0.21 2000/06/14 00:02:01 tom Exp $
#
# This is my private `install-info' script.
#
# It inserts INFO-DIR-ENTRY lines of Texinfo `.info' files at the end of
# an existing `dir.texi' file and recreates the `dir' file either in the
# directory given by the `--info-dir=DIR' option or in the first matching
# $INFOPATH directory. It also creates a backup of the original `dir.texi'
# file under the name `dir.texi~'.
#
# *** It cannot insert INFO-DIR-ENTRY lines into an existing `dir' file
# *** in case no `dir.texi' file exists!
#
# This script also manages compressed/gzipped Texinfo `*.info' files like
# `*.info*.Z', `*.info*.z' and `*.info*.gz', also compressed/gzipped `dir'
# and `dir.texi' files.
#
# If both the `dir' and `dir.texi' files do not exist, this script will
# create a new `dir.texi' file and --using it-- a new `dir' file!
#
# Needs `test', `echo', `head', `eval', `cat', `cd', `cp', `rm', `makeinfo',
# `set', `gzip' or `compress', `sort', `sed' and `awk' for processing.
#
# Returns 0 if success.
# Returns 1 in case an error occurs.
#
# Copyright (c) 1996, 97, 2000 Thomas Esken <esken@gmx.net>
# Im Hagenfeld 84
# D-48147 M"unster
# GERMANY
#
# This software doesn't claim completeness, correctness or usability.
# On principle I will not be liable for ANY damages or losses (implicit
# or explicit), which result from using or handling my software.
# If you use this software, you agree without any exception to this
# agreement, which binds you LEGALLY !!
#
# 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
# the `Free Software Foundation'; either version 2, or (at your option)
# any later version.
#
# You should have received a copy of the `GNU General Public License'
# along with this program; if not, write to the:
#
# Free Software Foundation, Inc.
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#
#
# Basically used programs.
#
Sed=sed
Test=test
Echo=echo
#
# Basically used texts.
#
PACKAGE=@PACKAGE@
VERSION=@VERSION@
myname=`$Echo "$0" | $Sed -e 's,.*/,,'`
myversion=0.21
myinternalname="$myname ($PACKAGE $VERSION) $myversion"
usage1="usage: $myname --help | --version"
usage2="usage: $myname [--verbose] [--debug] [--info[-]dir=DIR] INFOFILE..."
error1="$myinternalname: error: no input file specified"
error2="$myinternalname: error: use --help to show usage"
#
# Some constant values.
#
EXIT_SUCCESS=0
EXIT_FAILURE=1
#
# Let's start processing now.
#
if $Test "$#" -ne 0;
then
#
# The suffix for the backup of the original `dir.texi' file.
#
backup_suffix="~"
#
# The suffixes of compressed/gzipped files.
#
gzip_2_suffix=.gz
gzip_1_suffix=.z
compress_suffix=.Z
#
# Number of lines to scan for INFO-DIR-ENTRY texts in an INFOFILE.
#
lines_to_scan=200
#
# The used programs.
#
Head=head
Head_flags="-$lines_to_scan"
Eval=eval
Set=set
Cat=cat
Cd=cd
Cp="@CP@"
Rm=rm
Makeinfo=@MAKEINFO@
Gzip=@GZIP@
Compress=@COMPRESS@
Gzip_uncompress_flags=-cd
Sort=sort
Awk=@AWK@
#
# Let's set some default directories and file names first.
#
tmpdir=/tmp
prefix=@prefix@
infodir="$prefix/info"
dirfile=dir
dir_texifile="$dirfile.texi"
#
# Let's set the compressor program to `compress' if no `gzip' is available.
#
if $Test -z "$Gzip";
then
if $Test -n "$Compress";
then
Gzip="$Compress"
fi
fi
#
# Respect a $TMPDIR or a $TMP environment variable.
#
if $Test -n "$TMPDIR";
then
tmpdir="$TMPDIR"
else
if $Test -n "$TMP";
then
tmpdir="$TMP"
fi
fi
#
# Let's check for command line arguments.
#
verbose=no
debug=no
infodir_set=no
previous=""
for option in $*
do
#
# If the previous option needs an argument, assign it.
#
if $Test -n "$previous";
then
$Eval "$previous=\$option"
previous=""
continue
fi
case "$option" in
-*=) optarg="###error###" ;;
-*=*) optarg=`$Echo "$option" | $Sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg="" ;;
esac
#
# Manage the options.
#
case "$option" in
-help=* | -hel=* | -he=* | -h=* | \
-help | -hel | -he | -h | \
--help=* | --hel=* | --he=* | --h=* | \
--help | --hel | --he | --h)
if $Test -n "$optarg";
then
$Echo "$myname: error: option \``$Echo $option | $Sed -e 's/=.*//'`' doesn't allow an argument" 1>&2
exit $EXIT_FAILURE
fi
$Echo "$usage1"
$Echo "$usage2"
exit $EXIT_SUCCESS ;;
-version=* | -versio=* | -versi=* | -vers=* | \
-version | -versio | -versi | -vers | \
--version=* | --versio=* | --versi=* | --vers=* | \
--version | --versio | --versi | --vers)
if $Test -n "$optarg";
then
$Echo "$myname: error: option \``$Echo $option | $Sed -e 's/=.*//'`' doesn't allow an argument" 1>&2
exit $EXIT_FAILURE
fi
$Echo "$myinternalname"
exit $EXIT_SUCCESS ;;
-verbose=* | -verbos=* | -verbo=* | -verb=* | \
-verbose | -verbos | -verbo | -verb | \
--verbose=* | --verbos=* | --verbo=* | --verb=* | \
--verbose | --verbos | --verbo | --verb)
if $Test -n "$optarg";
then
$Echo "$myname: error: option \``$Echo $option | $Sed -e 's/=.*//'`' doesn't allow an argument" 1>&2
exit $EXIT_FAILURE
fi
verbose=yes ;;
-debug=* | -debu=* | -deb=* | -de=* | -d=* | \
-debug | -debu | -deb | -de | -d | \
--debug=* | --debu=* | --deb=* | --de=* | --d=* | \
--debug | --debu | --deb | --de | --d)
if $Test -n "$optarg";
then
$Echo "$myname: error: option \``$Echo $option | $Sed -e 's/=.*//'`' doesn't allow an argument" 1>&2
exit $EXIT_FAILURE
fi
debug=yes ;;
-info-dir | -info-di | -info-d | -info- | \
-infodir | -infodi | -infod | -info | -inf | -in | -i | \
--info-dir | --info-di | --info-d | --info- | \
--infodir | --infodi | --infod | --info | --inf | --in | --i)
previous=infodir ;;
-info-dir=* | -info-di=* | -info-d=* | -info-=* | \
-infodir=* | -infodi=* | -infod=* | -info=* | -inf=* | -in=* | -i=* | \
--info-dir=* | --info-di=* | --info-d=* | --info-=* | \
--infodir=* | --infodi=* | --infod=* | --info=* | --inf=* | --in=* | --i=*)
if $Test -z "$optarg" || $Test "$optarg" = "###error###";
then
$Echo "$myname: error: option \``$Echo $option | $Sed -e 's/=//g'`' requires an argument" 1>&2
exit $EXIT_FAILURE
fi
infodir_set=yes
infodir="$optarg" ;;
-*) $Echo "$myname: error: $option: invalid option; use --help to show usage" 1>&2
exit $EXIT_FAILURE ;;
esac
done
if $Test -n "$previous";
then
$Echo "$myname: error: missing argument to --$previous" 1>&2
exit $EXIT_FAILURE
fi
#
# We need two temporary files for processing!
#
newtmp="n$$"
dirtmp="d$$"
if $Test "$debug" = yes;
then
#
# Enable tracing.
#
$Set -x
else
trap "$Rm -f $tmpdir/$newtmp $tmpdir/$dirtmp;exit $EXIT_FAILURE" 1 2 15
fi
#
# Check for the presence of AWK.
#
if $Test -z "$Awk"
then
$Echo "$myinternalname: error: \`awk' not available" 1>&2
exit $EXIT_FAILURE
fi
#
# Override an existing $INFOPATH environment variable.
#
if $Test "$infodir_set" = yes || $Test -z "$INFOPATH";
then
if $Test -d "$infodir" && $Test -s "$infodir";
then
INFOPATH="$infodir"
else
$Echo "$myinternalname: error: cannot access infodir \`$infodir'" 1>&2
exit $EXIT_FAILURE
fi
fi
#
# Detect where the original `dir.texi' and `dir' files are stored.
#
IFS="${IFS= }"
save_ifs="$IFS"
IFS="${IFS}:"
dirpath=""
real_dirfile=""
dirfile_gzipped_2=no
dirfile_gzipped_1=no
dirfile_compressed=no
dir_texifile_gzipped_2=no
dir_texifile_gzipped_1=no
dir_texifile_compressed=no
for dir in $INFOPATH
do
if $Test -f "$dir/$dir_texifile""$gzip_2_suffix" && \
$Test -r "$dir/$dir_texifile""$gzip_2_suffix";
then
dir_texifile_gzipped_2=yes
dirpath="$dir/$dir_texifile""$gzip_2_suffix"
fi
if $Test "$dir_texi_file_gzipped_2" = no;
then
if $Test -f "$dir/$dir_texifile""$gzip_1_suffix" && \
$Test -r "$dir/$dir_texifile""$gzip_1_suffix";
then
dir_texifile_gzipped_1=yes
dirpath="$dir/$dir_texifile""$gzip_1_suffix"
fi
if $Test "$dir_texi_file_gzipped_1" = no;
then
if $Test -f "$dir/$dir_texifile""$compress_suffix" && \
$Test -r "$dir/$dir_texifile""$compress_suffix";
then
dir_texifile_compressed=yes
dirpath="$dir/$dir_texifile""$compress_suffix"
fi
fi
fi
if $Test "$dir_texifile_gzipped_2" = yes || \
$Test "$dir_texifile_gzipped_1" = yes || \
$Test "$dir_texifile_compressed" = yes || \
$Test -f "$dir/$dir_texifile";
then
if $Test -f "$dir/$dir_texifile" && \
$Test -r "$dir/$dir_texifile";
then
dirpath="$dir/$dir_texifile"
fi
if $Test -f "$dir/$dirfile""$gzip_2_suffix" && \
$Test -r "$dir/$dirfile""$gzip_2_suffix";
then
dirfile_gzipped_2=yes
real_dirfile="$dir/$dirfile""$gzip_2_suffix"
fi
if $Test "$dirfile_gzipped_2" = no;
then
if $Test -f "$dir/$dirfile""$gzip_1_suffix" && \
$Test -r "$dir/$dirfile""$gzip_1_suffix";
then
dirfile_gzipped_1=yes
real_dirfile="$dir/$dirfile""$gzip_1_suffix"
fi
if $Test "$dirfile_gzipped_1" = no;
then
if $Test -f "$dir/$dirfile""$compress_suffix" && \
$Test -r "$dir/$dirfile""$compress_suffix";
then
dirfile_compressed=yes
real_dirfile="$dir/$dirfile""$compress_suffix"
else
real_dirfile="$dir/$dirfile"
fi
fi
fi
break
fi
done
IFS="$save_ifs"
if $Test -z "$dirpath";
then
if $Test "$verbose" = yes;
then
$Echo "$myinternalname: warning: no existing \`$infodir/$dir_texifile' file found"
fi
#
# No `dir.texi' file found, so check for a `dir' file now.
#
if $Test -f "$dir/$dirfile" && \
$Test -r "$dir/$dirfile";
then
#
# This script cannot insert INFO-DIR-ENTY lines into an existing
# `dir' file, which will be untouched now, so just exit with success.
#
if $Test "$verbose" = yes;
then
$Echo "$myinternalname: warning: but existing \`$infodir/$dirfile' file found"
$Echo
$Echo "$myinternalname: warning: this case cannot be managed now, so you"
$Echo "$myinternalname: warning: have to install *GNU Texinfo-3.8* or later"
$Echo "$myinternalname: warning: in order to install the INFO-DIR-ENTRY lines"
$Echo
fi
$Echo "$myinternalname: mission impossible by reason of missing \`$infodir/$dir_texifile' file"
exit $EXIT_SUCCESS
fi
if $Test "$verbose" = yes;
then
$Echo "$myinternalname: warning: a new \`$dir_texifile' file will be created now"
$Echo "$myinternalname: warning: in the \`$infodir' directory, please wait..."
fi
dirpath="$infodir/$dir_texifile"
$Echo "@setfilename dir" > $dirpath
$Echo "@node Top, (dir), (dir), (dir)" >> $dirpath
$Echo "@center" >> $dirpath
$Echo "Welcome to the FSF's Info Browser =8^.@*" >> $dirpath
$Echo "@center" >> $dirpath
$Echo "Select one of the following basic documentations:" >> $dirpath
$Echo "@menu" >> $dirpath
$Echo "My favourite tools:" >> $dirpath
$Echo "@end menu" >> $dirpath
$Echo "@bye" >> $dirpath
if $Test "$verbose" = yes;
then
$Echo
$Echo "$myinternalname: \`$dirpath' successfully created"
$Echo
$Echo "$myinternalname: let's see if \`$dirpath'"
$Echo "$myinternalname: can be extended by some INFO-DIR-ENTRY lines"
$Echo
$Echo "$myinternalname: please wait..."
$Echo
fi
else
if $Test ! -w "$dirpath";
then
$Echo "$myinternalname: error: \`$dirpath' file not writeable" 1>&2
exit $EXIT_FAILURE
else
if $Test "$verbose" = yes;
then
$Echo "$myinternalname: let's see if \`$dirpath'"
$Echo "$myinternalname: can be extended by some INFO-DIR-ENTRY lines"
$Echo
$Echo "$myinternalname: please wait..."
$Echo
fi
fi
fi
#
# Let's start processing now.
#
files_given=no
for file in $*
do
case "$file" in
-*) continue
;;
*) files_given=yes
#
# Store all lines between `START-INFO-DIR-ENTRY' and `END-INFO-DIR-ENTRY'.
#
if $Test -f "$file" && $Test -r "$file";
then
if $Test "$verbose" = yes;
then
$Echo "$myinternalname: working on \`$file' ..."
fi
#
# Let's check for compressed/gzipped files.
#
infofile_gzipped_2=`$Echo "$file" | \
$Sed -e 's/\///g' -e "s/$gzip_2_suffix/\//" \
-e 's/[-_\*\ \\^\!\$%&=?+#,;:|.~<>(){}a-zA-Z0-9]/@/g' \
-e 's/@\/@//' -e 's/@\//yes/' -e 's/@//g'`
if $Test "$infofile_gzipped_2" != yes;
then
infofile_gzipped_1=`$Echo "$file" | \
$Sed -e 's/\///g' -e "s/$gzip_1_suffix/\//" \
-e 's/[-_\*\ \\^\!\$%&=?+#,;:|.~<>(){}a-zA-Z0-9]/@/g' \
-e 's/@\/@//' -e 's/@\//yes/' -e 's/@//g'`
if $Test "$infofile_gzipped_1" != yes;
then
infofile_compressed=`$Echo "$file" | \
$Sed -e 's/\///g' -e "s/$compress_suffix/\//" \
-e 's/[-_\*\ \\^\!\$%&=?+#,;:|.~<>(){}a-zA-Z0-9]/@/g' \
-e 's/@\/@//' -e 's/@\//yes/' -e 's/@//g'`
fi
fi
if $Test "$infofile_gzipped_2" = yes || \
$Test "$infofile_gzipped_1" = yes || \
$Test "$infofile_compressed" = yes;
then
if $Test -n "$Gzip";
then
cmd=`$Gzip $Gzip_uncompress_flags $file | \
$Head $Head_flags`
else
cmd=""
fi
else
cmd=`$Head $Head_flags $file`
fi
if $Test -n "$cmd";
then
$Echo "$cmd" | \
$Awk 'BEGIN {found = 0; lines = 0;} \
{ \
if ($0 ~ /START-INFO-DIR-ENTRY/) \
found = 1; \
else \
if (found == 1) \
{ \
if ($0 ~ /END-INFO-DIR-ENTRY/) \
{ \
found = 0; \
if (lines > 0) \
{ \
if (substr(buf, 1, 1) == "*") \
print buf; \
else \
{ \
i = 1; \
while (substr(buf, i, 1) == " ") \
i++; \
if (i == 1) \
i++; \
print substr(buf, i-1); \
} \
} \
} \
else \
{ \
if (lines == 0) \
buf = $0; \
else \
{ \
nl_found = 0; \
if (substr($0, 1, 1) == "*") \
nl_found = 1; \
if (nl_found == 0) \
printf "%s", buf; \
else \
{ \
i = 1; \
while (substr(buf, i, 1) == " ") \
i++; \
if (i == 1) \
i++; \
print substr(buf, i-1); \
} \
buf = $0; \
} \
lines++; \
} \
} \
}' - >> $tmpdir/$newtmp
else
$Echo "$myinternalname: warning: can't operate on \`$file' by reason of missing compressor program"
fi
else
if $Test ! -f "$file";
then
$Echo "$myinternalname: warning: \`$file' file not found"
else
$Echo "$myinternalname: warning: \`$file' file not readable"
fi
fi
esac
done
#
# Emit some diagnostic texts.
#
if $Test -s "$tmpdir/$newtmp"
then
#
# Some INFO-DIR-ENTRY lines detected, go ahead.
#
if $Test "$verbose" = yes;
then
$Echo
$Echo "$myinternalname: some INFO-DIR-ENTRY lines detected..."
$Echo "$myinternalname: here they are:"
$Cat $tmpdir/$newtmp
$Echo
fi
else
#
# No INFO-DIR-ENTRY lines detected, exit.
#
if $Test "$debug" = no;
then
$Rm -f $tmpdir/$newtmp
fi
if $Test "$verbose" = yes;
then
if $Test "$files_given" = yes;
then
$Echo
$Echo "$myinternalname: no INFO-DIR-ENTRY lines detected,"
$Echo "$myinternalname: so modification of \`$dirpath' unnecessary..."
exit $EXIT_SUCCESS
else
$Echo "$myinternalname: error: no files specified" 1>&2
exit $EXIT_FAILURE
fi
else
#
# No INFO-DIR-ENTRY lines detected, exit with success.
#
$Echo "$myinternalname: nothing to do... bye bye"
exit $EXIT_SUCCESS
fi
fi
#
# Check whether the `dir' file is compressed/gzipped.
#
use_gzip_with_dirfile=no
if $Test "$dirfile_gzipped_2" = yes || \
$Test "$dirfile_gzipped_1" = yes || \
$Test "$dirfile_compressed" = yes;
then
use_gzip_with_dirfile=yes
fi
#
# Check whether the `dir.texi' file is compressed/gzipped.
#
use_gzip_with_dir_texifile=no
if $Test "$dir_texifile_gzipped_2" = yes || \
$Test "$dir_texifile_gzipped_1" = yes || \
$Test "$dir_texifile_compressed" = yes;
then
use_gzip_with_dir_texifile=yes
fi
#
# We can always continue our task if the `dir.texi' file is uncompressed...
# If it is compressed/gzipped, check whether it can be uncompressed.
# If former have failed, we have lost because our mission is impossible!
#
if $Test "$use_gzip_with_dir_texifile" = no || $Test -n "$Gzip";
then
#
# Now create the NEW `dir.texi' file.
#
if $Test "$use_gzip_with_dir_texifile" = yes;
then
$Gzip $Gzip_uncompress_flags $dirpath | \
$Awk 'BEGIN {found = 0;} \
{ \
if (found == 0) \
{ \
if ($0 ~ /@end menu/) \
found = 1; \
else \
print $0; \
} \
}' - >> $tmpdir/$dirtmp
else
$Awk 'BEGIN {found = 0;} \
{ \
if (found == 0) \
{ \
if ($0 ~ /@end menu/) \
found = 1; \
else \
print $0; \
} \
}' $dirpath >> $tmpdir/$dirtmp
fi
#
# After copying all text of the original `dir.texi' file until (exclusive)
# an "@end menu" line, append the extracted texts between START-INFO-DIR-ENTRY
# and END-INFO-DIR-ENTRY to the temporary file in sorted manner.
#
$Cat $tmpdir/$newtmp | $Sort >> $tmpdir/$dirtmp
#
# And append the rest of the original `dir.texi' file to the temporary file.
#
if $Test "$use_gzip_with_dir_texifile" = yes;
then
$Gzip $Gzip_uncompress_flags $dirpath | \
$Awk 'BEGIN {found = 0;} \
{ \
if (found != 0) \
print $0; \
else \
if ($0 ~ /@end menu/) \
{ \
found = 1; \
print $0; \
} \
}' - >> $tmpdir/$dirtmp
else
$Awk 'BEGIN {found = 0;} \
{ \
if (found != 0) \
print $0; \
else \
if ($0 ~ /@end menu/) \
{ \
found = 1; \
print $0; \
} \
}' $dirpath >> $tmpdir/$dirtmp
fi
if $Test -n "$Makeinfo";
then
#
# Create a NEW `dir' file by means of the `makeinfo' program,
# but first backup the original `dir.texi' file and then copy
# the results of processing to the NEW `dir.texi' file.
#
$Cd $dir
if $Test -n "$Cp";
then
$Cp $dirpath $dirpath""$backup_suffix
$Cp $tmpdir/$dirtmp $dir_texifile
else
$Cat $dirpath > $dirpath""$backup_suffix
$Cat $tmpdir/$dirtmp > $dir_texifile
fi
$Makeinfo $dir_texifile
#
# And compress/gzip the resulting file now.
#
if $Test "$use_gzip_with_dirfile" = yes && $Test -n "$Gzip";
then
$Rm -f $real_dirfile
$Gzip $dirfile
fi
else
if $Test "$verbose" = yes;
then
$Echo "$myinternalname: warning: cannot create \`$dirfile' by reason of missing makeinfo program"
fi
fi
if $Test "$use_gzip_with_dir_texifile" = yes && $Test -n "$Gzip";
then
$Rm -f $dirpath
$Gzip $dir_texifile
fi
#
# At last, clean the temporary files and exit with success.
#
if $Test "$debug" = no;
then
$Rm -f $tmpdir/$newtmp $tmpdir/$dirtmp
fi
if $Test "$verbose" = yes;
then
$Echo
fi
$Echo "$myinternalname: all modifications successfully done"
exit $EXIT_SUCCESS
else
#
# At last, clean the one remaining temporary file and exit with success.
#
if $Test "$debug" = no;
then
$Rm -f $tmpdir/$newtmp
fi
if $Test "$verbose" = yes;
then
$Echo
fi
$Echo "$myinternalname: mission impossible by reason of missing compressor program"
exit $EXIT_SUCCESS
fi
else
$Echo "$error1" 1>&2
$Echo "$error2" 1>&2
exit $EXIT_FAILURE
fi
|