More consistency between both documentation and update scripts

This commit is contained in:
Pierre Pronchery 2013-07-22 02:37:55 +02:00
parent cac2860df2
commit 15c1c507d6
2 changed files with 17 additions and 8 deletions

View File

@ -23,6 +23,7 @@ DATE=$(date '+%Y%m%d')
DESTDIR="/var/www"
DEVNULL="/dev/null"
EMAIL="webmaster@defora.org"
HOMEPAGE="http://www.defora.org"
ROOT=
SRC=
@ -69,6 +70,11 @@ _deforaos_document_cvs()
|| exit 2
fi
#update tree
echo ""
echo "Updating CVS module $CVSMODULE:"
(cd "$SRC" && $CVS update -dPA) > "$DEVNULL" || exit 2
#document tree
echo ""
echo "Documenting CVS module $CVSMODULE:"
@ -81,6 +87,7 @@ _deforaos_document_cvs()
$MKDIR -- "$DESTDIR/htdocs/doc/manual" &&
$FIND "doc/manual" -name "*.html" -exec \
$INSTALL -- {} "$DESTDIR/htdocs/{}" \;)
echo " $HOMEPAGE/doc/manual"
#generic documentation
echo ""
@ -90,6 +97,7 @@ _deforaos_document_cvs()
(cd "$path" && $MAKE DESTDIR="$DESTDIR" PREFIX="/" \
install > "$DEVNULL")
done
echo " $HOMEPAGE/doc/gtk-doc/html"
}
@ -118,6 +126,7 @@ _deforaos_document_git()
$MKDIR -- "$DESTDIR/htdocs/doc/manual" &&
$FIND "doc/manual" -name "*.html" -exec \
$INSTALL -- {} "$DESTDIR/htdocs/{}" \;)
echo " $HOMEPAGE/doc/manual"
}

View File

@ -59,7 +59,7 @@ _deforaos_update_cvs()
[ -n "$SRC" ] || SRC="$ROOT/$CVSMODULE"
#configure cvs if necessary
$MKDIR "$HOME" || exit 2
$MKDIR -- "$HOME" || exit 2
if [ ! -f "$HOME/.cvspass" ]; then
$TOUCH "$HOME/.cvspass" || exit 2
fi
@ -68,7 +68,7 @@ _deforaos_update_cvs()
if [ ! -d "$SRC" ]; then
echo ""
echo "Checking out CVS module $CVSMODULE:"
(cd "$HOME" && $CVS "-d$CVSROOT" co "$CVSMODULE") \
(cd "$ROOT" && $CVS "-d$CVSROOT" co "$CVSMODULE") \
|| exit 2
fi
@ -148,16 +148,16 @@ _usage()
#main
#parse options
update=_deforaos_update_cvs
scm=
while getopts "CgO:" name; do
SCM="CVS"
while getopts "CGO:" name; do
case "$name" in
C)
scm="CVS"
update=_deforaos_update_cvs
SCM="CVS"
;;
g)
scm="Git"
G)
update=_deforaos_update_git
SCM="Git"
;;
O)
export "${OPTARG%%=*}"="${OPTARG#*=}"
@ -175,5 +175,5 @@ if [ $# -ne 0 ]; then
fi
[ -n "$ROOT" ] || ROOT=$($MKTEMP -d -p "$HOME" "temp.XXXXXX")
[ -n "$ROOT" ] || exit 2
$update 2>&1 | $MAIL -s "Daily $scm update: $DATE" "$EMAIL"
$update 2>&1 | $MAIL -s "Daily $SCM update: $DATE" "$EMAIL"
$RMDIR "$ROOT"