]> git.proxmox.com Git - mirror_zfs-debian.git/blame - debian/patches/0002-Check-for-META-and-DCH-consistency-in-autoconf.patch
Break/Replace upstream debs
[mirror_zfs-debian.git] / debian / patches / 0002-Check-for-META-and-DCH-consistency-in-autoconf.patch
CommitLineData
2d1f32d8
AX
1Index: zfs-linux-0.6.5.3/config/zfs-meta.m4
2===================================================================
3--- zfs-linux-0.6.5.3.orig/config/zfs-meta.m4 2015-10-27 14:33:15.636599881 -0600
4+++ zfs-linux-0.6.5.3/config/zfs-meta.m4 2015-10-27 14:33:37.996600435 -0600
5@@ -1,9 +1,10 @@
6 dnl #
7 dnl # DESCRIPTION:
8-dnl # Read meta data from the META file. When building from a git repository
9-dnl # the ZFS_META_RELEASE field will be overwritten if there is an annotated
10-dnl # tag matching the form ZFS_META_NAME-ZFS_META_VERSION-*. This allows
11-dnl # for working builds to be uniquely identified using the git commit hash.
12+dnl # Read meta data from the META file or the debian/changelog file if it
13+dnl # exists. When building from a git repository the ZFS_META_RELEASE field
14+dnl # will be overwritten if there is an annotated tag matching the form
15+dnl # ZFS_META_NAME-ZFS_META_VERSION-*. This allows for working builds to be
16+dnl # uniquely identified using the git commit hash.
17 dnl #
18 dnl # The META file format is as follows:
19 dnl # ^[ ]*KEY:[ \t]+VALUE$
20@@ -49,6 +50,7 @@
21 _zfs_ac_meta_type="none"
22 if test -f "$META"; then
23 _zfs_ac_meta_type="META file"
24+ _dpkg_parsechangelog=$(dpkg-parsechangelog 2>/dev/null)
25
26 ZFS_META_NAME=_ZFS_AC_META_GETVAL([(Name|Project|Package)]);
27 if test -n "$ZFS_META_NAME"; then
28@@ -66,8 +68,30 @@
29 AC_SUBST([ZFS_META_VERSION])
30 fi
31
32+ if test -n "${_dpkg_parsechangelog}"; then
33+ _dpkg_version=$(echo "${_dpkg_parsechangelog}" \
34+ | $AWK '$[]1 == "Version:" { print $[]2; }' \
35+ | cut -d- -f1)
36+ if test "${_dpkg_version}" != "$ZFS_META_VERSION"; then
37+ AC_MSG_ERROR([
38+ *** Version $ZFS_META_VERSION in the META file is different than
39+ *** version $_dpkg_version in the debian/changelog file. DKMS and DEB
40+ *** packaging require that these files have the same version.
41+ ])
42+ fi
43+ fi
44+
45 ZFS_META_RELEASE=_ZFS_AC_META_GETVAL([Release]);
46- if test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then
47+
48+ if test -n "${_dpkg_parsechangelog}"; then
49+ _dpkg_release=$(echo "${_dpkg_parsechangelog}" \
50+ | $AWK '$[]1 == "Version:" { print $[]2; }' \
51+ | cut -d- -f2-)
52+ if test -n "${_dpkg_release}"; then
53+ ZFS_META_RELEASE=${_dpkg_release}
54+ _zfs_ac_meta_type="dpkg-parsechangelog"
55+ fi
56+ elif test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then
57 _match="${ZFS_META_NAME}-${ZFS_META_VERSION}"
58 _alias=$(git describe --match=${_match} 2>/dev/null)
59 _release=$(echo ${_alias}|cut -f3- -d'-'|sed 's/-/_/g')