From patchwork Mon Aug 10 10:07:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 52209 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id A6E9C2152A for ; Mon, 10 Aug 2015 10:10:16 +0000 (UTC) Received: by lbcli1 with SMTP id li1sf3619918lbc.2 for ; Mon, 10 Aug 2015 03:10:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=cR5XVh7UbyI/28zW4zPYgS9YiJ4TNXRX0pl7pCYlFMo=; b=IM5bC0OFZKtQy1cjbU4/O/atE2Hr8NeHoLGor+q12qjzmBS+7ORCGU6A7YJrxCxhjs g+J0NLXAaj8E7qFAvjYUiGqhONEdjSslYYEpz5qDWV2Rjy0SLQEqMJAW+VHTz599ZWCP V0p7D6Iz4PmTUSGDCZg8hg9Yl/jO5qrAQlw4yMGeedYcfV/V5XMzVXS/ka4jtg47VUjz TuKVMdgkqxAHJ0KCxJY6VtnxiG9NCIZwpJ07TCpnlsphzJe0wzY42l9y0ft3bPNwrZdD UKuxt9PX1T9QwhgEpK8WMnEq3MB0Mw05B9v7ba79MypBfPCXLu4DgAVzR+WqwpbONy5t Na6Q== X-Gm-Message-State: ALoCoQmFKd4Ub3X0TSb+4HZQEFyGnjoqSW6qc5ahHehrVU5P8LNZ+qiLXc583ZkKFRUQiGooI9PK X-Received: by 10.112.173.230 with SMTP id bn6mr6077087lbc.15.1439201415597; Mon, 10 Aug 2015 03:10:15 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.2 with SMTP id s2ls637239lal.86.gmail; Mon, 10 Aug 2015 03:10:15 -0700 (PDT) X-Received: by 10.112.67.65 with SMTP id l1mr9192729lbt.86.1439201415441; Mon, 10 Aug 2015 03:10:15 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id t18si13727667laz.137.2015.08.10.03.10.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 03:10:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbpu9 with SMTP id pu9so64744864lbb.3 for ; Mon, 10 Aug 2015 03:10:15 -0700 (PDT) X-Received: by 10.152.88.78 with SMTP id be14mr19329562lab.29.1439201415226; Mon, 10 Aug 2015 03:10:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1835729lba; Mon, 10 Aug 2015 03:10:14 -0700 (PDT) X-Received: by 10.55.41.208 with SMTP id p77mr1944217qkp.108.1439201410236; Mon, 10 Aug 2015 03:10:10 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y110si7316782qgd.42.2015.08.10.03.10.09; Mon, 10 Aug 2015 03:10:10 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 397EF61D7F; Mon, 10 Aug 2015 10:10:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 15EF461B38; Mon, 10 Aug 2015 10:10:03 +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 4CCF261095; Mon, 10 Aug 2015 10:09:58 +0000 (UTC) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by lists.linaro.org (Postfix) with ESMTPS id 22FD961D73 for ; Mon, 10 Aug 2015 10:09:57 +0000 (UTC) Received: by lahi9 with SMTP id i9so20469630lah.2 for ; Mon, 10 Aug 2015 03:09:56 -0700 (PDT) X-Received: by 10.152.42.209 with SMTP id q17mr19429807lal.33.1439201396105; Mon, 10 Aug 2015 03:09:56 -0700 (PDT) Received: from localhost (c-b03670d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.54.176]) by smtp.gmail.com with ESMTPSA id 6sm4130905lai.27.2015.08.10.03.09.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 03:09:54 -0700 (PDT) From: Anders Roxell To: lng-odp@lists.linaro.org Date: Mon, 10 Aug 2015 12:07:25 +0200 Message-Id: <1439201248-12253-2-git-send-email-anders.roxell@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1439201248-12253-1-git-send-email-anders.roxell@linaro.org> References: <1439201248-12253-1-git-send-email-anders.roxell@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 1/4] scripts/git_hash: fix build from tar source X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: anders.roxell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Anders Roxell --- .gitignore | 1 + platform/Makefile.inc | 2 +- scripts/Makefile.am | 2 +- scripts/git_hash.sh | 18 ++++++++++++++---- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index f534808..b4c146b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ .deps/ .dirstamp .libs/ +.scmversion CUnit-Memory-Dump.xml ID Makefile diff --git a/platform/Makefile.inc b/platform/Makefile.inc index f64e37c..8e8e97b 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` +GIT_DESC = `$(top_srcdir)/scripts/git_hash.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..431e537 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1 +1 @@ -EXTRA_DIST = git_hash.sh odp_version.sh +EXTRA_DIST = git_hash.sh odp_version.sh ../.scmversion diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh index c9f1faf..48ae24e 100755 --- a/scripts/git_hash.sh +++ b/scripts/git_hash.sh @@ -1,9 +1,19 @@ #!/bin/bash +if [ -z ${1} ]; then + echo "should be called with a path" + exit +fi +ROOTDIR=${1} + repo=https://git.linaro.org/lng/odp.git -hash=$(git describe | tr -d "\n") -if git diff-index --name-only HEAD &>/dev/null ; then - dirty=-dirty +if [ -d ${ROOTDIR}/.git ]; then + hash=$(git describe | tr -d "\n") + if git diff-index --name-only HEAD &>/dev/null ; then + dirty=-dirty + fi + + echo -n "'${repo}' (${hash}${dirty})">${ROOTDIR}/.scmversion fi -echo -n "'${repo}' (${hash}${dirty})" +cat ${ROOTDIR}/.scmversion