From patchwork Fri Aug 14 13:25:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 52436 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 87ED72031F for ; Fri, 14 Aug 2015 13:28:53 +0000 (UTC) Received: by wicul11 with SMTP id ul11sf6448182wic.1 for ; Fri, 14 Aug 2015 06:28:52 -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=IcmpREK9W3n1hWph5jAdoMPEa1jdOIEt8SzqZFjh1vU/ctOx2azuzbm7d7mdQgtExW qzV6LzU5ASqy7iQCoq0d6baUPHqm/V+c/XsqxIicYDkc8mobt+MLf6ES9wwMcWkIzi2e Utr573+Nmtu5cRsXf3HF0vJzCaMiB3XqciZwWkMazIhFmf1+NzG1XOQlUaDNUrrezJ/N opG0ce0GiVTiQGjr8Y6GCjykIUGEeVF3GPxiYf3BVBKOuE6byiNIOLwEfJvO7PHWGFtP QdYfuMIp/9+25VxFLZKyroXSSSRaFMfT+zq+33SsoQ5excL1eEdtae13DgO63S5uW0vU s5rQ== X-Gm-Message-State: ALoCoQmvhS4k0AR+qVc2jU2R4Mg6qn6bJvo57NpZiyXLYFWAUFkjwGZTJWr6MUBHpkId7xYT0cIB X-Received: by 10.180.75.49 with SMTP id z17mr980734wiv.7.1439558932908; Fri, 14 Aug 2015 06:28:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.41 with SMTP id u9ls328124laz.58.gmail; Fri, 14 Aug 2015 06:28:52 -0700 (PDT) X-Received: by 10.152.20.196 with SMTP id p4mr43974492lae.121.1439558932735; Fri, 14 Aug 2015 06:28:52 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id ue8si5992876lac.10.2015.08.14.06.28.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Aug 2015 06:28:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbpu9 with SMTP id pu9so45512600lbb.3 for ; Fri, 14 Aug 2015 06:28:52 -0700 (PDT) X-Received: by 10.152.28.193 with SMTP id d1mr30411725lah.72.1439558932613; Fri, 14 Aug 2015 06:28:52 -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 l6csp1622019lba; Fri, 14 Aug 2015 06:28:51 -0700 (PDT) X-Received: by 10.55.50.74 with SMTP id y71mr67274107qky.52.1439558931183; Fri, 14 Aug 2015 06:28:51 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 62si9455497qht.63.2015.08.14.06.28.50; Fri, 14 Aug 2015 06:28:51 -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 0C08E61F04; Fri, 14 Aug 2015 13:28:50 +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_H2, 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 0889261F0D; Fri, 14 Aug 2015 13:28:14 +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 7996A61EFC; Fri, 14 Aug 2015 13:28:11 +0000 (UTC) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com [209.85.217.175]) by lists.linaro.org (Postfix) with ESMTPS id 7D43D61EF1 for ; Fri, 14 Aug 2015 13:27:45 +0000 (UTC) Received: by lbbsx3 with SMTP id sx3so45481112lbb.0 for ; Fri, 14 Aug 2015 06:27:44 -0700 (PDT) X-Received: by 10.112.185.66 with SMTP id fa2mr44526583lbc.42.1439558864447; Fri, 14 Aug 2015 06:27:44 -0700 (PDT) Received: from localhost (c-b03670d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.54.176]) by smtp.gmail.com with ESMTPSA id qc7sm1469780lbb.2.2015.08.14.06.27.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Aug 2015 06:27:43 -0700 (PDT) From: Anders Roxell To: lng-odp@lists.linaro.org Date: Fri, 14 Aug 2015 15:25:05 +0200 Message-Id: <1439558708-31151-2-git-send-email-anders.roxell@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1439558708-31151-1-git-send-email-anders.roxell@linaro.org> References: <1439558708-31151-1-git-send-email-anders.roxell@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 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.181 as permitted sender) smtp.mailfrom=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