mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
106 lines
1.6 KiB
Plaintext
106 lines
1.6 KiB
Plaintext
|
#!/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
|