[virt-tools-list] [PATCH 2/5] v5: update autobuild.sh so it works
Daniel P. Berrange
berrange at redhat.com
Mon Apr 8 16:03:22 UTC 2013
On Mon, Apr 08, 2013 at 11:28:55AM -0400, Gene Czarcinski wrote:
> There a some problems with autobuild.sh and this patch addresses
> them:
>
> 1. Some of the tests fail so temporarily comment out
> "prython setup.py test" until things are fixed so the tests
> run correctly. At that time, this should be uncommented.
>
> 2. "python setup.py install" needs to use --root= instead
> of --prefix=
>
> 3. For the rpmbuild, use dist/*tar.gz instead of *.tar.gz
>
> 4. Add export AUTOBUILD_OVERRIDE_VERSION=y so that if
> the version-id changes are applied, a simpler version-id
> is used for autobuild.
> .
> Signed-off-by: Gene Czarcinski <gene at czarc.net>
> ---
> autobuild.sh | 30 +++++++++++++++++++++++++-----
> 1 file changed, 25 insertions(+), 5 deletions(-)
>
> diff --git a/autobuild.sh b/autobuild.sh
> index baa9482..c1c36f6 100755
> --- a/autobuild.sh
> +++ b/autobuild.sh
> @@ -1,7 +1,7 @@
> #!/bin/sh
>
> set -v
> -set -e
> +#set -e
Don't do this - for any command which you expect
to fail, use '|| :' as a postfix to catch and
ignore the error.
>
> if [ -z "$AUTOBUILD_INSTALL_ROOT" ] ; then
> echo "This script is only meant to be used with an autobuild server."
> @@ -9,11 +9,31 @@ if [ -z "$AUTOBUILD_INSTALL_ROOT" ] ; then
> exit 1
> fi
>
> -python setup.py build
> -python setup.py test
> -python setup.py install --prefix=$AUTOBUILD_INSTALL_ROOT
> +which git &> /dev/null
> +if [ $? == 0 -a -d .git ]; then
> + # Are there uncommitted changes?
> + unmerged=`git update-index --refresh --unmerged`
> + if [ -n "$unmerged" ]; then
> + echo "$unmerged"
> + echo "uncommitted changes exist, exiting autobuild.sh"
> + exit 1
> + fi
> +else
> + echo "no git or not git repository, exiting autobuild.sh"
> + exit 1
> +fi
Just delete all of this - it should not be runing any
GIT commands at all, nor require that it is run from a
GIT repository.
> +
> +rm -rf MANIFEST dist/*
> +
> +# support version-id changes
> +export AUTOBUILD_OVERRIDE_VERSION=y
> +set -e
> python setup.py sdist
>
> +python setup.py build
> +#python setup.py test
> +python setup.py install --root=$AUTOBUILD_INSTALL_ROOT
> +
> which /usr/bin/rpmbuild > /dev/null 2>&1 || exit 0
>
> if [ -n "$AUTOBUILD_COUNTER" ]; then
> @@ -22,5 +42,5 @@ else
> NOW=`date +"%s"`
> EXTRA_RELEASE=".$USER$NOW"
> fi
> -rpmbuild --nodeps --define "extra_release $EXTRA_RELEASE" -ta --clean *.tar.gz
> +rpmbuild --nodeps --define "extra_release $EXTRA_RELEASE" -ta --clean dist/*.tar.gz
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the virt-tools-list
mailing list