commit:     e266e13009ebe1786bb496bc346dd5b6a2ca947e
Author:     Oliver Freyermuth <o.freyermuth <AT> googlemail <DOT> com>
AuthorDate: Sat Jan 28 20:43:36 2023 +0000
Commit:     Nicolas Bock <nicolasbock <AT> gentoo <DOT> org>
CommitDate: Mon Jan 30 21:58:18 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e266e130

sys-cluster/charliecloud: multiple fixes

- backport patch for readpath from recent glibc [1, 2]
- drop 0.31
- do not compress installed examples

[1] https://github.com/hpc/charliecloud/pull/1550
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1916968

Closes: https://github.com/gentoo/gentoo/pull/29323
Signed-off-by: Oliver Freyermuth <o.freyermuth <AT> googlemail.com>
Signed-off-by: Nicolas Bock <nicolasbock <AT> gentoo.org>

 ...oud-0.31.ebuild => charliecloud-0.31-r1.ebuild} |  9 ++++++
 sys-cluster/charliecloud/charliecloud-9999.ebuild  |  5 ++++
 .../files/charliecloud-0.31-realpath_return.patch  | 32 ++++++++++++++++++++++
 3 files changed, 46 insertions(+)

diff --git a/sys-cluster/charliecloud/charliecloud-0.31.ebuild 
b/sys-cluster/charliecloud/charliecloud-0.31-r1.ebuild
similarity index 94%
rename from sys-cluster/charliecloud/charliecloud-0.31.ebuild
rename to sys-cluster/charliecloud/charliecloud-0.31-r1.ebuild
index db6df71719a9..2efd4a83f907 100644
--- a/sys-cluster/charliecloud/charliecloud-0.31.ebuild
+++ b/sys-cluster/charliecloud/charliecloud-0.31-r1.ebuild
@@ -48,6 +48,10 @@ DEPEND="
                net-misc/rsync
        )"
 
+PATCHES=(
+       "${FILESDIR}"/${P}-realpath_return.patch
+)
+
 src_prepare() {
        default
        eautoreconf
@@ -72,6 +76,11 @@ src_configure() {
        econf "${econf_args[@]}"
 }
 
+src_install() {
+       docompress -x "${EPREFIX}"/usr/share/doc/"${PF}"/examples
+       default
+}
+
 pkg_postinst() {
        elog "Various builders are supported, as alternative to the internal 
ch-image."
        optfeature "Building with Buildah" app-containers/buildah

diff --git a/sys-cluster/charliecloud/charliecloud-9999.ebuild 
b/sys-cluster/charliecloud/charliecloud-9999.ebuild
index db6df71719a9..3e5a83f42d7e 100644
--- a/sys-cluster/charliecloud/charliecloud-9999.ebuild
+++ b/sys-cluster/charliecloud/charliecloud-9999.ebuild
@@ -72,6 +72,11 @@ src_configure() {
        econf "${econf_args[@]}"
 }
 
+src_install() {
+       docompress -x "${EPREFIX}"/usr/share/doc/"${PF}"/examples
+       default
+}
+
 pkg_postinst() {
        elog "Various builders are supported, as alternative to the internal 
ch-image."
        optfeature "Building with Buildah" app-containers/buildah

diff --git 
a/sys-cluster/charliecloud/files/charliecloud-0.31-realpath_return.patch 
b/sys-cluster/charliecloud/files/charliecloud-0.31-realpath_return.patch
new file mode 100644
index 000000000000..7b320fa9dbab
--- /dev/null
+++ b/sys-cluster/charliecloud/files/charliecloud-0.31-realpath_return.patch
@@ -0,0 +1,32 @@
+From e6d25474fcd326ae657c08d7b49606aeabc98b51 Mon Sep 17 00:00:00 2001
+From: Oliver Freyermuth <[email protected]>
+Date: Sat, 28 Jan 2023 21:25:09 +0100
+Subject: [PATCH] ch-misc: Do not check errno in realpath_ unless realpath
+ returns NULL
+Bug: https://github.com/hpc/charliecloud/pull/1550
+
+glibc's realpath may set errno also on success, as POSIX specifies
+errno should only be checked after realpath if the return value is not NULL.
+
+See for example:
+ https://bugzilla.redhat.com/show_bug.cgi?id=1916968
+---
+ bin/ch_misc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/bin/ch_misc.c b/bin/ch_misc.c
+index 04ac52a..93a3339 100644
+--- a/bin/ch_misc.c
++++ b/bin/ch_misc.c
+@@ -589,7 +589,7 @@ char *realpath_(const char *path, bool fail_ok)
+    errno = 0;
+    pathc = realpath(path, NULL);
+ 
+-   if (errno != 0) {
++   if (pathc == NULL && errno != 0) {
+       if (fail_ok) {
+          T_ (pathc = strdup(path));
+       } else {
+-- 
+2.39.1
+

Reply via email to