From 8eb3f4254ee2ab1213c3cc55d3c8b419c8d11d09 Mon Sep 17 00:00:00 2001 From: Vít Ondruch Date: Mar 17 2020 09:25:11 +0000 Subject: Prohibit use of `rpm` command from specfile. This might be problematic, if buildroot was populated using a different version of rpm that used a different backend database. Original discussion at https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/QKTLQ2AITO5MVSX77GYDHTD24ZW7MLFO/ --- diff --git a/guidelines/modules/ROOT/pages/index.adoc b/guidelines/modules/ROOT/pages/index.adoc index ac0563c..1dc0f8d 100644 --- a/guidelines/modules/ROOT/pages/index.adoc +++ b/guidelines/modules/ROOT/pages/index.adoc @@ -1754,6 +1754,10 @@ If the automatic checks and modifications break a package, there are two primary If (and only if) the script needs to remain executable and cannot be modified to pass the checks, then the maintainer MAY elect to disable the checks and modifications. It is also possible to disable the functionality for specific paths or for specific shebang lines by setting `+%__brp_mangle_shebangs_exclude_from+` and `+%__brp_mangle_shebangs_exclude+`, respectively, using the same syntax as the settings described in xref:AutoProvidesAndRequiresFiltering.adoc[Packaging:AutoProvidesAndRequiresFiltering]. It is also possible to disable the functionality entirely by adding `+%undefine __brp_mangle_shebangs+` near the beginning of the specfile. +== Do not call `rpm` command from specfile + +`rpm` command in specfile MUST NOT be used, because it couldn't be guaranteed to work in the case that the buildroot was populated using a different version of rpm that used a different backend database. If that is the case, call to `rpm` might result in build failure. + == BRP (BuildRoot Policy) Scripts BRP scripts are injected at the end of `+%install+` (via the `+%__os_install_post+` macro) and perform some automatic sanity checks of, or adjustments to, files installed in the build root.