diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-01-02 00:29:42 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-07 12:24:57 +0000 |
commit | f99f55259dc73b5a6f8b061deb8987c3bec2104c (patch) | |
tree | ac8b9cc042f24113266c0f74d705c4e1e72c4ab1 /meta | |
parent | 992d59564b84333740e6465ec696238274b73938 (diff) | |
download | poky-f99f55259dc73b5a6f8b061deb8987c3bec2104c.tar.gz |
rpm: Fix build with musl
(From OE-Core rev: cd610101dc8fcb0cabe351085d36823c5bd7eb19)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
3 files changed, 68 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/files/0001-Duplicate-filename-before-passing-it-to-basename.patch b/meta/recipes-devtools/rpm/files/0001-Duplicate-filename-before-passing-it-to-basename.patch new file mode 100644 index 0000000000..f9b809d167 --- /dev/null +++ b/meta/recipes-devtools/rpm/files/0001-Duplicate-filename-before-passing-it-to-basename.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 3fa2ae78db9b31edb4c22f3b5cd36c6c972947f1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Florian Festi <ffesti@redhat.com> | ||
3 | Date: Wed, 26 Jul 2023 15:01:35 +0200 | ||
4 | Subject: [PATCH] Duplicate filename before passing it to basename | ||
5 | |||
6 | basename is allowed change the string passed to it. While we don't need | ||
7 | the filename after that just casting away the const seems a bit too | ||
8 | hacky. | ||
9 | |||
10 | Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/3fa2ae78db9b31edb4c22f3b5cd36c6c972947f1] | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | tools/rpmuncompress.c | 4 +++- | ||
14 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/tools/rpmuncompress.c b/tools/rpmuncompress.c | ||
17 | index 58ddf5683..e13cc6a66 100644 | ||
18 | --- a/tools/rpmuncompress.c | ||
19 | +++ b/tools/rpmuncompress.c | ||
20 | @@ -98,7 +98,8 @@ static char *doUntar(const char *fn) | ||
21 | if (needtar) { | ||
22 | rasprintf(&buf, "%s '%s' | %s %s -", zipper, fn, tar, taropts); | ||
23 | } else if (at->compressed == COMPRESSED_GEM) { | ||
24 | - const char *bn = basename(fn); | ||
25 | + char *tmp = xstrdup(fn); | ||
26 | + const char *bn = basename(tmp); | ||
27 | size_t nvlen = strlen(bn) - 3; | ||
28 | char *gem = rpmGetPath("%{__gem}", NULL); | ||
29 | char *gemspec = NULL; | ||
30 | @@ -112,6 +113,7 @@ static char *doUntar(const char *fn) | ||
31 | |||
32 | free(gemspec); | ||
33 | free(gem); | ||
34 | + free(tmp); | ||
35 | } else { | ||
36 | rasprintf(&buf, "%s '%s'", zipper, fn); | ||
37 | } | ||
38 | -- | ||
39 | 2.43.0 | ||
40 | |||
diff --git a/meta/recipes-devtools/rpm/files/0001-Fix-missing-basename-include-on-macOS.patch b/meta/recipes-devtools/rpm/files/0001-Fix-missing-basename-include-on-macOS.patch new file mode 100644 index 0000000000..a93597a835 --- /dev/null +++ b/meta/recipes-devtools/rpm/files/0001-Fix-missing-basename-include-on-macOS.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | From b2e67642fd8cb64d8cb1cca9e759396c1c10807d Mon Sep 17 00:00:00 2001 | ||
2 | From: Calvin Buckley <calvin@cmpct.info> | ||
3 | Date: Tue, 11 Jul 2023 19:22:41 -0300 | ||
4 | Subject: [PATCH] Fix missing basename include on macOS | ||
5 | |||
6 | Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/b2e67642fd8cb64d8cb1cca9e759396c1c10807d] | ||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | --- | ||
9 | tools/rpmuncompress.c | 1 + | ||
10 | 1 file changed, 1 insertion(+) | ||
11 | |||
12 | diff --git a/tools/rpmuncompress.c b/tools/rpmuncompress.c | ||
13 | index bd4146d54..58ddf5683 100644 | ||
14 | --- a/tools/rpmuncompress.c | ||
15 | +++ b/tools/rpmuncompress.c | ||
16 | @@ -1,6 +1,7 @@ | ||
17 | #include "system.h" | ||
18 | |||
19 | #include <popt.h> | ||
20 | +#include <libgen.h> | ||
21 | #include <errno.h> | ||
22 | #include <stdio.h> | ||
23 | #include <string.h> | ||
24 | -- | ||
25 | 2.43.0 | ||
26 | |||
diff --git a/meta/recipes-devtools/rpm/rpm_4.18.1.bb b/meta/recipes-devtools/rpm/rpm_4.18.1.bb index 95a9e92f96..3e85cbb8ef 100644 --- a/meta/recipes-devtools/rpm/rpm_4.18.1.bb +++ b/meta/recipes-devtools/rpm/rpm_4.18.1.bb | |||
@@ -40,6 +40,8 @@ SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.18.x;protoc | |||
40 | file://0001-python-Use-Py_hash_t-instead-of-long-in-hdr_hash.patch \ | 40 | file://0001-python-Use-Py_hash_t-instead-of-long-in-hdr_hash.patch \ |
41 | file://fix-declaration.patch \ | 41 | file://fix-declaration.patch \ |
42 | file://ea3187cfcf9cac87e5bc5e7db79b0338da9e355e.patch \ | 42 | file://ea3187cfcf9cac87e5bc5e7db79b0338da9e355e.patch \ |
43 | file://0001-Duplicate-filename-before-passing-it-to-basename.patch \ | ||
44 | file://0001-Fix-missing-basename-include-on-macOS.patch \ | ||
43 | " | 45 | " |
44 | 46 | ||
45 | PE = "1" | 47 | PE = "1" |