1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00
elinks/doc/get-cvs-docs
Petr Baudis 0f6d4310ad Initial commit of the HEAD branch of the ELinks CVS repository, as of
Thu Sep 15 15:57:07 CEST 2005. The previous history can be added to this
by grafting.
2005-09-15 15:58:31 +02:00

106 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
#
# Copyright (c) Jonas Fonseca <fonseca@diku.dk>, 2005
CVSROOT=:pserver:anonymous:@cvs.elinks.or.cz:/var/cvs/elinks
DOCTYPES=
check_docdir()
{
doctype="$1"
if test -d "$doctype";
then
if test -d "$doctype/CVS";
then
cwd="$(pwd)"
echo "Updating files."
cd "$doctype"
cvs update
cd "$cwd"
else
echo "Move the local $doctype directory."
fi
else
DOCTYPES="$DOCTYPES web/documentation/$doctype"
fi
}
extract_chunked()
{
if test -d html && test -e html/manual.html-chunked.tar.gz;
then
rm -rf html/manual.html-chunked
echo "Extracting chunked files in the html directory."
cd html && tar xvfz manual.html-chunked.tar.gz
fi
}
while test -n "$1";
do
case "$1" in
-h|--help)
cat <<__END__
$(basename $0) - get generated documentation from cvs
Usage:
$(basename $0) [-h|--help] [--version] [pdf|html]...
Options:
-h, --help show help message
--version
pdf get all available pdf files
html get all available html files
__END__
exit
;;
--version)
echo "$(basename $0)" '$Id: get-cvs-docs,v 1.2 2005/07/11 19:18:35 jonas Exp $'
exit
;;
pdf)
check_docdir pdf
;;
html)
check_docdir html
;;
*)
echo "Unknown option: $1"
exit
;;
esac
shift
done
if test -z "$DOCTYPES";
then
extract_chunked
exit
fi
if test -d web;
then
echo "Remove the local web directory."
exit
fi
echo "Press return when queried for password."
cvs -d "$CVSROOT" login
cvs -d "$CVSROOT" checkout $DOCTYPES
for doctype in $DOCTYPES;
do
echo "Moving $doctype into $(basename $doctype)"
mv $doctype $(basename $doctype)
done
extract_chunked
echo "Cleaning temporary files."
rm -rf web