Add fast option to autohelp-wrapper

Add -f option that uses existing environment and sources for quick
turn around.

Change-Id: I4f7febfb95701316387c640c676fb2da24063303
This commit is contained in:
Andreas Jaeger 2014-08-28 15:51:22 +02:00
parent 807ac96bc9
commit b612a6d598
2 changed files with 20 additions and 11 deletions

View File

@ -9,7 +9,8 @@ Release notes
* ``autohelp.py``: Improve sanitizer, better support for i18n in * ``autohelp.py``: Improve sanitizer, better support for i18n in
projects, allow setting of title name for tables. projects, allow setting of title name for tables.
* ``autohelp-wrapper``: Smarter handling of the manuals repo and environment * ``autohelp-wrapper``: Smarter handling of the manuals repo and environment
setup, add support for the ``create`` subcommand. setup, add support for the ``create`` subcommand, add support for
offline/fast operation.
* ``diff_branches.py``: Updated output format. * ``diff_branches.py``: Updated output format.
0.18.1 0.18.1

View File

@ -22,6 +22,7 @@ EXTRACT_SWIFT="python $HERE/extract_swift_flags.py"
GITBASE=git://git.openstack.org/openstack GITBASE=git://git.openstack.org/openstack
PROJECTS="ceilometer cinder glance heat keystone neutron nova sahara swift trove" PROJECTS="ceilometer cinder glance heat keystone neutron nova sahara swift trove"
BRANCH=master BRANCH=master
FAST=0
usage() { usage() {
echo "Wrapper for autohelp.py" echo "Wrapper for autohelp.py"
@ -37,6 +38,7 @@ usage() {
echo "Options:" echo "Options:"
echo " -b BRANCH: Work on this branch (defaults to master)" echo " -b BRANCH: Work on this branch (defaults to master)"
echo " -c: Recreate the virtual environment" echo " -c: Recreate the virtual environment"
echo " -f: Work offline: Do not change environment or sources"
echo " -e PATH: Create the virtualenv in PATH" echo " -e PATH: Create the virtualenv in PATH"
} }
@ -98,7 +100,7 @@ setup_tools() {
fi fi
} }
while getopts :b:e:c opt; do while getopts :b:e:cf opt; do
case $opt in case $opt in
b) b)
BRANCH=$OPTARG BRANCH=$OPTARG
@ -112,6 +114,10 @@ while getopts :b:e:c opt; do
VENVDIR=$OPTARG VENVDIR=$OPTARG
shift 2 shift 2
;; ;;
f)
FAST=1
shift
;;
\?) \?)
usage usage
exit 1 exit 1
@ -143,17 +149,19 @@ fi
[ $# != 0 ] && PROJECTS="$*" [ $# != 0 ] && PROJECTS="$*"
setup_venv setup_venv
setup_tools if [ "$FAST" -eq 0 ] ; then
setup_tools
for project in $PROJECTS; do for project in $PROJECTS; do
get_project $project get_project $project
( (
cd $SOURCESDIR/$project cd $SOURCESDIR/$project
git checkout $BRANCH git checkout $BRANCH
python setup.py install python setup.py install
) )
done done
fi
for project in $PROJECTS; do for project in $PROJECTS; do
if [ "$ACTION" = "setup" ]; then if [ "$ACTION" = "setup" ]; then