Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
Date: Sun, 28 Nov 2021 14:02:06
Message-Id: 1638108113.f251acb661ae11a7e25d66082f45d994fdc2f0e5.soap@gentoo
1 commit: f251acb661ae11a7e25d66082f45d994fdc2f0e5
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 28 14:01:53 2021 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 28 14:01:53 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f251acb6
7
8 sys-libs/libcap: clean up patches
9
10 Signed-off-by: David Seifert <soap <AT> gentoo.org>
11
12 sys-libs/libcap/files/libcap-2.61-Wformat.patch | 25 +++++++++++++++++++++++++
13 sys-libs/libcap/files/libcap-2.61-no_perl.patch | 13 ++++---------
14 sys-libs/libcap/libcap-2.61.ebuild | 1 +
15 3 files changed, 30 insertions(+), 9 deletions(-)
16
17 diff --git a/sys-libs/libcap/files/libcap-2.61-Wformat.patch b/sys-libs/libcap/files/libcap-2.61-Wformat.patch
18 new file mode 100644
19 index 000000000000..e0046de58770
20 --- /dev/null
21 +++ b/sys-libs/libcap/files/libcap-2.61-Wformat.patch
22 @@ -0,0 +1,25 @@
23 +From 9fd3e7ac5870f84c73ac777d9a14480227ad7f00 Mon Sep 17 00:00:00 2001
24 +From: David Seifert <soap@g.o>
25 +Date: Sun, 28 Nov 2021 14:14:42 +0100
26 +Subject: [PATCH] Fix `-Wformat` on 32-bit platforms
27 +
28 +---
29 + libcap/cap_test.c | 2 +-
30 + 1 file changed, 1 insertion(+), 1 deletion(-)
31 +
32 +diff --git a/libcap/cap_test.c b/libcap/cap_test.c
33 +index b7fb2c5..39df261 100644
34 +--- a/libcap/cap_test.c
35 ++++ b/libcap/cap_test.c
36 +@@ -124,7 +124,7 @@ static int test_short_bits(void)
37 + }
38 + if (strlen(tmp) > __CAP_NAME_SIZE) {
39 + printf("cap_to_text buffer size reservation needs fixing (%ld > %d)\n",
40 +- strlen(tmp), __CAP_NAME_SIZE);
41 ++ (long int)strlen(tmp), __CAP_NAME_SIZE);
42 + result = -1;
43 + }
44 + free(tmp);
45 +--
46 +2.34.1
47 +
48
49 diff --git a/sys-libs/libcap/files/libcap-2.61-no_perl.patch b/sys-libs/libcap/files/libcap-2.61-no_perl.patch
50 index deda35db8e31..3d42a4dc6135 100644
51 --- a/sys-libs/libcap/files/libcap-2.61-no_perl.patch
52 +++ b/sys-libs/libcap/files/libcap-2.61-no_perl.patch
53 @@ -25,7 +25,7 @@ Signed-off-by: Lars Wendler <polynomial-c@g.o>
54
55 # The linker magic needed to build a dynamic library as independently
56 # executable
57 -@@ -82,17 +84,27 @@
58 +@@ -82,8 +84,18 @@
59 ./_makenames > cap_names.h
60
61 $(GPERF_OUTPUT): cap_names.list.h
62 @@ -44,19 +44,14 @@ Signed-off-by: Lars Wendler <polynomial-c@g.o>
63 + --lookup-function-name="__cap_lookup_name" \
64 + -c -t -m20 $(INDENT) > $@
65
66 --# Intention is that libcap keeps up with torvalds' tree, as reflected
67 --# by this maintained version of the kernel header. libcap dynamically
68 --# trims the meaning of "all" capabilities down to that of the running
69 --# kernel as of 2.30.
70 + # Intention is that libcap keeps up with torvalds' tree, as reflected
71 + # by this maintained version of the kernel header. libcap dynamically
72 +@@ -92,7 +104,7 @@
73 UAPI_HEADER := $(topdir)/libcap/include/uapi/linux/capability.h
74 cap_names.list.h: Makefile $(UAPI_HEADER)
75 @echo "=> making $@ from $(UAPI_HEADER)"
76 - perl -e 'while ($$l=<>) { if ($$l =~ /^\#define[ \t](CAP[_A-Z]+)[ \t]+([0-9]+)\s+$$/) { $$tok=$$1; $$val=$$2; $$tok =~ tr/A-Z/a-z/; print "{\"$$tok\",$$val},\n"; } }' $(UAPI_HEADER) | fgrep -v 0x > $@
77 + $(AWK) '($$0 ~ /^#define[[:space:]]+CAP[_A-Z]+[[:space:]]+[0-9]+[[:space:]]*$$/) { printf "{\"%s\",%s},\n", tolower($$2), $$3 }' $(UAPI_HEADER) > $@
78 -+
79 -+cap_names.list.h: $(KERNEL_HEADERS)/linux/capability.h Makefile
80 -+ @echo "=> making $@ from $<"
81 -+ $(AWK) '($$0 ~ /^#define[[:space:]]+CAP[_A-Z]+[[:space:]]+[0-9]+[[:space:]]*$$/) { printf "{\"%s\",%s},\n", tolower($$2), $$3 }' $< > $@
82
83 $(STACAPLIBNAME): $(CAPOBJS)
84 $(AR) rcs $@ $^
85
86 diff --git a/sys-libs/libcap/libcap-2.61.ebuild b/sys-libs/libcap/libcap-2.61.ebuild
87 index d7182a35dc5b..28b28501b9d6 100644
88 --- a/sys-libs/libcap/libcap-2.61.ebuild
89 +++ b/sys-libs/libcap/libcap-2.61.ebuild
90 @@ -27,6 +27,7 @@ BDEPEND="
91 PATCHES=(
92 "${FILESDIR}"/${PN}-2.61-no_perl.patch
93 "${FILESDIR}"/${PN}-2.61-ignore-RAISE_SETFCAP-install-failures.patch
94 + "${FILESDIR}"/${PN}-2.61-Wformat.patch
95 )
96
97 QA_FLAGS_IGNORED="sbin/captree" # go binaries don't use LDFLAGS