@@ -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
@@ -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"
@@ -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
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 <jmoyer@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- git-version | 25 +++++++++++++++---------- make-git-snapshot.sh | 4 ++-- ndctl.spec.in | 4 ++-- 3 files changed, 19 insertions(+), 14 deletions(-)