From patchwork Mon May 9 16:58:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 9048161 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DF185BF29F for ; Mon, 9 May 2016 16:59:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0F8A2012D for ; Mon, 9 May 2016 16:59:42 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7FED220123 for ; Mon, 9 May 2016 16:59:41 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 705751A1E85; Mon, 9 May 2016 09:59:41 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by ml01.01.org (Postfix) with ESMTP id 73F0B1A1E85 for ; Mon, 9 May 2016 09:59:40 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 09 May 2016 09:59:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,601,1455004800"; d="scan'208";a="99950858" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.14]) by fmsmga004.fm.intel.com with ESMTP; 09 May 2016 09:59:40 -0700 Subject: [ndctl PATCH] ndctl: switch to ndctl-VERSION tag format From: Dan Williams To: linux-nvdimm@lists.01.org Date: Mon, 09 May 2016 09:58:52 -0700 Message-ID: <146281313239.8759.6868284165112471255.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As Jeff notes, tarballs with names like v52.tar.gz are awful because they are not very descriptive. Switch to a 'package-version' format, i.e. ndctl-52.tar.gz. Reported-by: Jeff Moyer Signed-off-by: Dan Williams --- git-version | 25 +++++++++++++++---------- make-git-snapshot.sh | 4 ++-- ndctl.spec.in | 4 ++-- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/git-version b/git-version index 629f6d4a213d..ea6e26880aea 100755 --- a/git-version +++ b/git-version @@ -1,15 +1,25 @@ #!/bin/bash +to_ver() { + VN=$1 + #drop leading 'ndctl-' out of the version so its a pure number + if [ ${VN:0:6} = "ndctl-" ]; then + VN=${VN:6} + fi + echo $VN +} + dirty() { + VN=$(to_ver $1) git update-index -q --refresh if test -z "$(git diff-index --name-only HEAD --)"; then - echo "$1" + echo "$VN" else - echo "${1}.dirty" + echo "${VN}.dirty" fi } -DEF_VER=v52 +DEF_VER=52 LF=' ' @@ -19,10 +29,10 @@ LF=' if test -f version; then VN=$(cat version) || VN="$DEF_VER" elif test -d ${GIT_DIR:-.git} -o -f .git && - VN=$(git describe --match "v[0-9]*" --abbrev=7 HEAD 2>/dev/null) && + VN=$(git describe --match "ndctl-[0-9]*" --abbrev=7 HEAD 2>/dev/null) && case "$VN" in *$LF*) (exit 1) ;; - v[0-9]*) + ndctl-[0-9]*) VN="$(dirty $VN)" esac; then VN=$(echo "$VN" | sed -e 's/-/./g'); @@ -33,9 +43,4 @@ EOF VN="$(dirty ${DEF_VER}.git$COMMIT)" fi -#drop leading 'v' out of the version so its a pure number -if [ ${VN:0:1} = v ]; then - VN=${VN:1} -fi - echo $VN diff --git a/make-git-snapshot.sh b/make-git-snapshot.sh index 2825ac4321cd..142419d623fe 100755 --- a/make-git-snapshot.sh +++ b/make-git-snapshot.sh @@ -16,6 +16,6 @@ git clone $REFERENCE "$UPSTREAM" "$WORKDIR" VERSION=$(./git-version) DIRNAME="ndctl-${VERSION}" -git archive --remote="$WORKDIR" --format=tar --prefix="$DIRNAME/" HEAD | gzip > $OUTDIR/"v${VERSION}.tar.gz" +git archive --remote="$WORKDIR" --format=tar --prefix="$DIRNAME/" HEAD | gzip > $OUTDIR/"ndctl-${VERSION}.tar.gz" -echo "Written $OUTDIR/v${VERSION}.tar.gz" +echo "Written $OUTDIR/ndctl-${VERSION}.tar.gz" diff --git a/ndctl.spec.in b/ndctl.spec.in index 0bdd2463698c..b8129e533e13 100644 --- a/ndctl.spec.in +++ b/ndctl.spec.in @@ -5,7 +5,7 @@ Summary: Manage "libnvdimm" subsystem devices (Non-volatile Memory) License: GPLv2 Group: System Environment/Base Url: https://github.com/pmem/ndctl -Source0: https://github.com/pmem/ndctl/archive/v%{version}.tar.gz +Source0: https://github.com/pmem/ndctl/archive/ndctl-%{version}.tar.gz BuildRequires: autoconf BuildRequires: asciidoc @@ -45,7 +45,7 @@ Group: System Environment/Libraries Libraries for %{name}. %prep -%setup -q v%{version} +%setup -q ndctl-%{version} %build echo "VERSION" > version