commit:     f251acb661ae11a7e25d66082f45d994fdc2f0e5
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 28 14:01:53 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Nov 28 14:01:53 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f251acb6

sys-libs/libcap: clean up patches

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-libs/libcap/files/libcap-2.61-Wformat.patch | 25 +++++++++++++++++++++++++
 sys-libs/libcap/files/libcap-2.61-no_perl.patch | 13 ++++---------
 sys-libs/libcap/libcap-2.61.ebuild              |  1 +
 3 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/sys-libs/libcap/files/libcap-2.61-Wformat.patch 
b/sys-libs/libcap/files/libcap-2.61-Wformat.patch
new file mode 100644
index 000000000000..e0046de58770
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.61-Wformat.patch
@@ -0,0 +1,25 @@
+From 9fd3e7ac5870f84c73ac777d9a14480227ad7f00 Mon Sep 17 00:00:00 2001
+From: David Seifert <[email protected]>
+Date: Sun, 28 Nov 2021 14:14:42 +0100
+Subject: [PATCH] Fix `-Wformat` on 32-bit platforms
+
+---
+ libcap/cap_test.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libcap/cap_test.c b/libcap/cap_test.c
+index b7fb2c5..39df261 100644
+--- a/libcap/cap_test.c
++++ b/libcap/cap_test.c
+@@ -124,7 +124,7 @@ static int test_short_bits(void)
+     }
+     if (strlen(tmp) > __CAP_NAME_SIZE) {
+       printf("cap_to_text buffer size reservation needs fixing (%ld > %d)\n",
+-             strlen(tmp), __CAP_NAME_SIZE);
++             (long int)strlen(tmp), __CAP_NAME_SIZE);
+       result = -1;
+     }
+     free(tmp);
+-- 
+2.34.1
+

diff --git a/sys-libs/libcap/files/libcap-2.61-no_perl.patch 
b/sys-libs/libcap/files/libcap-2.61-no_perl.patch
index deda35db8e31..3d42a4dc6135 100644
--- a/sys-libs/libcap/files/libcap-2.61-no_perl.patch
+++ b/sys-libs/libcap/files/libcap-2.61-no_perl.patch
@@ -25,7 +25,7 @@ Signed-off-by: Lars Wendler <[email protected]>
  
  # The linker magic needed to build a dynamic library as independently
  # executable
-@@ -82,17 +84,27 @@
+@@ -82,8 +84,18 @@
        ./_makenames > cap_names.h
  
  $(GPERF_OUTPUT): cap_names.list.h
@@ -44,19 +44,14 @@ Signed-off-by: Lars Wendler <[email protected]>
 +              --lookup-function-name="__cap_lookup_name" \
 +              -c -t -m20 $(INDENT) > $@
  
--# Intention is that libcap keeps up with torvalds' tree, as reflected
--# by this maintained version of the kernel header. libcap dynamically
--# trims the meaning of "all" capabilities down to that of the running
--# kernel as of 2.30.
+ # Intention is that libcap keeps up with torvalds' tree, as reflected
+ # by this maintained version of the kernel header. libcap dynamically
+@@ -92,7 +104,7 @@
  UAPI_HEADER := $(topdir)/libcap/include/uapi/linux/capability.h
  cap_names.list.h: Makefile $(UAPI_HEADER)
        @echo "=> making $@ from $(UAPI_HEADER)"
 -      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 > $@
 +      $(AWK) '($$0 ~ 
/^#define[[:space:]]+CAP[_A-Z]+[[:space:]]+[0-9]+[[:space:]]*$$/) { printf 
"{\"%s\",%s},\n", tolower($$2), $$3 }' $(UAPI_HEADER) > $@
-+
-+cap_names.list.h: $(KERNEL_HEADERS)/linux/capability.h Makefile
-+      @echo "=> making $@ from $<"
-+      $(AWK) '($$0 ~ 
/^#define[[:space:]]+CAP[_A-Z]+[[:space:]]+[0-9]+[[:space:]]*$$/) { printf 
"{\"%s\",%s},\n", tolower($$2), $$3 }' $< > $@
  
  $(STACAPLIBNAME): $(CAPOBJS)
        $(AR) rcs $@ $^

diff --git a/sys-libs/libcap/libcap-2.61.ebuild 
b/sys-libs/libcap/libcap-2.61.ebuild
index d7182a35dc5b..28b28501b9d6 100644
--- a/sys-libs/libcap/libcap-2.61.ebuild
+++ b/sys-libs/libcap/libcap-2.61.ebuild
@@ -27,6 +27,7 @@ BDEPEND="
 PATCHES=(
        "${FILESDIR}"/${PN}-2.61-no_perl.patch
        "${FILESDIR}"/${PN}-2.61-ignore-RAISE_SETFCAP-install-failures.patch
+       "${FILESDIR}"/${PN}-2.61-Wformat.patch
 )
 
 QA_FLAGS_IGNORED="sbin/captree" # go binaries don't use LDFLAGS

Reply via email to