From 08e0ad8f78ec22885cd488a55f869b97aa85fb6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 22 Feb 2022 16:43:17 +0100 Subject: [PATCH] Rewrite scriptlets to call /sbin/ldconfig in lua MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The scriptlet in glibc adds a dependency on bash to glibc-common, which is required by glibc, so effectively the whole world depends on bash. By rewriting the script in lua we drop this dependency, and also to avoid a (bogus?) warning from rpm about a dependency loop. If the call fails, an error is printed but the transaction is not failed. (The original script didn't have "|| :", so the return value from /sbin/ldconfig would be the return value from the script, causing the transaction to fail.) Quoting https://bugzilla.redhat.com/show_bug.cgi?id=2018913#c34: warning: SCC #1: 5 members (5 external dependencies) warning: glibc-2.35-2.fc37.x86_64 warning: -> glibc-minimal-langpack-2.35-2.fc37.x86_64 warning: -> glibc-common-2.35-2.fc37.x86_64 warning: ncurses-libs-6.2-9.20210508.fc36.x86_64 warning: -> glibc-2.35-2.fc37.x86_64 warning: bash-5.1.16-2.fc36.x86_64 warning: -> ncurses-libs-6.2-9.20210508.fc36.x86_64 warning: -> glibc-2.35-2.fc37.x86_64 warning: glibc-common-2.35-2.fc37.x86_64 warning: -> glibc-2.35-2.fc37.x86_64 warning: -> bash-5.1.16-2.fc36.x86_64 warning: glibc-minimal-langpack-2.35-2.fc37.x86_64 warning: -> glibc-common-2.35-2.fc37.x86_64 warning: -> glibc-2.35-2.fc37.x86_64 If we look into SCC #1, bash obviously requires glibc because it links to it. The loop is created by glibc → glibc-common → bash, because glibc-common has %transfiletriggerin and %transfiletriggerpostun using bash to call /sbin/ldconfig. https://github.com/coreos/rpm-ostree/pull/3453 provides a workaround so that rpm-ostree doesn't choke on this. --- glibc.spec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/glibc.spec b/glibc.spec index 4e95224..4d7bad5 100644 --- a/glibc.spec +++ b/glibc.spec @@ -489,12 +489,14 @@ libraries, as well as national language (locale) support. # File triggers for when libraries are added or removed in standard # paths. -%transfiletriggerin common -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64 -/sbin/ldconfig +%transfiletriggerin common -P 2000000 -p -- /lib /usr/lib /lib64 /usr/lib64 +%glibc_post_funcs +call_ldconfig() %end -%transfiletriggerpostun common -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64 -/sbin/ldconfig +%transfiletriggerpostun common -P 2000000 -p -- /lib /usr/lib /lib64 /usr/lib64 +%glibc_post_funcs +call_ldconfig() %end # We need to run ldconfig manually because __brp_ldconfig assumes that