All of lore.kernel.org
 help / color / mirror / Atom feed
* [ndctl PATCH] ndctl: fix rpm source url, switch back to v$VERSION tag scheme
@ 2016-05-28 20:45 Dan Williams
  0 siblings, 0 replies; only message in thread
From: Dan Williams @ 2016-05-28 20:45 UTC (permalink / raw)
  To: linux-nvdimm

The way to have github generate tarballs in ndctl-$VERSION format while
maintaining a v$VERSION tag scheme is to use a source url in the
following format:

https://github.com/pmem/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 git-version   |   10 +++++-----
 ndctl.spec.in |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/git-version b/git-version
index 03b44a613a57..3823ee29afaf 100755
--- a/git-version
+++ b/git-version
@@ -2,9 +2,9 @@
 
 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}
+	#drop leading 'v' out of the version so its a pure number
+	if [ ${VN:0:1} = "v" ]; then
+			VN=${VN:1}
 	fi
 	echo $VN
 }
@@ -29,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 "ndctl-[0-9]*" --abbrev=7 HEAD 2>/dev/null) &&
+	VN=$(git describe --match "v[0-9]*" --abbrev=7 HEAD 2>/dev/null) &&
 	case "$VN" in
 	*$LF*) (exit 1) ;;
-	ndctl-[0-9]*)
+	v[0-9]*)
 		VN="$(dirty $VN)"
 	esac; then
 	VN=$(echo "$VN" | sed -e 's/-/./g');
diff --git a/ndctl.spec.in b/ndctl.spec.in
index 221cd755e2a6..0aaef03b2e5b 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/ndctl-%{version}.tar.gz
+Source0:	https://github.com/pmem/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 
 BuildRequires:	autoconf
 BuildRequires:	asciidoc

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-28 20:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-28 20:45 [ndctl PATCH] ndctl: fix rpm source url, switch back to v$VERSION tag scheme Dan Williams

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.