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