[repo-coord] Re: mach and conditional BuildRequires:
Jeff Pitman
jeff.pitman at msa.hinet.net
Sun Apr 4 14:56:36 CEST 2004
On Saturday 27 March 2004 03:23, Fernando Pablo Lopez-Lezcano wrote:
>
> But it looks like mach is using something different to get the
> BuildRequires as it always gets all of them...
>
I'm just starting to get into mach as well; though, there are some
missing features that DAR has that would be nice to make a totally
integrated system (for example, standard directory creation and
synchronization, a la dar-sync). Anyway, mach uses it's own macro
expansion facility using regular expressions in python. It's far from
complete.
It would be nice if the rpm -D/-E option functions were replicated in
Python so that mach and other utilities can use them. This would then
allow for conditionals or macros to define whatever you want in anyway
you want (as long as rpm can read it...)
I'm certain some kind of shell script could be hacked up that utilizes
these; these are just some steps...
1. Grep out the defines.
2. Recursively expand defines as macros themselves. (In case they
reference macros too.)
3. Assign defines as some pairing in a variable list DEFINES.
4. Generate DEFARGS by taking a pairing from DEFINES (a, b) and
concatenate to the list of DEFARGS like -D 'a b'.
5. Formulate the rpmdb commandline:
$ rpmdb $DEFARGS -E '%{expand:%(cat your.spec)}'
Currently, rpmdb will spew some Target buffer overflow out, but it still
expands and prints to stdout the modified spec file. If -D 'version
x.y.z' is part of DEFARGS, then the Source:/Patch: lines will be
resolved as well...
Anyway, this is definitely something that'd be nice either functioning
from python or better support from the commandline. (Maybe spectool
would be nice to expand into this...)
take care,
--
-jeff
More information about the repo-coord
mailing list