@dmnks commented on this pull request.
> + if (checkForEncoding(pkg->header, 0) != RPMRC_OK) {
+ badenc = 1;
+ }
+ }
+ if (badenc)
+ goto errxit;
+ }
+
+ closeSpec(spec);
+
+exit:
+ return spec;
+
+errxit:
+ if (!secondary)
+ rpmSpecFree(spec);
Wouldn't this cause a double-free in `parseSpec()`? We do the same freeing
there in `errxit`. Moreover, it seems like freeing the passed structure should
really be the responsibility of the caller...?
> @@ -1129,3 +1157,26 @@ rpmSpec rpmSpecParse(const char *specFile,
> rpmSpecFlags flags,
{
return parseSpec(specFile, flags, buildRoot, 0);
}
+
+rpmRC parseGeneratedSpecs(rpmSpec spec)
+{
+ ARGV_t argv = NULL;
+ int argc = 0;
+ int i;
+
+ char * specPattern = rpmGenPath("%{specpartsdir}", NULL, "*.specpart");
+ if (rpmGlob(specPattern, &argc, &argv) == 0) {
+ for (i = 0; i < argc; i++) {
+ rpmlog(RPMLOG_NOTICE, "Reading %s\n", argv[i]);
+ pushOFI(spec, argv[i]);
+ snprintf(spec->fileStack->readBuf, spec->fileStack->readBufLen,
+ "# Spec part read from %s\n\n", argv[i]);
+ if (parseSpecSection(spec, 1)) {
This should've probably been `!parseSpecSection(spec, 1)`
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1485#pullrequestreview-1162077690
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/1485/review/1162077...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint