From: Tomas Krizek Date: Mon, 19 Feb 2018 09:49:01 +0000 (+0100) Subject: scripts: use dot as a separator for pre-release versions X-Git-Tag: v2.2.0~16^2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=846dddd50d069dee37ea8ec6db13196f1fcfa1d9;p=thirdparty%2Fknot-resolver.git scripts: use dot as a separator for pre-release versions 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 --- diff --git a/distro/fedora/knot-resolver.spec b/distro/fedora/knot-resolver.spec index 2d228a128..83c4aceb2 100644 --- a/distro/fedora/knot-resolver.spec +++ b/distro/fedora/knot-resolver.spec @@ -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 diff --git a/scripts/make-spec.sh b/scripts/make-spec.sh index 1c6c54bf4..cf0a01729 100755 --- a/scripts/make-spec.sh +++ b/scripts/make-spec.sh @@ -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 diff --git a/scripts/show-version.sh b/scripts/show-version.sh index 565b2d869..36eafcd34 100755 --- a/scripts/show-version.sh +++ b/scripts/show-version.sh @@ -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'