The AutoFu is perfectly okay, but there's deeper design problems here. First of, there's additional configuration that needs to be automated.
There are 2 usage cases, one for files, the other for package scriptlets, for bash --rpm-requires 1) for files The files have only %_foo_requires, there is no %_foo_provides. The reason there is that Requires: executable(whatever) is a "run-time probe" modeled on which(1) (and uglix PATH envvar): The "executable(whatever)" dependency is TRUE iff a) the executable is found on PATH (or is absolute path) b) access(2) claims the object on path is executable. I.e. The semantic for "executable(whatever)" is defined as a run-time condition, not as a dependency assertion string match from package metadata. The enabling for this extractor follows the usual conventions for disabling by undefining or setting to %{nil}. The sad reality is that almost all distros I'm aware of are choosing "opt-in" behavior akin to "Waiting for Godot ...". The implementation has been done since forever. 2) for package scriptlets The automated scriptlet dependencies also have no provides, again because "executable(whatever)" is a run-time probe that checks a condition not an essertion string. The enabling for automating scriptlet dependencies is OR'ing in 0x2 to %_use_internal_dependency_generator (0x1 enables ELF extraction and disables %_find_requires for ELF, 0x4 was used to prepare "LSB packages" until lack of interest from LSB in their own chosen format prevented finishing the implementation). Both of the above configuration changes need to be tied into AutoFu if you choose to automate from configure.ac (or no problem has really been automated or solved). I personally think that it isn't worth adding AutoFu for complex features that are routinely disabled (or rendered as default "opt-in" which is de facto "disabled"). hth 73 de Jeff On Jun 7, 2011, at 8:35 AM, Pinto Elia wrote: > RPM Package Manager, CVS Repository > http://rpm5.org/cvs/ > ____________________________________________________________________________ > > Server: rpm5.org Name: Pinto Elia > Root: /v/rpm/cvs Email: devzero2...@rpm5.org > Module: rpm Date: 07-Jun-2011 14:35:30 > Branch: HEAD Handle: 2011060712352900 > > Modified files: > rpm CHANGES configure.ac > rpm/macros macros.in > > Log: > define the scriplet_requires macro > as /bin/bash --rpm-requires only if bash have the > required patch. > > Submitted by: Elia Pinto > > Summary: > Revision Changes Path > 1.3652 +3 -0 rpm/CHANGES > 2.497 +16 -0 rpm/configure.ac > 1.57 +2 -2 rpm/macros/macros.in > ____________________________________________________________________________ > > patch -p0 <<'@@ .' > Index: rpm/CHANGES > ============================================================================ > $ cvs diff -u -r1.3651 -r1.3652 CHANGES > --- rpm/CHANGES 27 May 2011 13:47:29 -0000 1.3651 > +++ rpm/CHANGES 7 Jun 2011 12:35:29 -0000 1.3652 > @@ -8,6 +8,9 @@ > - afb: yaml: use !!timestamp for timestamps > > 5.4.0 -> 5.4.1: > + - devzero2000: define the scriplet_requires macro > + as /bin/bash --rpm-requires only if bash have the > + required patch. > - devzero2000: In fpLookupSubdir, data returned by hash should be of > type > "struct rpmffi_s **" instead of "struct rpmffi_s *" to avoid > segfault. Patch by Qing He. > @@ . > patch -p0 <<'@@ .' > Index: rpm/configure.ac > ============================================================================ > $ cvs diff -u -r2.496 -r2.497 configure.ac > --- rpm/configure.ac 26 May 2011 14:26:26 -0000 2.496 > +++ rpm/configure.ac 7 Jun 2011 12:35:29 -0000 2.497 > @@ -390,6 +390,22 @@ > AC_DEFINE([RPMVERCMP_DIGITS_BEAT_ALPHA],[1],[Permit in RPM version > comparison that digits beat alpha]) > ]) > > +dnl # Check if bash have the --rpm-requires patch > +dnl # If so define the scriptlet_requires output variable > +dnl # to "bash --rpm-requires" > +dnl # and BASH_RPM_REQUIRES to the bash absolute path > +AC_CACHE_CHECK([for bash if supports --rpm-requires], > [ac_cv_path_BASH_RPM_REQUIRES], > + [AC_PATH_PROGS_FEATURE_CHECK([BASH_RPM_REQUIRES], [bash], > + [[ bash_rpm_requires_out=`echo ls | $ac_path_BASH_RPM_REQUIRES > --rpm-requires | grep "executable(ls)"` > + test "x$bash_rpm_requires_out" != x \ > + && ac_cv_path_BASH_RPM_REQUIRES=$ac_path_BASH_RPM_REQUIRES > scriptlet_requires="$ac_path_BASH_RPM_REQUIRES --rpm-requires" > + ]], > + [[ scriptlet_requires="%{nil}" ]], [$PATH] > +)]) > +AS_IF([test "x$ac_cv_path_BASH_RPM_REQUIRES" != x], > + [AC_SUBST([BASH_RPM_REQUIRES],[$ac_cv_path_BASH_RPM_REQUIRES])], > + [AC_SUBST([BASH_RPM_REQUIRES],[:])]) > +AC_SUBST([scriptlet_requires]) > > dnl # FIXME: partly Linux-specific only!? > dnl # (but at least it usually doesn't harm on other platforms) > @@ . > patch -p0 <<'@@ .' > Index: rpm/macros/macros.in > ============================================================================ > $ cvs diff -u -r1.56 -r1.57 macros.in > --- rpm/macros/macros.in 26 May 2011 15:49:34 -0000 1.56 > +++ rpm/macros/macros.in 7 Jun 2011 12:35:29 -0000 1.57 > @@ -1,7 +1,7 @@ > #/*! \page config_macros Default configuration: @USRLIBRPM@/macros > # \verbatim > # > -# $Id: macros.in,v 1.56 2011/05/26 15:49:34 devzero2000 Exp $ > +# $Id: macros.in,v 1.57 2011/06/07 12:35:29 devzero2000 Exp $ > # > # This is a global RPM configuration file. All changes made here will > # be lost when the rpm package is upgraded. Any per-system configuration > @@ -940,7 +940,7 @@ > # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}. > #%__executable_provides %{_rpmhome}/executabledeps.sh --provides > #%__executable_requires %{_rpmhome}/executabledeps.sh --requires > -%__scriptlet_requires %{__bash} --rpm-requires > +%__scriptlet_requires @scriptlet_requires@ > > > #============================================================================== > # XXX Caveat: > @@ . > ______________________________________________________________________ > RPM Package Manager http://rpm5.org > CVS Sources Repository rpm-...@rpm5.org
smime.p7s
Description: S/MIME cryptographic signature