Unmask %license directive when parsing %files section
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 15 May 2012 11:23:35 +0000 (14:23 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 15 May 2012 11:23:35 +0000 (14:23 +0300)
- This always was a rare creature, driven to extinction long time
  ago when Copyright: changed to License: which masks the %license
  directive of %files list with a macro holding the the textual
  description from License tag, causing errors.
- Override %license during %files parsing to bring back its original
  meaning, useless as it might be in its current form.

build/parseFiles.c

index 9dccbad..ea0d638 100644 (file)
@@ -26,6 +26,9 @@ int parseFiles(rpmSpec spec)
        { 0, 0, 0, 0, 0, NULL, NULL}
     };
 
+    /* XXX unmask %license while parsing %files */
+    addMacro(spec->macros, "license", NULL, "%%license", RMIL_SPEC);
+
     if ((rc = poptParseArgvString(spec->line, &argc, &argv))) {
        rpmlog(RPMLOG_ERR, _("line %d: Error parsing %%files: %s\n"),
                 spec->lineNum, poptStrerror(rc));
@@ -92,6 +95,7 @@ int parseFiles(rpmSpec spec)
     res = nextPart;
 
 exit:
+    delMacro(NULL, "license");
     free(argv);
     poptFreeContext(optCon);