- The main package name is not known when we start parsing the preamble,
so newPackage() is called with NULL name and the early callers use
NULL to find it. Populate the name as soon as we know it so
various "%foo -n <name>" operations work on the main package too,
which got broken by commit
9929459f9967ecfe0a05d557bc42531944faa70a.
(cherry picked from commit
fed1298af7911145c953da8910fd5f2f15976374)
if (rpmCharCheck(spec, field, strlen(field), ".-_+%{}"))
goto exit;
headerPutString(pkg->header, tag, field);
+ /* Main pkg name is unknown at the start, populate as soon as we can */
+ if (pkg == spec->packages)
+ pkg->name = rpmstrPoolId(spec->pool, field, 1);
break;
case RPMTAG_VERSION:
case RPMTAG_RELEASE: