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

View File

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