[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
wishlist: Please add update-info-dir to distribution (from Debian)
From: |
Jari Aalto |
Subject: |
wishlist: Please add update-info-dir to distribution (from Debian) |
Date: |
Fri, 14 Aug 2009 18:24:19 +0300 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.91 (gnu/linux) |
I'd like to propose that the update-info-dir(8) program would be
accepted to the the official texinfo package. I'm attaching the latest
version[1] and its manual page below.
Thanks,
Jari
[1] Debian wishlist: patch to improve update-info-dir prograam
http://bugs.debian.org/541468
#!/bin/bash
# update-info-dir
# create a dir file from all installed info files
# Copyright 2009 Norbert Preining
# GPLv2
INFODIR=/usr/share/info
set -e
Help ()
{
echo "\
SYNOPSIS: update-info-dir [-h,--help] [info-directory]
(re-)creates the index of available documentation in info format
(the file /usr/share/info/dir) which is usually presented by info browsers
on startup."
exit 0
}
if [ "$1" = "-h" ] || [ "$1" == "--help" ]; then
Help
fi
if [ -n "$1" ] ; then
INFODIR="$1"
fi
if [ ! -d "$INFODIR" ] ; then
echo "Not a directory: $INFODIR." >&2
exit 1
fi
if [ -r "$INFODIR/dir" ] ; then
rm -f "$INFODIR/dir.old"
cp $INFODIR/dir $INFODIR/dir.old
fi
# we have to remove the dir file not make ginstall-info being surprised
rm -f "$INFODIR/dir"
errors=0
find "$INFODIR" -type f | while read file ; do
case $file in
*/dir|*/dir.gz|*/dir.old|*/dir.old.gz|*-[0-9]|*-[0-9].gz|*-[1-9][0-9]|*-[1-9][0-9].gz|*.png)
# these files are ignored
continue
;;
*)
ginstall-info "$file" "$INFODIR/dir" || {
errors=$[errors+1]
}
;;
esac
done
if [ $errors -gt 0 ] ; then
exec >&2
echo
echo "Updating the index of info documentation produced $errors errors."
fi
exit 0
# vim:set expandtab tabstop=2: #
.TH UPDATE-INFO-DIR 8
.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
.\" other parms are allowed: see man(7), man(1)
.SH NAME
update-info-dir \- update or create index file
from all installed info files in directory
.SH SYNOPSIS
.B update-info-dir
.I "[options]"
.B [directory]
.br
.SH DESCRIPTION
Update, or create, the index file
.I dir
of available documentation in
/usr/share/info/ (the default) or in given DIRECTORY. The
index file
.I info
is the directory is usually presented by info browsers on startup.
.SH OPTIONS
.TP
.B \-h,--help
Display help and exit.
.PP
.SH SEE ALSO
emacs(1)
info(1)
install-info(1)
.SH AUTHOR
This manual page was written by Norbert Preining <address@hidden>,
for the Debian GNU/Linux system (but may be used by others).
This manual page was written for the Debian GNU/Linux distribution
because the original script was designed for Debian packaging system.
- wishlist: Please add update-info-dir to distribution (from Debian),
Jari Aalto <=