]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
scripts: use dot as a separator for pre-release versions
authorTomas Krizek <tomas.krizek@nic.cz>
Mon, 19 Feb 2018 09:49:01 +0000 (10:49 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 27 Feb 2018 16:50:21 +0000 (17:50 +0100)
To be able to use the exact same version in both upstream tarballs
and downstream packages always use dot as a version separator.

This enables downstream packages to re-use the upstream versions
(especially the pre-release ones which no longer contain dash) when
building packages. This is very useful for building testing packages
e.g. in Fedora and Arch, which do not allow dash in version number.

Tags should follow this format from now on as well, e.g. 2.99.0.alpha
instead of 2.99.0-alpha

distro/fedora/knot-resolver.spec
scripts/make-spec.sh
scripts/show-version.sh

index 2d228a12819f3d91767e8976b4f432c06cff024e..83c4aceb2aae3a32b70a4e0ff59e70facb04111c 100644 (file)
@@ -2,18 +2,16 @@
 
 %define GPG_CHECK 0
 %define VERSION DYNAMIC
-# comment out this define using #%% if it is not a pre-release version
-#%% define PRERELEASE
-%define repodir %{_builddir}/%{name}-%{version}%{?PRERELEASE:-}%{?PRERELEASE}
+%define repodir %{_builddir}/%{name}-%{version}
 
 Name:           knot-resolver
 Version:        %{VERSION}
-Release:        %{?PRERELEASE}%{?PRERELEASE:.}1%{?dist}
+Release:        1%{?dist}
 Summary:        Caching full DNS Resolver
 
 License:        GPLv3
 URL:            https://www.knot-resolver.cz/
-Source0:        knot-resolver-%{version}%{?PRERELEASE:-}%{?PRERELEASE}.tar.xz
+Source0:        knot-resolver-%{version}.tar.xz
 
 # LuaJIT only on these arches
 %if 0%{?rhel}
@@ -27,7 +25,7 @@ Source2:        kresd.conf
 Source3:        root.keys
 
 %if 0%{GPG_CHECK}
-Source1:        knot-resolver-%{version}%{?PRERELEASE:-}%{?PRERELEASE}.tar.xz.asc
+Source1:        knot-resolver-%{version}.tar.xz.asc
 # PGP keys used to sign upstream releases
 # Export with --armor using command from https://fedoraproject.org/wiki/PackagingDrafts:GPGSignatures
 # Don't forget to update %%prep section when adding/removing keys
@@ -112,7 +110,7 @@ mkdir ${GNUPGHOME}
 gpg2 --import %{SOURCE100} %{SOURCE101} %{SOURCE102}
 gpg2 --verify %{SOURCE1} %{SOURCE0}
 %endif
-%setup -q -n %{name}-%{version}%{?PRERELEASE:-}%{?PRERELEASE}
+%setup -q -n %{name}-%{version}
 
 rm -v scripts/bootstrap-depends.sh
 
index 1c6c54bf4bc1efebf0463d6505c2d3c236dfd69c..cf0a01729c1eb857f7e88923630ba8e151ad691b 100755 (executable)
@@ -1,11 +1,7 @@
 #!/bin/bash -e
 
-# Fill in VERSION and PRERELEASE fields in Fedora spec file
+# Fill in VERSION field in Fedora spec file
 
 cd "$(git rev-parse --show-toplevel)"
-VERSION=$(scripts/show-version.sh | sed 's/knot-resolver-\(.*\).tar.xz/\1/' | cut -f1 -d '-')
-PRERELEASE=$(scripts/show-version.sh | sed 's/knot-resolver-\(.*\).tar.xz/\1/' | cut -f1 -d '-' --complement -s)
+VERSION=$(scripts/show-version.sh | sed 's/knot-resolver-\(.*\).tar.xz/\1/')
 sed -i.bak "s@%define VERSION .*@%define VERSION $VERSION@" distro/fedora/knot-resolver.spec
-if [ -n "$PRERELEASE" ]; then
-       sed -i "s@#%% define PRERELEASE .*@%define PRERELEASE $PRERELEASE@" distro/fedora/knot-resolver.spec
-fi
index 565b2d869fee31268905e075827e0ec02ffce810..36eafcd34f604bff27f654db36d40638064cd6d9 100755 (executable)
@@ -1,2 +1,2 @@
 #!/bin/bash -e
-git describe | sed 's/^v//' | sed 's/-\(g[0-9a-f]\+\)/\.\1/'
+git describe | sed 's/^v//' | sed 's/-/\./g'