1 |
commit: 357fcdc0bb7ce13203fb9c55bfe8241475582f88 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Apr 30 19:06:46 2021 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Apr 30 19:12:05 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=357fcdc0 |
7 |
|
8 |
sys-fs/zfs: add soversion check function to live ebuild |
9 |
|
10 |
Package-Manager: Portage-3.0.18, Repoman-3.0.3 |
11 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
12 |
|
13 |
sys-fs/zfs/zfs-9999.ebuild | 26 ++++++++++++++++++++++++++ |
14 |
1 file changed, 26 insertions(+) |
15 |
|
16 |
diff --git a/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-9999.ebuild |
17 |
index aefa5901450..4292b09c839 100644 |
18 |
--- a/sys-fs/zfs/zfs-9999.ebuild |
19 |
+++ b/sys-fs/zfs/zfs-9999.ebuild |
20 |
@@ -31,6 +31,7 @@ fi |
21 |
LICENSE="BSD-2 CDDL MIT" |
22 |
# just libzfs soname major for now. |
23 |
# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. |
24 |
+# see libsoversion_check() below as well |
25 |
SLOT="0/5" |
26 |
IUSE="custom-cflags debug kernel-builtin minimal nls pam python +rootfs test-suite static-libs" |
27 |
|
28 |
@@ -111,8 +112,33 @@ pkg_setup() { |
29 |
fi |
30 |
} |
31 |
|
32 |
+libsoversion_check() { |
33 |
+ |
34 |
+ local bugurl libzfs_sover |
35 |
+ bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" |
36 |
+ |
37 |
+ libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ |
38 |
+ | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" |
39 |
+ libzfs_sover="${libzfs_sover%%:*}" |
40 |
+ |
41 |
+ if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then |
42 |
+ echo |
43 |
+ eerror "BUG BUG BUG BUG BUG BUG BUG BUG" |
44 |
+ eerror "ebuild subslot does not match libzfs soversion!" |
45 |
+ eerror "libzfs soversion: ${libzfs_sover}" |
46 |
+ eerror "ebuild value: $(ver_cut 2 ${SLOT})" |
47 |
+ eerror "This is a bug in the ebuild, please use the following URL to report it" |
48 |
+ eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" |
49 |
+ echo |
50 |
+ # we want to abort for releases, but just print a warning for live ebuild |
51 |
+ # to keep package installable |
52 |
+ [[ ${PV} == "9999" ]] || die |
53 |
+ fi |
54 |
+} |
55 |
+ |
56 |
src_prepare() { |
57 |
default |
58 |
+ libsoversion_check |
59 |
|
60 |
if [[ ${PV} == "9999" ]]; then |
61 |
eautoreconf |