Re: [CVS] RPM: rpm/ CHANGES configure.ac rpm/macros/ macros.in
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: RevisionChanges 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 - 1.3651 +++ rpm/CHANGES 7 Jun 2011 12:35:29 - 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 - 2.496 +++ rpm/configure.ac 7 Jun 2011 12:35:29 - 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])], +
Re: [CVS] RPM: rpm/ CHANGES configure.ac rpm/macros/ macros.in
On Tue, Jun 7, 2011 at 4:03 PM, Jeff Johnson n3...@mac.com wrote: 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. Setting to %nil what ? I am sorry, i have read all the code(lib/rpmfc.c in particular), but i have not found nothing (Aside) ./scripts/executabledeps.sh is not more used right ? 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). If have thought that putting %__scriptlet_requires to %{nil} was the right disabler: my toy patch do this. Was i wrong then ? No problem, it is sufficient to know where to look better. 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). Thanks, IMHO the truly solution is to have a deps shell generator indipendent from a patch not upstream. Yes, i remember that this is something to discuss. 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: RevisionChanges 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 - 1.3651 +++ rpm/CHANGES 7 Jun 2011 12:35:29 - 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 - 2.496 +++ rpm/configure.ac 7 Jun 2011 12:35:29 - 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