[Rpm-maint] [rpm-software-management/rpm] 4.19: GLOB_BRACE is not portable (Issue #2844)

Alexander Kanavin notifications at github.com
Tue Jan 16 10:41:42 UTC 2024


For completeness, we're going to patch rpm to ignore the braces if GLOB_BRACE is absent, and if failures occur on musl systems, then they would be separately fixed - so far none have been found:
```
>From f78e05544fb5ae9ef688963f19666f1af34c3d5c Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex at linutronix.de>
Date: Tue, 16 Jan 2024 09:59:26 +0100
Subject: [PATCH] rpmio/rpmglob.c: avoid using GLOB_BRACE if undefined by C
 library

This addresses musl failures; if there is code out there relying on
those braces, it needs to be fixed when used on musl.

This is unlikely to be trivially fixable upstream.

Upstream-Status: Inappropriate [reported at https://github.com/rpm-software-management/rpm/issues/2844]
Signed-off-by: Alexander Kanavin <alex at linutronix.de>
---
 rpmio/rpmglob.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/rpmio/rpmglob.c b/rpmio/rpmglob.c
index 243568766..43c27074a 100644
--- a/rpmio/rpmglob.c
+++ b/rpmio/rpmglob.c
@@ -33,6 +33,12 @@
 
 #include "debug.h"
 
+/* Don't fail if the standard C library
++ * doesn't provide brace expansion */
+#ifndef GLOB_BRACE
+#define GLOB_BRACE 0
+#endif
+
 /* Return 1 if pattern contains a magic char, see glob(7) for a list */
 static int ismagic(const char *pattern)
 {
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2844#issuecomment-1893487061
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/2844/1893487061 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240116/a14e23b3/attachment.html>


More information about the Rpm-maint mailing list