summaryrefslogtreecommitdiff
path: root/lib/rpmscript.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-09-12 13:02:13 +0300
committerPanu Matilainen <pmatilai@redhat.com>2011-09-12 13:02:13 +0300
commit60745080a36bbd64b5194bd764cc38dd215dc56d (patch)
treea7453a77781e32d326ae9b159b769667a695815f /lib/rpmscript.c
parent5b9681afee60e3049306b5daa16924011bebed20 (diff)
downloadlibrpm-tizen-60745080a36bbd64b5194bd764cc38dd215dc56d.tar.gz
librpm-tizen-60745080a36bbd64b5194bd764cc38dd215dc56d.tar.bz2
librpm-tizen-60745080a36bbd64b5194bd764cc38dd215dc56d.zip
Actually remember scriptlet flags in the rpmScript struct
- Currently doesn't make any difference but since we actually have a flags member in the struct, might as well use it. Also we'll shortly be needing these during the actual execution too.
Diffstat (limited to 'lib/rpmscript.c')
-rw-r--r--lib/rpmscript.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rpmscript.c b/lib/rpmscript.c
index 66ab94486..57c24c674 100644
--- a/lib/rpmscript.c
+++ b/lib/rpmscript.c
@@ -378,16 +378,17 @@ static rpmScript rpmScriptNew(Header h, rpmTagVal tag, const char *body,
char *nevra = headerGetAsString(h, RPMTAG_NEVRA);
rpmScript script = xcalloc(1, sizeof(*script));
script->tag = tag;
+ script->flags = flags;
script->body = (body != NULL) ? xstrdup(body) : NULL;
rasprintf(&script->descr, "%s(%s)", tag2sln(tag), nevra);
/* macros need to be expanded before possible queryformat */
- if (script->body && (flags & RPMSCRIPT_FLAG_EXPAND)) {
+ if (script->body && (script->flags & RPMSCRIPT_FLAG_EXPAND)) {
char *body = rpmExpand(script->body, NULL);
free(script->body);
script->body = body;
}
- if (script->body && (flags & RPMSCRIPT_FLAG_QFORMAT)) {
+ if (script->body && (script->flags & RPMSCRIPT_FLAG_QFORMAT)) {
/* XXX TODO: handle queryformat errors */
char *body = headerFormat(h, script->body, NULL);
free(script->body);