Support run-time macro and queryformat expansion on scriptlets
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 11 Mar 2010 10:06:49 +0000 (12:06 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 11 Mar 2010 10:06:49 +0000 (12:06 +0200)
commitd370816ba508a33cc39252cbb9ba85dcd99504d5
tree1eb5a3af5091ba2bb24a26709f5440f9b4f6b7a8
parentd0a959a571d7b34ea2263619b8cfba623a425c44
Support run-time macro and queryformat expansion on scriptlets
- Add per-scriptlet type flag tags to control special behavior.
- Add rpmlib dependency on scriptlet expansion - if a package relies
  on scriptlet expansion it cannot be correctly installed with
  a version of rpm that doesn't support it.
- Expansion is always an opt-in behavior, enabled with -q and/or -e argument
  in spec. We can't just blindly expand even macros as there's no telling
  %{} constructs might mean in whatever language is used for the script.
- Queryformat expansion requires great care with strange and ugly escapes
  when writing scriptlets, but OTOH it permits access arbitrary header
  data at runtime, which has previously been completely impossible.
- The handling of these expansions needs unifying for all scriptlet types,
  the trigger scriptlet handling is uuugly. Macro expansion could be
  transparently done from rpmScriptRun(), but because of their similar
  syntax, macro expansion needs to happen before query format expansion,
  and we dont have the header available in rpmScriptrun()
build/pack.c
build/parseScript.c
build/rpmspec.h
lib/psm.c
lib/rpmds.c
lib/rpmscript.c
lib/rpmscript.h
lib/rpmtag.h
tests/rpmgeneral.at