Code cleanup and minor fixes
This commit is contained in:
parent
c52c0b8020
commit
b2e01068e0
|
@ -104,7 +104,7 @@ _deforaos_update_git()
|
||||||
#update tree
|
#update tree
|
||||||
echo ""
|
echo ""
|
||||||
echo "Updating Git repository $SRC:"
|
echo "Updating Git repository $SRC:"
|
||||||
(cd "$SRC" && $GIT checkout -f && $GIT pull -v > "$DEVNULL") \
|
(cd "$SRC" && $GIT checkout -f && $GIT pull) > "$DEVNULL" \
|
||||||
|| exit 2
|
|| exit 2
|
||||||
|
|
||||||
#re-generate the makefiles
|
#re-generate the makefiles
|
||||||
|
@ -119,7 +119,7 @@ _deforaos_update_git()
|
||||||
parent="${script%%/script.sh}"
|
parent="${script%%/script.sh}"
|
||||||
#XXX read project.conf instead
|
#XXX read project.conf instead
|
||||||
for i in "$parent/"*; do
|
for i in "$parent/"*; do
|
||||||
[ -d "$i" ] || continue
|
[ -f "$i/Makefile" ] || continue
|
||||||
(cd "$i" && $MAKE download) > "$DEVNULL"
|
(cd "$i" && $MAKE download) > "$DEVNULL"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
@ -146,18 +146,19 @@ _usage()
|
||||||
|
|
||||||
|
|
||||||
#main
|
#main
|
||||||
|
delete=0
|
||||||
#parse options
|
#parse options
|
||||||
update=_deforaos_update_cvs
|
update=_deforaos_update_cvs
|
||||||
SCM="CVS"
|
scm="CVS"
|
||||||
while getopts "CGO:" name; do
|
while getopts "CGO:" name; do
|
||||||
case "$name" in
|
case "$name" in
|
||||||
C)
|
C)
|
||||||
update=_deforaos_update_cvs
|
update=_deforaos_update_cvs
|
||||||
SCM="CVS"
|
scm="CVS"
|
||||||
;;
|
;;
|
||||||
G)
|
G)
|
||||||
update=_deforaos_update_git
|
update=_deforaos_update_git
|
||||||
SCM="Git"
|
scm="Git"
|
||||||
;;
|
;;
|
||||||
O)
|
O)
|
||||||
export "${OPTARG%%=*}"="${OPTARG#*=}"
|
export "${OPTARG%%=*}"="${OPTARG#*=}"
|
||||||
|
@ -173,7 +174,10 @@ if [ $# -ne 0 ]; then
|
||||||
_usage
|
_usage
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
[ -n "$ROOT" ] || ROOT=$($MKTEMP -d -p "$HOME" "temp.XXXXXX")
|
if [ -z "$ROOT" ]; then
|
||||||
|
ROOT=$($MKTEMP -d -p "$HOME" "temp.XXXXXX")
|
||||||
|
delete=1
|
||||||
|
fi
|
||||||
[ -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"
|
[ $delete -eq 1 ] && $RMDIR "$ROOT"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user