From 15c1c507d680d6f42cbc8fc8f81f435122b16545 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 22 Jul 2013 02:37:55 +0200 Subject: [PATCH] More consistency between both documentation and update scripts --- src/deforaos-document.sh | 9 +++++++++ src/deforaos-update.sh | 16 ++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/deforaos-document.sh b/src/deforaos-document.sh index b260832..2af18e7 100755 --- a/src/deforaos-document.sh +++ b/src/deforaos-document.sh @@ -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" } diff --git a/src/deforaos-update.sh b/src/deforaos-update.sh index f5db0a0..0235c98 100755 --- a/src/deforaos-update.sh +++ b/src/deforaos-update.sh @@ -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"