Added a script to document the tree
This commit is contained in:
parent
da1b169f6a
commit
d9f488197d
1
Makefile
1
Makefile
|
@ -23,6 +23,7 @@ dist:
|
|||
@$(TAR) $(PACKAGE)-$(VERSION).tar.gz -- \
|
||||
$(PACKAGE)-$(VERSION)/src/Makefile \
|
||||
$(PACKAGE)-$(VERSION)/src/deforaos-build.sh \
|
||||
$(PACKAGE)-$(VERSION)/src/deforaos-document.sh \
|
||||
$(PACKAGE)-$(VERSION)/src/deforaos-update.sh \
|
||||
$(PACKAGE)-$(VERSION)/src/project.conf \
|
||||
$(PACKAGE)-$(VERSION)/targets/Makefile \
|
||||
|
|
72
src/deforaos-document.sh
Executable file
72
src/deforaos-document.sh
Executable file
|
@ -0,0 +1,72 @@
|
|||
#!/usr/bin/env sh
|
||||
#$Id$
|
||||
#Copyright (c) 2012 Pierre Pronchery <khorben@defora.org>
|
||||
#This file is part of DeforaOS Unix scripts
|
||||
#TODO:
|
||||
#- no longer use a temporary folder
|
||||
|
||||
|
||||
|
||||
#environment
|
||||
umask 022
|
||||
#variables
|
||||
[ -z "$CVSROOT" ] && CVSROOT=":pserver:anonymous@anoncvs.defora.org:/home/cvs"
|
||||
#private
|
||||
DATE=`date '+%Y%m%d'`
|
||||
DESTDIR="/var/www"
|
||||
DEVNULL="/dev/null"
|
||||
EMAIL="webmaster@defora.org"
|
||||
ROOT=`mktemp -d -p "$HOME/temp" "temp.XXXXXX"`
|
||||
MODULE="DeforaOS"
|
||||
SRC="$ROOT/$MODULE"
|
||||
|
||||
#executables
|
||||
CVS="cvs -q"
|
||||
FIND="find"
|
||||
LN="ln -f"
|
||||
MAIL="mail"
|
||||
MAKE="make"
|
||||
MKDIR="mkdir -p"
|
||||
RM="rm -f"
|
||||
TAR="tar"
|
||||
TOUCH="touch"
|
||||
|
||||
|
||||
#functions
|
||||
#deforaos_document
|
||||
deforaos_document()
|
||||
{
|
||||
#configure cvs if necessary
|
||||
$MKDIR "$HOME" || exit 2
|
||||
if [ ! -f "$HOME/.cvspass" ]; then
|
||||
$TOUCH "$HOME/.cvspass" || exit 2
|
||||
fi
|
||||
|
||||
#checkout tree if necessary
|
||||
if [ ! -d "$SRC" ]; then
|
||||
echo ""
|
||||
echo "Checking out CVS module $MODULE:"
|
||||
(cd "$ROOT" && $CVS "-d$CVSROOT" co "$MODULE") || exit 2
|
||||
fi
|
||||
|
||||
#update tree
|
||||
echo ""
|
||||
echo "Updating CVS module $MODULE:"
|
||||
(cd "$SRC" && $CVS update -dPA) || exit 2
|
||||
|
||||
#document tree
|
||||
echo ""
|
||||
echo "Documenting CVS module $MODULE:"
|
||||
$FIND "$SRC/System" "$SRC/Apps" -name "doc" | while read path; do
|
||||
[ -x "$path/gtkdoc.sh" ] || continue
|
||||
(cd "$path" && $MAKE install DESTDIR="$DESTDIR" PREFIX="/" > "$DEVNULL" 2> "$DEVNULL")
|
||||
done
|
||||
|
||||
#erase temporary data
|
||||
$RM -r "$ROOT"
|
||||
}
|
||||
|
||||
|
||||
#main
|
||||
[ -z "$ROOT" ] && exit 2
|
||||
deforaos_document 2>&1 | $MAIL -s "Daily CVS documentation: $DATE" "$EMAIL"
|
|
@ -1 +1 @@
|
|||
dist=Makefile,deforaos-build.sh,deforaos-update.sh
|
||||
dist=Makefile,deforaos-build.sh,deforaos-document.sh,deforaos-update.sh
|
||||
|
|
Loading…
Reference in New Issue
Block a user