Use RPMMACRO_LITERAL/ME_LITERAL when defining some macros
It is used for setting __file_name, __file_lineno, buildsubdir. We also use it for unmasking %license in the %files section.
This commit is contained in:
parent
cc66df4fa1
commit
490c70d43c
|
@ -2234,7 +2234,7 @@ int readManifest(rpmSpec spec, const char *path, const char *descr, int flags,
|
|||
goto exit;
|
||||
}
|
||||
|
||||
rpmPushMacro(spec->macros, "__file_name", NULL, fn, RMIL_SPEC);
|
||||
rpmPushMacroFlags(spec->macros, "__file_name", NULL, fn, RMIL_SPEC, RPMMACRO_LITERAL);
|
||||
|
||||
nlines = 0;
|
||||
while (fgets(buf, sizeof(buf), fd)) {
|
||||
|
@ -2279,7 +2279,7 @@ static rpmRC readFilesManifest(rpmSpec spec, Package pkg, const char *path)
|
|||
flags |= ALLOW_EMPTY;
|
||||
|
||||
/* XXX unmask %license while parsing files manifest*/
|
||||
rpmPushMacro(spec->macros, "license", NULL, "%%license", RMIL_SPEC);
|
||||
rpmPushMacroFlags(spec->macros, "license", NULL, "%license", RMIL_SPEC, RPMMACRO_LITERAL);
|
||||
|
||||
nlines = readManifest(spec, path, "%files", flags, &(pkg->fileList), NULL);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ int parseFiles(rpmSpec spec)
|
|||
};
|
||||
|
||||
/* XXX unmask %license while parsing %files */
|
||||
rpmPushMacro(spec->macros, "license", NULL, "%%license", RMIL_SPEC);
|
||||
rpmPushMacroFlags(spec->macros, "license", NULL, "%license", RMIL_SPEC, RPMMACRO_LITERAL);
|
||||
|
||||
if ((rc = poptParseArgvString(spec->line, &argc, &argv))) {
|
||||
rpmlog(RPMLOG_ERR, _("line %d: Error parsing %%files: %s\n"),
|
||||
|
|
|
@ -302,7 +302,7 @@ static int doSetupMacro(rpmSpec spec, const char *line)
|
|||
headerGetString(spec->packages->header, RPMTAG_NAME),
|
||||
headerGetString(spec->packages->header, RPMTAG_VERSION));
|
||||
}
|
||||
rpmPushMacro(spec->macros, "buildsubdir", NULL, spec->buildSubdir, RMIL_SPEC);
|
||||
rpmPushMacroFlags(spec->macros, "buildsubdir", NULL, spec->buildSubdir, RMIL_SPEC, RPMMACRO_LITERAL);
|
||||
|
||||
/* cd to the build dir */
|
||||
{ char * buildDir = rpmGenPath(spec->rootDir, "%{_builddir}", "");
|
||||
|
|
|
@ -144,7 +144,7 @@ static OFI_t * pushOFI(rpmSpec spec, const char *fn)
|
|||
ofi->readPtr = NULL;
|
||||
ofi->next = spec->fileStack;
|
||||
|
||||
rpmPushMacro(spec->macros, "__file_name", NULL, fn, RMIL_SPEC);
|
||||
rpmPushMacroFlags(spec->macros, "__file_name", NULL, fn, RMIL_SPEC, RPMMACRO_LITERAL);
|
||||
|
||||
spec->fileStack = ofi;
|
||||
return spec->fileStack;
|
||||
|
@ -202,7 +202,7 @@ int specExpand(rpmSpec spec, int lineno, const char *sbuf,
|
|||
int rc;
|
||||
|
||||
snprintf(lnobuf, sizeof(lnobuf), "%d", lineno);
|
||||
rpmPushMacro(spec->macros, "__file_lineno", NULL, lnobuf, RMIL_SPEC);
|
||||
rpmPushMacroFlags(spec->macros, "__file_lineno", NULL, lnobuf, RMIL_SPEC, RPMMACRO_LITERAL);
|
||||
|
||||
rc = (rpmExpandMacros(spec->macros, sbuf, obuf, 0) < 0);
|
||||
|
||||
|
|
|
@ -1696,7 +1696,7 @@ static int loadMacroFile(rpmMacroContext mc, const char * fn)
|
|||
if (fd == NULL)
|
||||
goto exit;
|
||||
|
||||
pushMacro(mc, "__file_name", NULL, fn, RMIL_MACROFILES, ME_NONE);
|
||||
pushMacro(mc, "__file_name", NULL, fn, RMIL_MACROFILES, ME_LITERAL);
|
||||
|
||||
buf[0] = '\0';
|
||||
while ((nlines = rdcl(buf, blen, fd)) > 0) {
|
||||
|
@ -1712,7 +1712,7 @@ static int loadMacroFile(rpmMacroContext mc, const char * fn)
|
|||
n++; /* skip % */
|
||||
|
||||
snprintf(lnobuf, sizeof(lnobuf), "%d", lineno);
|
||||
pushMacro(mc, "__file_lineno", NULL, lnobuf, RMIL_MACROFILES, ME_NONE);
|
||||
pushMacro(mc, "__file_lineno", NULL, lnobuf, RMIL_MACROFILES, ME_LITERAL);
|
||||
if (defineMacro(mc, n, RMIL_MACROFILES))
|
||||
nfailed++;
|
||||
popMacro(mc, "__file_lineno");
|
||||
|
|
Loading…
Reference in New Issue