@@ -1,5 +1,5 @@
AC_PREREQ([2.5])
-AC_INIT([OpenDataPlane], m4_esyscmd(./scripts/odp_version.sh), [lng-odp@lists.linaro.org])
+AC_INIT([OpenDataPlane], m4_esyscmd(./scripts/git_hash.sh .), [lng-odp@lists.linaro.org])
AM_INIT_AUTOMAKE([1.9 tar-pax subdir-objects])
AC_CONFIG_SRCDIR([helper/config.h.in])
AM_CONFIG_HEADER([helper/config.h])
@@ -12,6 +12,6 @@ lib_LTLIBRARIES = $(LIB)/libodp.la
AM_LDFLAGS += -version-number '$(ODP_LIBSO_VERSION)'
-GIT_DESC = `$(top_srcdir)/scripts/git_hash.sh $(top_srcdir)`
+GIT_DESC = `$(top_srcdir)/scripts/get_impl_str.sh $(top_srcdir)`
AM_CFLAGS += "-DGIT_HASH=$(GIT_DESC)"
AM_CFLAGS += -DPLATFORM=${with_platform}
@@ -1 +1 @@
-EXTRA_DIST = git_hash.sh odp_version.sh
+EXTRA_DIST = get_impl_str.sh git_hash.sh
@@ -3,13 +3,14 @@
set -e
ROOT_DIR=$(readlink -e $(dirname $0) | sed 's|/scripts||')
-version=$(${ROOT_DIR}/scripts/odp_version.sh)
pushd ${ROOT_DIR}
./bootstrap
./configure
make dist
+version=$(cat ${ROOT_DIR}/.scmversion)
+
cp opendataplane-${version}.tar.gz opendataplane_${version}.orig.tar.gz
tar xzf opendataplane_${version}.orig.tar.gz
@@ -22,6 +23,12 @@ rename 's,([^-\.]*)(.*),${1}'"${current}"'${2},' debian/*odp*
sed -i "s:\(.*odp\)\([^\.]\|$\):\1${current}\2:g" debian/control
sed -i "s:\(.*odp\)\(.*\):\1${current}\2:g" debian/rules
+if [ $(egrep "\.([a-z0-9]{8}\>|dirty)" .scmversion |wc -l) -gt 0 ]; then
+ export DEBFULLNAME="Donald Duck"
+ export DEBEMAIL="donald.duck@linaro.org"
+ dch --newversion ${version}-1 --urgency low "not a official release!"
+fi
+
debuild -us -uc
popd
popd
new file mode 100755
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+if [ -z ${1} ]; then
+ echo "should be called with a path"
+ exit
+fi
+ROOTDIR=${1}
+
+CUSTOM_STR=${CUSTOM_STR:-https://git.linaro.org/lng/odp.git}
+
+echo -n "'${CUSTOM_STR}' ($(cat ${ROOTDIR}/.scmversion))"
@@ -6,14 +6,22 @@ if [ -z ${1} ]; then
fi
ROOTDIR=${1}
-CUSTOM_STR=${CUSTOM_STR:-https://git.linaro.org/lng/odp.git}
if [ -d ${ROOTDIR}/.git ]; then
hash=$(git --git-dir=${ROOTDIR}/.git describe | tr -d "\n")
if [[ $(git --git-dir=${ROOTDIR}/.git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then
- dirty=-dirty
+ dirty=.dirty
fi
- echo -n "'${CUSTOM_STR}' (${hash}${dirty})">${ROOTDIR}/.scmversion
+ echo -n "${hash}${dirty}">${ROOTDIR}/.scmversion
+
+ sed -i "s|-|.git|" ${ROOTDIR}/.scmversion
+ sed -i "s|-|.|g" ${ROOTDIR}/.scmversion
+ sed -i "s|^v||g" ${ROOTDIR}/.scmversion
+elif [ ! -d ${ROOTDIR}/.git -a ! -f ${ROOTDIR}/.scmversion ]; then
+ echo -n "File ROOTDIR/.scmversion not found, "
+ echo "and not inside a git repository"
+ echo "Bailing out! Not recoverable!"
+ exit 1
fi
cat ${ROOTDIR}/.scmversion
deleted file mode 100755
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-VFILE="include/odp/api/version.h"
-
-GEN=`grep "define ODP_VERSION_API_GENERATION" ${VFILE} | cut -d ' ' -f 3`
-MAJ=`grep "define ODP_VERSION_API_MAJOR" ${VFILE} | cut -d ' ' -f 3`
-MIN=`grep "define ODP_VERSION_API_MINOR" ${VFILE} | cut -d ' ' -f 3`
-
-IMPL_FILE="platform/linux-generic/odp_impl.c"
-IMPL=`grep "define ODP_VERSION_IMPL " ${IMPL_FILE} | cut -d ' ' -f 3`
-
-echo -n $GEN.$MAJ.$MIN.$IMPL
This makes the version depend on git describe so there will be new deb packages names. Signed-off-by: Anders Roxell <anders.roxell@linaro.org> --- configure.ac | 2 +- platform/Makefile.inc | 2 +- scripts/Makefile.am | 2 +- scripts/builddeb | 9 ++++++++- scripts/get_impl_str.sh | 11 +++++++++++ scripts/git_hash.sh | 14 +++++++++++--- scripts/odp_version.sh | 12 ------------ 7 files changed, 33 insertions(+), 19 deletions(-) create mode 100755 scripts/get_impl_str.sh delete mode 100755 scripts/odp_version.sh