[Spice-devel] [PATCH v2 1/2] build-sys: Remove test_spice_version.h

Christophe Fergeau cfergeau at redhat.com
Fri Aug 14 02:20:04 PDT 2015


This script was used at make distcheck time to verify consistency of the
version number defined in configure.ac and in spice-server headers.
Since commit ab12cf414c, these 2 version numbers can no longer be out of
sync, so we can drop this script.
---
 server/Makefile.am                 |  3 ---
 server/tests/test_spice_version.sh | 42 --------------------------------------
 2 files changed, 45 deletions(-)
 delete mode 100755 server/tests/test_spice_version.sh

diff --git a/server/Makefile.am b/server/Makefile.am
index 89a375c..99e3b73 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -145,6 +145,3 @@ EXTRA_DIST =					\
 	$(NULL)
 
 BUILT_SOURCES = $(spice_built_sources)
-
-dist-hook:
-	if test ./tests/test_spice_version.sh && ! test ./tests/test_spice_version.sh; then exit 1; fi
diff --git a/server/tests/test_spice_version.sh b/server/tests/test_spice_version.sh
deleted file mode 100755
index 5e5b173..0000000
--- a/server/tests/test_spice_version.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-
-ROOT=$(dirname $0)/../../
-INCLUDE="-I$ROOT -I$ROOT/spice-common/spice-protocol/"
-TEMP=`mktemp -d`
-
-cat > $TEMP/check_version.c <<EOF
-#include <stdio.h>
-#include "server/spice.h"
-
-int main(void)
-{
-        printf("%d.%d.%d\n", SPICE_SERVER_VERSION >> 16,
-               (SPICE_SERVER_VERSION >> 8) & 0xff,
-               SPICE_SERVER_VERSION & 0xff);
-        return 0;
-}
-EOF
-
-if ! gcc -o $TEMP/check_version $INCLUDE $TEMP/check_version.c ; then
-    echo "failed to compile tester"
-    exit -1
-fi
-
-INCLUDE_VERSION=`$TEMP/check_version`
-rm -Rf $TEMP
-
-CONF_MAJOR=`cat $ROOT/configure.ac | grep 'm4_define(\[SPICE_MAJOR\]' | sed -e 's/m4_define(\[SPICE_MAJOR\],\(.*\))/\1/'`
-CONF_MINOR=`cat $ROOT/configure.ac | grep 'm4_define(\[SPICE_MINOR\]' | sed -e 's/m4_define(\[SPICE_MINOR\],\(.*\))/\1/'`
-CONF_MICRO=`cat $ROOT/configure.ac | grep 'm4_define(\[SPICE_MICRO\]' | sed -e 's/m4_define(\[SPICE_MICRO\],\(.*\))/\1/'`
-CONF_VERSION=`printf %d.%d.%d $CONF_MAJOR $CONF_MINOR $CONF_MICRO`
-if [ $CONF_VERSION != $INCLUDE_VERSION ] ; then
-    echo "BAD: version in server/spice.h"
-    echo $INCLUDE_VERSION
-    echo "doesn't match version in configure.ac"
-    echo $CONF_VERSION
-    echo "please fix before doing a release"
-    exit 1
-else
-    echo "OK: both versions are $CONF_VERSION"
-fi
-exit 0
-- 
2.4.3



More information about the Spice-devel mailing list