From patchwork Fri Oct 30 20:57:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 55860 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp85465lbr; Fri, 30 Oct 2015 14:08:57 -0700 (PDT) X-Received: by 10.107.46.142 with SMTP id u14mr11920424iou.165.1446239337466; Fri, 30 Oct 2015 14:08:57 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j3si4157265igx.48.2015.10.30.14.08.56; Fri, 30 Oct 2015 14:08:57 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id C2D0361A20; Fri, 30 Oct 2015 21:08:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID, T_FRT_SLUT, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 7520862C94; Fri, 30 Oct 2015 21:03:22 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 5921262C61; Fri, 30 Oct 2015 21:02:43 +0000 (UTC) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by lists.linaro.org (Postfix) with ESMTPS id 44DCC62C78 for ; Fri, 30 Oct 2015 21:01:59 +0000 (UTC) Received: by lfaz124 with SMTP id z124so39814825lfa.1 for ; Fri, 30 Oct 2015 14:01:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=U+ACQDBres/9KjJxOMR21M/UKhUu49Bn3lDY7XM2hWw=; b=IiI/vWwu9tVOzA6ZZQyVfQlZi0e7L8yhE95OJo9ZHDeB9E6prpL/GmaKtC3wwyEeLG aFmB95kwpgsPJzewF21eZkN/zM5KqyppfHFiXwIeEjCwz4EXlZhyCrcKvOhbiRO4TOuL P+oKTSleWfoCqU669z0eMg5nu1E1adrmNf+0lPdqd2wpZP/RgoVAbkWPJdEehWFsTt+B I0vHVX/8I5+jJ3mS1wltm+Ih1TRHesC4kZe8MU+naZUAE3tUs7yD3KimgeXNmm8S/Gvu w7FKCqf/XPHAY1GBkuSiVeoXtt2q4XPFJ7mpAhVi4gw/N152jZ3I/ouaFjET4USCUA87 9AWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=U+ACQDBres/9KjJxOMR21M/UKhUu49Bn3lDY7XM2hWw=; b=kKoSVahscPclyAp8W0ayE5A4yQkIMCd/9eZ8vlmGAT+vzhvRmBgC6e3+F8EfzktL37 j1k7Fq8ljjHM8raoqD/ZO3/WdzNZbe3dOe670f7dEs9pSsydeVKxYe1Ww92HBonrWiXJ 6wMj+5vJQSyxLcaL5/oQIoCVSVKZG4Ej4sThNWSfr3I9rewQUnPkCRqVnN2n5w97We4W tKTpzMum9hqAaAQn08mpS0gcMLpnPWTMGbPrx+Iv1PAPDsbhOwQIauScUIJ64V03w9yf hNKU1VFwWIe3UHFNDnEd0BPgJs1Z6f1HS6rIAcl18W57Xq6HSsm3DltZxgXxbec6r94W PLVg== X-Gm-Message-State: ALoCoQlzxsyLv7o/YI6f2GnPUwWE8BD83YNxeg3Tf1bouLNvwoEUJMUEomAD6Y1MenKaWXgIYtQ9 X-Received: by 10.112.205.194 with SMTP id li2mr5048413lbc.75.1446238918046; Fri, 30 Oct 2015 14:01:58 -0700 (PDT) Received: from localhost (c-893970d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.57.137]) by smtp.gmail.com with ESMTPSA id d18sm1579893lfe.44.2015.10.30.14.01.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Oct 2015 14:01:57 -0700 (PDT) From: Anders Roxell To: lng-odp@lists.linaro.org Date: Fri, 30 Oct 2015 21:57:44 +0100 Message-Id: <1446238668-15200-5-git-send-email-anders.roxell@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1446238668-15200-1-git-send-email-anders.roxell@linaro.org> References: <1446238668-15200-1-git-send-email-anders.roxell@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 4/8] scripts: cleanup git_hash and use it instead of odp_version. X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" This makes the version depend on git describe so there will be new deb packages names. Signed-off-by: Anders Roxell --- 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 diff --git a/configure.ac b/configure.ac index f7108ff..d698281 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/platform/Makefile.inc b/platform/Makefile.inc index 8e8e97b..db241f9 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -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} diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 617eadc..189b3ef 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1 +1 @@ -EXTRA_DIST = git_hash.sh odp_version.sh +EXTRA_DIST = get_impl_str.sh git_hash.sh diff --git a/scripts/builddeb b/scripts/builddeb index ddca129..8a52044 100755 --- a/scripts/builddeb +++ b/scripts/builddeb @@ -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 diff --git a/scripts/get_impl_str.sh b/scripts/get_impl_str.sh new file mode 100755 index 0000000..d765a53 --- /dev/null +++ b/scripts/get_impl_str.sh @@ -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))" diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh index fc0b057..ccd62ab 100755 --- a/scripts/git_hash.sh +++ b/scripts/git_hash.sh @@ -6,15 +6,23 @@ 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 diff --git a/scripts/odp_version.sh b/scripts/odp_version.sh deleted file mode 100755 index 2487b7f..0000000 --- a/scripts/odp_version.sh +++ /dev/null @@ -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