1 From: Debian ZFS on Linux maintainers
2 <pkg-zfsonlinux-devel@alioth-lists.debian.net>
3 Date: Wed, 30 Jan 2019 15:12:04 +0100
4 Subject: Check-for-META-and-DCH-consistency-in-autoconf
7 config/zfs-meta.m4 | 34 +++++++++++++++++++++++++++++-----
8 1 file changed, 29 insertions(+), 5 deletions(-)
10 diff --git a/config/zfs-meta.m4 b/config/zfs-meta.m4
11 index 3e1429d..b8e26c4 100644
12 --- a/config/zfs-meta.m4
13 +++ b/config/zfs-meta.m4
17 -dnl # Read meta data from the META file. When building from a git repository
18 -dnl # the ZFS_META_RELEASE field will be overwritten if there is an annotated
19 -dnl # tag matching the form ZFS_META_NAME-ZFS_META_VERSION-*. This allows
20 -dnl # for working builds to be uniquely identified using the git commit hash.
21 +dnl # Read meta data from the META file or the debian/changelog file if it
22 +dnl # exists. When building from a git repository the ZFS_META_RELEASE field
23 +dnl # will be overwritten if there is an annotated tag matching the form
24 +dnl # ZFS_META_NAME-ZFS_META_VERSION-*. This allows for working builds to be
25 +dnl # uniquely identified using the git commit hash.
27 dnl # The META file format is as follows:
28 dnl # ^[ ]*KEY:[ \t]+VALUE$
29 @@ -49,6 +50,7 @@ AC_DEFUN([ZFS_AC_META], [
30 _zfs_ac_meta_type="none"
31 if test -f "$META"; then
32 _zfs_ac_meta_type="META file"
33 + _dpkg_parsechangelog=$(dpkg-parsechangelog 2>/dev/null)
35 ZFS_META_NAME=_ZFS_AC_META_GETVAL([(Name|Project|Package)]);
36 if test -n "$ZFS_META_NAME"; then
37 @@ -66,8 +68,30 @@ AC_DEFUN([ZFS_AC_META], [
38 AC_SUBST([ZFS_META_VERSION])
41 + if test -n "${_dpkg_parsechangelog}"; then
42 + _dpkg_version=$(echo "${_dpkg_parsechangelog}" \
43 + | $AWK '$[]1 == "Version:" { print $[]2; }' \
45 + if test "${_dpkg_version}" != "$ZFS_META_VERSION"; then
47 + *** Version $ZFS_META_VERSION in the META file is different than
48 + *** version $_dpkg_version in the debian/changelog file. DKMS and DEB
49 + *** packaging require that these files have the same version.
54 ZFS_META_RELEASE=_ZFS_AC_META_GETVAL([Release]);
55 - if test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then
57 + if test -n "${_dpkg_parsechangelog}"; then
58 + _dpkg_release=$(echo "${_dpkg_parsechangelog}" \
59 + | $AWK '$[]1 == "Version:" { print $[]2; }' \
61 + if test -n "${_dpkg_release}"; then
62 + ZFS_META_RELEASE=${_dpkg_release}
63 + _zfs_ac_meta_type="dpkg-parsechangelog"
65 + elif test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then
66 _match="${ZFS_META_NAME}-${ZFS_META_VERSION}"
67 _alias=$(git describe --match=${_match} 2>/dev/null)
68 _release=$(echo ${_alias}|cut -f3- -d'-'|sed 's/-/_/g')